1/*! For license information please see 9754.b5fcef8f9af74bdc4b7e.js.LICENSE.txt */ 2"use strict";(self.webpackChunkskeno_web=self.webpackChunkskeno_web||[]).push([[9754],{99754:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){var m,aa=[];function ba(t){return function(){return aa[t].apply(this,arguments)}}function ca(t,e){return aa[t]=e}function da(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}function ea(t){var e="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return e?e.call(t):{next:da(t)}}function fa(t){for(var e,i=[];!(e=t.next()).done;)i.push(e.value);return i}function ia(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof __webpack_require__.g&&__webpack_require__.g];for(var e=0;e<t.length;++e){var i=t[e];if(i&&i.Math==Math)return i}throw Error("Cannot find global object")}var ja=ia(this),ka="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,i){return t==Array.prototype||t==Object.prototype||(t[e]=i.value),t},oa;function la(t,e){if(e)t:{var i=ja;t=t.split(".");for(var r=0;r<t.length-1;r++){var n=t[r];if(!(n in i))break t;i=i[n]}(e=e(r=i[t=t[t.length-1]]))!=r&&null!=e&&ka(i,t,{configurable:!0,writable:!0,value:e})}}function ma(t){return(t={next:t})[Symbol.iterator]=function(){return this},t}function na(t,e){t instanceof String&&(t+="");var i=0,r=!1,n={next:function(){if(!r&&i<t.length){var n=i++;return{value:e(n,t[n]),done:!1}}return r=!0,{done:!0,value:void 0}}};return n[Symbol.iterator]=function(){return n},n}if(la("Symbol",function(t){function e(t,e){this.Ux=t,ka(this,"description",{configurable:!0,writable:!0,value:e})}if(t)return t;e.prototype.toString=function(){return this.Ux};var i="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",r=0;return function t(n){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return new e(i+(n||"")+"_"+r++,n)}}),la("Symbol.iterator",function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var e="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),i=0;i<e.length;i++){var r=ja[e[i]];"function"==typeof r&&"function"!=typeof r.prototype[t]&&ka(r.prototype,t,{configurable:!0,writable:!0,value:function(){return ma(da(this))}})}return t}),la("globalThis",function(t){return t||ja}),la("Array.prototype.keys",function(t){return t||function(){return na(this,function(t){return t})}}),la("Array.prototype.find",function(t){return t||function(t,e){t:{var i=this;i instanceof String&&(i=String(i));for(var r=i.length,n=0;n<r;n++){var o=i[n];if(t.call(e,o,n,i)){t=o;break t}}t=void 0}return t}}
2),"function"==typeof Object.setPrototypeOf)oa=Object.setPrototypeOf;else{var pa;t:{var qa={a:!0},ra={};try{ra.__proto__=qa,pa=ra.a;break t}catch(a){}pa=!1}oa=pa?function(t,e){if(t.__proto__=e,t.__proto__!==e)throw new TypeError(t+" is not extensible");return t}:null}var ta=oa;function ua(t){return t||Array.prototype.fill}la("Object.setPrototypeOf",function(t){return t||ta}),la("Array.prototype.entries",function(t){return t||function(){return na(this,function(t,e){return[t,e]})}}),la("Object.values",function(t){return t||function(t){var e,i=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.push(t[e]);return i}}),la("Object.is",function(t){return t||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}}),la("Array.prototype.includes",function(t){return t||function(t,e){var i=this;i instanceof String&&(i=String(i));var r=i.length;for(0>(e=e||0)&&(e=Math.max(e+r,0));e<r;e++){var n=i[e];if(n===t||Object.is(n,t))return!0}return!1}}),la("String.prototype.includes",function(t){return t||function(t,e){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==(this+"").indexOf(t,e||0)}}),la("Promise",function(t){function e(t){this.o=0,this.qf=void 0,this.Uh=[],this.Vu=!1;var e=this.cp();try{t(e.resolve,e.reject)}catch(t){e.reject(t)}}function i(){this.He=null}function r(t){return t instanceof e?t:new e(function(e){e(t)})}if(t)return t;i.prototype.dt=function(t){if(null==this.He){this.He=[];var e=this;this.et(function(){e.ez()})}this.He.push(t)};var n=ja.setTimeout;i.prototype.et=function(t){n(t,0)},i.prototype.ez=function(){for(;this.He&&this.He.length;){var t=this.He;this.He=[];for(var e=0;e<t.length;++e){var i=t[e];t[e]=null;try{i()}catch(t){this.ry(t)}}}this.He=null},i.prototype.ry=function(t){this.et(function(){throw t})},e.prototype.cp=function(){function t(t){return function(r){i||(i=!0,t.call(e,r))}}var e=this,i=!1;return{resolve:t(this.UC),reject:t(this.zr)}},e.prototype.UC=function(t){if(t===this)this.zr(new TypeError("A Promise cannot resolve to itself"));else if(t instanceof e)this.jD(t);else{t:switch(typeof t){case"object":var i=null!=t;break t;case"function":i=!0;break t;default:i=!1}i?this.TC(t):this.Zt(t)}},e.prototype.TC=function(t){var e=void 0;try{e=t.then}catch(t){return void this.zr(t)}"function"==typeof e?this.kD(e,t):this.Zt(t)},e.prototype.zr=function(t){this.ex(2,t)},e.prototype.Zt=function(t){this.ex(1,t)},e.prototype.ex=function(t,e){if(0!=this.o)throw Error("Cannot settle("+t+", "+e+"): Promise already settled in state"+this.o);this.o=t,this.qf=e,2===this.o&&this.XC(),this.gz()},e.prototype.XC=function(){var t=this;n(function(){if(t.SB()){var e=ja.console;void 0!==e&&e.error(t.qf)}},1)},e.prototype.SB=function(){if(this.Vu)return!1;var t=ja.CustomEvent,e=ja.Event,i=ja.dispatchEvent;return void 0===i||("function"==typeof t?t=new t("unhandledrejection",{cancelable:!0}):"function"==typeof e?t=new e("unhandledrejection",{cancelable:!0}):(t=ja.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,t),t.promise=this,t.reason=this.qf,i(t))},e.prototype.gz=function(){if(null!=this.Uh){for(var t=0;t<this.Uh.length;++t)o.dt(this.Uh[t]);this.Uh=null}};var o=new i;return e.prototype.jD=function(t){var e=this.cp();t.Kl(e.resolve,e.reject)},e.prototype.kD=function(t,e){var i=this.cp();try{t.call(e,i.resolve,i.reject)}catch(t){i.reject(t)}},e.prototype.then=function(t,i){function r(t,e){return"function"==typeof t?function(e){try{n(t(e))}catch(t){o(t)}}:e}var n,o,s=new e(function(t,e){n=t,o=e});return this.Kl(r(t,n),r(i,o)),s},e.prototype.catch=function(t){return this.then(void 0,t)},e.prototype.Kl=function(t,e){function i(){switch(r.o){case 1:t(r.qf);break;case 2:e(r.qf);break;default:throw Error("Unexpected state: "+r.o)}}var r=this;null==this.Uh?o.dt(i):this.Uh.push(i),this.Vu=!0},e.resolve=r,e.reject=function(t){return new e(function(e,i){i(t)})},e.race=function(t){return new e(function(e,i){for(var n=ea(t),o=n.next();!o.done;o=n.next())r(o.value).Kl(e,i)})},e.all=function(t){var i=ea(t),n=i.next();return n.done?r([]):new e(function(t,e){function o(e){return function(i){s[e]=i,0==--a&&t(s)}}var s=[],a=0;do{s.push(void 0),a++,r(n.value).Kl(o(s.length-1),e),n=i.next()}while(!n.done)})},e}),la("Object.entries",function(t){return t||function(t){var e,i=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.push([e,t[e]]);return i}}
2),la("Array.prototype.fill",function(t){return t||function(t,e,i){var r=this.length||0;for(0>e&&(e=Math.max(0,r+e)),(null==i||i>r)&&(i=r),0>(i=Number(i))&&(i=Math.max(0,r+i)),e=Number(e||0);e<i;e++)this[e]=t;return this}}),la("Int8Array.prototype.fill",ua),la("Uint8Array.prototype.fill",ua),la("Uint8ClampedArray.prototype.fill",ua),la("Int16Array.prototype.fill",ua),la("Uint16Array.prototype.fill",ua),la("Int32Array.prototype.fill",ua),la("Uint32Array.prototype.fill",ua),la("Float32Array.prototype.fill",ua),la("Float64Array.prototype.fill",ua);var va="function"==typeof Object.assign?Object.assign:function(t,e){for(var i=1;i<arguments.length;i++){var r=arguments[i];if(r)for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};la("Object.assign",function(t){return t||va}),la("Math.log2",function(t){return t||function(t){return Math.log(t)/Math.LN2}});var wa=this||self;function xa(t,e,i,r){t=t.split("."),r=r||wa,t[0]in r||void 0===r.execScript||r.execScript("var "+t[0]);for(var n;t.length&&(n=t.shift());)if(t.length||void 0===e)r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={};else if(!i&&ya(e)&&ya(r[n]))for(var o in e)e.hasOwnProperty(o)&&(r[n][o]=e[o]);else r[n]=e}function za(){}function Aa(t){var e=typeof t;return"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}function Ba(t){var e=Aa(t);return"array"==e||"object"==e&&"number"==typeof t.length}function ya(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}function Ca(t){return Object.prototype.hasOwnProperty.call(t,Da)&&t[Da]||(t[Da]=++Ea)}var Da="closure_uid_"+(1e9*Math.random()>>>0),Ea=0;function Fa(t,e,i){return t.call.apply(t.bind,arguments)}function Ha(t,e,i){if(!t)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var i=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(i,r),t.apply(e,i)}}return function(){return t.apply(e,arguments)}}function Ia(t,e,i){return(Ia=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?Fa:Ha).apply(null,arguments)}function Ja(t,e){var i=Array.prototype.slice.call(arguments,1);return function(){var e=i.slice();return e.push.apply(e,arguments),t.apply(this,e)}}function t(t,e){xa(t,e,!0,void 0)}function u(t,e){function i(){}i.prototype=e.prototype,t.g=e.prototype,t.prototype=new i,t.prototype.constructor=t,t.YD=function(t,i,r){for(var n=Array(arguments.length-2),o=2;o<arguments.length;o++)n[o-2]=arguments[o];return e.prototype[i].apply(t,n)}}function Ka(t,e){for(var i in t)if(e.call(void 0,t[i],i,t))return!0;return!1}function La(t){for(var e in t)return!1;return!0}function Ma(t){var e,i={};for(e in t)i[e]=t[e];return i}var Na="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Oa(t,e){for(var i,r,n=1;n<arguments.length;n++){for(i in r=arguments[n])t[i]=r[i];for(var o=0;o<Na.length;o++)i=Na[o],Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}}function Pa(t,e){if(Error.captureStackTrace)Error.captureStackTrace(this,Pa);else{var i=Error().stack;i&&(this.stack=i)}t&&(this.message=String(t)),e&&(this.$D=e)}u(Pa,Error),Pa.prototype.name="CustomError";var Qa=Array.prototype.indexOf?function(t,e){return Array.prototype.indexOf.call(t,e,void 0)}:function(t,e){if("string"==typeof t)return"string"!=typeof e||1!=e.length?-1:t.indexOf(e,0);for(var i=0;i<t.length;i++)if(i in t&&t[i]===e)return i;return-1};function Ra(){return Object.create(x,void 0)}var z=Ia,Sa=String,Ta=globalThis.Object.freeze||function(t){return t};function Ua(t){for(var e,i=Object.keys(t),r=i.length;r--;)ya(e=t[i[r]])&&Ua(e);return Ta(t)}function Va(t){var e=Aa(t);if("object"==e||"array"==e){if(Wa(t.clone))return t.clone();for(var i in e="array"==e?[]:{},t)t.hasOwnProperty(i)&&(e[i]=Va(t[i]));return e}return t}var A=[].pop(),x=/x/.exec(""),Xa="prototype constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function B(t,e,i,r,n){if(!(e=t instanceof e)&&i)throw new C(i,r,Ya(n)?n:t);return e}function Za(t,e){if(!0===(B(t,e)&&t.constructor===e))throw new TypeError("Illegal constructor "+$a(e))}function Wa(t){return"function"==Aa(t)}function ab(t,e,i,r,n){if(!(e=cb(t)===e)&&i)throw new C(i,r,Ya(n)?n:t);return e}function db(t,e,i,r){return ab(t,"Array",e,i,r)}function Ya(t){return t!==A}function eb(t){return"string"==typeof t}t("H.lang.isArray",db),t("H.lang.isString",eb);var fb=parseInt,gb=parseFloat,E=isNaN;function hb(t){return t===+t}function ib(t){return!E(+t)}function cb(t){var e=Object[Xa[0]][Xa[6]].call(t).match(/^\[object (\w+)\]$/);return e?e[1]:typeof t}
2t("H.lang.isNumber",hb),t("H.lang.isInteger",Number.isInteger?Number.isInteger:function(t){return"number"==typeof t&&0==t%1});var jb=[];function kb(t){0>jb.indexOf(t)&&jb.push(t)}function $a(t,e,i,r){var n,o="",s=2>arguments.length;return s&&(e={H:globalThis.H},i="",r=jb.slice()),lb(e,!0,function(e,s){try{if(s=mb(e,n=e[s]),!(ya(n)&&n.window===n&&n.self===n||ya(n)&&0<n.nodeType&&Wa(n.cloneNode))&&ya(n)){if(n===t)return o=i+"."+s,!0;if(0>r.indexOf(n)&&(r.push(n),o=$a(t,n,i+"."+s,r)))return!0}}catch(t){}}),s&&(o=o?o.substr(1).replace("."+Xa[0]+".","#"):"~"+(Wa(t)?nb(t)+"()":cb(t))),o}function mb(t,e){var i=[];return lb(t,!1,function(t,r){t[r]===e&&i.push(r)}),i.sort(ob)[0]}function ob(t,e){return e.length-t.length}kb(jb);var rb=Object[Xa[0]][Xa[2]];function lb(t,e,i){var r;if(t){for(n in t)if((!e||rb.call(t,n))&&i(t,n,!0))return;for(r=Xa.length;r--;){var n=Xa[r];if((!e||rb.call(t,n))&&i(t,n,!1))break}}}function nb(t){return(t=/^\s*function ([^\( ]+)/.exec(t))?t[1]:"anonymous"}function sb(t,e,i){i[e]="#"+e}var tb=!!globalThis.__karma__;function ub(){throw Error("unimplemented method")}function C(t,e,i){var r,n=arguments.length;(e=e!==A?+e:e)!==A&&((r=/^.*?\(([^\)]+)/.exec((""+t).replace(/(\/\*([\s\S]*?)\*\/)|(\/\/(.*)$)/gm,"")))?(r=r[1].replace(/\s+/g,""),r=Sa(r).split(","!==A?",":" ")):r=[],r.forEach(sb),r=r[e]||"#"+e);var o=t?$a(t):"";return n=2<n?Sa(i):"",(r||n)&&(o+=" (Argument "+(r||"")+(n?" "+n:"")+")"),n=Error(o),Object.setPrototypeOf(n,C.prototype),n}function vb(t,e){var i=[];return t&&i.push($a(t)),1<arguments.length&&i.push(""+e),i=Error(i.join(" ")),Object.setPrototypeOf(i,vb.prototype),i}u(C,Error),t("H.lang.InvalidArgumentError",C),C.prototype.name="InvalidArgumentError",u(vb,Error),t("H.lang.IllegalOperationError",vb),vb.prototype.name="IllegalOperationError";var wb=Math,xb=wb.min,yb=wb.max,zb=wb.round,Ab=wb.floor,Bb=wb.ceil,Cb=wb.abs,Db=wb.log,Eb=wb.sqrt,Fb=wb.pow,Gb=wb.exp,Hb=wb.sin,Ib=wb.asin,Jb=wb.cos,Kb=wb.tan,Lb=wb.atan,Mb=wb.atan2,Nb=wb.LN2,Ob=wb.PI,Pb=Ob/2,Qb=Ob/4,Rb=2*Ob,Sb=3*Ob,Tb=Ob/180,Ub=180/Ob,Vb=1/0,Wb=Fb(-2,53),Xb=Xb||function(t){return Db(t)/Nb};function Yb(t,e){var i;return 0>(i=t%e)==0>e?i:i+e}function Zb(t,e,i){return e-=i=i||0,(t-=i)-Ab(t/e)*e+i}function $b(t,e,i){return(t-=0)>i?i:t<e?e:t}function ac(t,e,i,r){return(r-=0)||(r=0),e<i?t>=e-r&&t<=i+r:t>=i-r&&t<=e+r}t("H.math.normalize",Zb),t("H.math.clamp",$b);var bc={NONE:0,VERTEX:1,EDGE:2,SURFACE:3};function cc(t,e,i,r,n,o){var s=i.length,a=s,l=i[0],c=0,h=0,u=0;r=r/2||0;var p=o||2;o=p*(n?0:1)+1;for(var d=p-2;1!=c&&a>o;){a-=d;var m=i[--a];p=i[--a];var f=i[a?a-d-1:(s+(a-d-1))%s],g=i[a?a-d-2:(s+(a-d-2))%s];p>=t-r&&p<=t+r&&m>=e-r&&m<=e+r||g>=t-r&&g<=t+r&&f>=e-r&&f<=e+r?c=1:c||p!==t?!c&&ac(t,p,g,r)&&((p<t&&g>t||p>t&&g<t)&&(h+=(l=m+(t-p)/(g-p)*(f-m))>e,u+=l<e),c=ac(e,m,f,r)&&Eb(Fb((t-g)*(m-f)-(e-f)*(p-g),2)/(Fb(p-g,2)+Fb(m-f,2)))<=r?2:0):(g===t&&(m<e&&f>e||m>e&&f<e)||(l<=t&&g>t||l>=t&&g<t)&&(m>=e?++h:++u),c=ac(e,m,f,r)&&Eb(Fb((t-g)*(m-f)-(e-f)*(p-g),2)/(Fb(p-g,2)+Fb(m-f,2)))<=r?2:0),l=p}return!c&&n&&0!==u&&0!=h%2&&(c=3),c}function dc(t,e){return cc(t.x,t.y,e,0,!0)!==bc.NONE}function ec(t){for(var e=t.length,i=new Float64Array(2*e),r=e&&Ya(t[0].x);e--;){var n=t[e],o=e<<1;i[o]=r?n.x:n[0],i[o+1]=r?n.y:n[1]}return i}function F(t,e){this.x=+t,this.y=+e}function fc(t){if(!t)throw Error("invalid argument");return t instanceof F?t:new F(t.x,t.y)}function gc(t){var e=hc[t];if(!e)if(t in ic)e=hc[t]=t;else{e=jc.length;var i="",r=t.substr(0,1).toUpperCase()+t.substr(1),n="",o=!1;kc&&(o=(n=kc+r)in ic);for(;e--&&!o;)o=(n=(i=jc[e])+r)in ic;if(o&&(kc=i),!(e=o?n:null))throw Error("Could not find any variant of CSS property ["+t+"]");hc[t]=e}return e}t("H.math.CoverType",bc),t("H.math.isPointInsidePolygon",dc),t("H.math.flatten",ec),t("H.math.Point",F),F.prototype.set=F,F.prototype.set=F.prototype.set,F.prototype.clone=function(t){return t?(t.x=this.x,t.y=this.y):t=new F(this.x,this.y),t},F.prototype.clone=F.prototype.clone,F.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},F.prototype.add=F.prototype.add,F.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},F.prototype.sub=F.prototype.sub,F.prototype.scale=function(t,e){return this.x*=t,this.y*=void 0===e?t:e,this},F.prototype.scale=F.prototype.scale,F.prototype.round=function(){return this.x=zb(this.x),this.y=zb(this.y),this},F.prototype.round=F.prototype.round,F.prototype.floor=function(){return this.x=Ab(this.x),this.y=Ab(this.y),this},F.prototype.floor=F.prototype.floor,F.prototype.ceil=function(){return this.x=Bb(this.x),this.y=Bb(this.y),this},F.prototype.ceil=F.prototype.ceil,F.prototype.da=function(t){return!(!t||this.x!==t.x||this.y!==t.y)},F.prototype.equals=F.prototype.da,F.prototype.mu=function(t,e){var i=e.x-t.x,r=e.y-t.y,n=t;return(i||r)&&(n=0>=(n=((this.x-t.x)*i+(this.y-t.y)*r)/(i*i+r*r))?t:1<=n?e:new F(t.x+n*i,t.y+n*r)),n},F.prototype.getNearest=F.prototype.mu,F.prototype.ib=function(t){return Eb(Fb(this.x-t.x,2)+Fb(this.y-t.y,2))},F.prototype.distance=F.prototype.ib,F.fromIPoint=fc,t("H.dom.cssPrefixer.prefix",gc);var jc=["O","Ms","ms","Moz","Webkit"],hc={},kc="",ic=document.createElement("span").style;function lc(t){wa.setTimeout(function(){throw t},0)}function mc(t,e){this.uB=100,this.My=t,this.zg=e,this.bn=0,this.Am=null}function nc(){this.po=this.Gi=null}
2mc.prototype.get=function(){if(0<this.bn){this.bn--;var t=this.Am;this.Am=t.next,t.next=null}else t=this.My();return t},mc.prototype.put=function(t){this.zg(t),this.bn<this.uB&&(this.bn++,t.next=this.Am,this.Am=t)},nc.prototype.add=function(t,e){var i=oc.get();i.set(t,e),this.po?this.po.next=i:this.Gi=i,this.po=i},nc.prototype.remove=function(){var t=null;return this.Gi&&(t=this.Gi,this.Gi=this.Gi.next,this.Gi||(this.po=null),t.next=null),t};var oc=new mc(function(){return new pc},function(t){return t.reset()}),rc;function pc(){this.next=this.scope=this.up=null}function qc(t,e){return-1!=t.indexOf(e)}pc.prototype.set=function(t,e){this.up=t,this.scope=e,this.next=null},pc.prototype.reset=function(){this.next=this.scope=this.up=null};t:{var tc=wa.navigator;if(tc){var uc=tc.userAgent;if(uc){rc=uc;break t}}rc=""}function vc(t){return vc[" "](t),t}vc[" "]=za;var wc=qc(rc,"Gecko")&&!(qc(rc.toLowerCase(),"webkit")&&!qc(rc,"Edge"))&&!(qc(rc,"Trident")||qc(rc,"MSIE"))&&!qc(rc,"Edge"),xc=qc(rc.toLowerCase(),"webkit")&&!qc(rc,"Edge"),zc,Cc;function yc(){var t=document,e="IFRAME";return"application/xhtml+xml"===t.contentType&&(e=e.toLowerCase()),t.createElement(e)}function Ac(){var t=wa.MessageChannel;if(void 0===t&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&!qc(rc,"Presto")&&(t=function(){var t=yc();t.style.display="none",document.documentElement.appendChild(t);var e=t.contentWindow;(t=e.document).open(),t.close();var i="callImmediate"+Math.random(),r="file:"==e.location.protocol?"*":e.location.protocol+"//"+e.location.host;t=Ia(function(t){"*"!=r&&t.origin!=r||t.data!=i||this.port1.onmessage()},this),e.addEventListener("message",t,!1),this.port1={},this.port2={postMessage:function(){e.postMessage(i,r)}}}),void 0!==t&&!qc(rc,"Trident")&&!qc(rc,"MSIE")){var e=new t,i={},r=i;return e.port1.onmessage=function(){if(void 0!==i.next){var t=(i=i.next).jt;i.jt=null,t()}},function(t){r.next={jt:t},r=r.next,e.port2.postMessage(0)}}return function(t){wa.setTimeout(t,0)}}function Bc(t,e){Cc||Dc(),Ec||(Cc(),Ec=!0),Fc.add(t,e)}function Dc(){if(wa.Promise&&wa.Promise.resolve){var t=wa.Promise.resolve(void 0);Cc=function(){t.then(Gc)}}else Cc=function(){var t=Gc;"function"!=typeof wa.setImmediate||wa.Window&&wa.Window.prototype&&!qc(rc,"Edge")&&wa.Window.prototype.setImmediate==wa.setImmediate?(zc||(zc=Ac()),zc(t)):wa.setImmediate(t)}}var Ec=!1,Fc=new nc;function Gc(){for(var t;t=Fc.remove();){try{t.up.call(t.scope)}catch(t){lc(t)}oc.put(t)}Ec=!1}function Hc(t){if(this.o=Ic,this.qf=void 0,this.Yg=this.Ke=this.og=null,this.um=this.qp=!1,t!=za)try{var e=this;t.call(void 0,function(t){Jc(e,Kc,t)},function(t){Jc(e,Lc,t)})}catch(t){Jc(this,Lc,t)}}var Ic=0,Kc=2,Lc=3;function Mc(){this.next=this.context=this.Th=this.pk=this.Ef=null,this.Dl=!1}Mc.prototype.reset=function(){this.context=this.Th=this.pk=this.Ef=null,this.Dl=!1};var Nc=new mc(function(){return new Mc},function(t){t.reset()});function Oc(t,e,i){var r=Nc.get();return r.pk=t,r.Th=e,r.context=i,r}function Pc(t){if(t instanceof Hc)return t;var e=new Hc(za);return Jc(e,Kc,t),e}function Qc(t){return new Hc(function(e,i){i(t)})}function Rc(){var t,e;return new Sc(new Hc(function(i,r){t=i,e=r}),t,e)}function Vc(t,e){if(t.o==Ic)if(t.og){var i=t.og;if(i.Ke){for(var r=0,n=null,o=null,s=i.Ke;s&&(s.Dl||(r++,s.Ef==t&&(n=s),!(n&&1<r)));s=s.next)n||(o=s);n&&(i.o==Ic&&1==r?Vc(i,e):(o?((r=o).next==i.Yg&&(i.Yg=r),r.next=r.next.next):Wc(i),Xc(i,n,Lc,e)))}t.og=null}else Jc(t,Lc,e)}function Yc(t,e){t.Ke||t.o!=Kc&&t.o!=Lc||Zc(t),t.Yg?t.Yg.next=e:t.Ke=e,t.Yg=e}function Tc(t,e,i,r){var n=Oc(null,null,null);return n.Ef=new Hc(function(t,o){n.pk=e?function(i){try{var n=e.call(r,i);t(n)}catch(t){o(t)}}:t,n.Th=i?function(e){try{var n=i.call(r,e);void 0===n&&e instanceof Uc?o(e):t(n)}catch(t){o(t)}}:o}),n.Ef.og=t,Yc(t,n),n.Ef}function Jc(t,e,i){if(t.o==Ic){t===i&&(e=Lc,i=new TypeError("Promise cannot resolve to itself")),t.o=1;t:{var r=i,n=t.ID,o=t.JD;if(r instanceof Hc){Yc(r,Oc(n||za,o||null,t));var s=!0}else{if(r)try{var a=!!r.$goog_Thenable}catch(t){a=!1}else a=!1;if(a)r.then(n,o,t),s=!0;else{if(ya(r))try{var l=r.then;if("function"==typeof l){$c(r,l,n,o,t),s=!0;break t}}catch(e){o.call(t,e),s=!0;break t}s=!1}}}s||(t.qf=i,t.o=e,t.og=null,Zc(t),e!=Lc||i instanceof Uc||ad(t,i))}}function $c(t,e,i,r,n){function o(t){s||(s=!0,r.call(n,t))}var s=!1;try{e.call(t,function(t){s||(s=!0,i.call(n,t))},o)}catch(t){o(t)}}function Zc(t){t.qp||(t.qp=!0,Bc(t.fz,t))}function Wc(t){var e=null;return t.Ke&&(e=t.Ke,t.Ke=e.next,e.next=null),t.Ke||(t.Yg=null),e}function Xc(t,e,i,r){if(i==Lc&&e.Th&&!e.Dl)for(;t&&t.um;t=t.og)t.um=!1;if(e.Ef)e.Ef.og=null,bd(e,i,r);else try{e.Dl?e.pk.call(e.context):bd(e,i,r)}catch(t){cd.call(null,t)}Nc.put(e)}function bd(t,e,i){e==Kc?t.pk.call(t.context,i):t.Th&&t.Th.call(t.context,i)}
2function ad(t,e){t.um=!0,Bc(function(){t.um&&cd.call(null,e)})}Hc.prototype.then=function(t,e,i){return Tc(this,"function"==typeof t?t:null,"function"==typeof e?e:null,i)},Hc.prototype.$goog_Thenable=!0,Hc.prototype.cancel=function(t){if(this.o==Ic){var e=new Uc(t);Bc(function(){Vc(this,e)},this)}},Hc.prototype.ID=function(t){this.o=Ic,Jc(this,Kc,t)},Hc.prototype.JD=function(t){this.o=Ic,Jc(this,Lc,t)},Hc.prototype.fz=function(){for(var t;t=Wc(this);)Xc(this,t,this.o,this.qf);this.qp=!1};var cd=lc;function Uc(t){Pa.call(this,t)}function Sc(t,e,i){this.promise=t,this.resolve=e,this.reject=i}function dd(t,e){"status"in(e=e||{})&&(this.status=+e.status),"statusText"in e&&(this.statusText=e.statusText),this.ok=200<=this.status&&300>this.status,this.Ru=!1,t?"string"==typeof t?this.Mo=t:(e=globalThis.ArrayBuffer)&&e.prototype.isPrototypeOf(t)?this.Bf=t:e&&t.buffer?this.Bf=t.buffer:globalThis.Blob.prototype.isPrototypeOf(t)&&(this.Gl=t):this.Mo=""}function ed(t){if(t.Ru)return Qc(new TypeError("Already read"));t.Ru=!0}function fd(t){var e=new FileReader;return e.readAsText(t),new Hc(function(t,i){e.onload=function(){t(e.result)},e.onerror=function(){i(e.error)}})}u(Uc,Pa),Uc.prototype.name="cancel",t("H.net.Response",dd),dd.prototype.type="default",dd.prototype.type=dd.prototype.type,dd.prototype.status=200,dd.prototype.status=dd.prototype.status,dd.prototype.statusText="OK",dd.prototype.statusText=dd.prototype.statusText,dd.error=function(){return dd.op||(dd.op=new dd(null,{status:0,statusText:""}),dd.op.type="error"),dd.op},dd.error=dd.error,dd.prototype.text=function(){var t=ed(this);if(!t)if(this.Mo)t=Pc(this.Mo);else if(this.Bf){var e,i=(t=new Uint8Array(this.Bf)).length,r=Array(i);for(e=0;e<i;e++)r[e]=String.fromCharCode(t[e]);t=Pc(r.join(""))}else t=this.Gl?fd(this.Gl):Qc("Unsupported response body");return t},dd.prototype.json=function(){return this.text().then(globalThis.JSON.parse)},dd.prototype.blob=function(){var t,e=ed(this);return e||(this.Gl?t=this.Gl:this.Bf&&(t=new Blob([this.Bf],{type:"application/octet-stream"}))),e||Pc(t)},dd.prototype.arrayBuffer=function(){return this.Bf?ed(this)||Pc(this.Bf.slice(0)):this.blob().then(dd.vy)},dd.vy=function(t){var e=new FileReader;return e.readAsArrayBuffer(t),new Hc(function(t,i){e.onload=function(){t(e.result)},e.onerror=function(){i(e.error)}})},!tb&&globalThis.Response&&globalThis.Response.error&&(dd=globalThis.Response,kb(dd.prototype));var gd="closure_listenable_"+(1e6*Math.random()|0);function hd(t){return!(!t||!t[gd])}var id=function(){if(!wa.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{wa.addEventListener("test",za,e),wa.removeEventListener("test",za,e)}catch(t){}return t}();
2function jd(t){t&&"function"==typeof t.l&&t.l()}function kd(){0!=ld&&(md[Ca(this)]=this),this.jh=this.jh,this.ee=this.ee}var ld=0,md={};function nd(t,e){this.type=t,this.currentTarget=this.target=e,this.defaultPrevented=this.zk=!1}function od(t,e){nd.call(this,t?t.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.vj=null,t&&this.Fm(t,e)}kd.prototype.jh=!1,kd.prototype.l=function(){if(!this.jh&&(this.jh=!0,this.disposeInternal(),0!=ld)){var t=Ca(this);if(0!=ld&&this.ee&&0<this.ee.length)throw Error(this+" did not empty its onDisposeCallbacks queue. This probably means it overrode dispose() or disposeInternal() without calling the superclass' method.");delete md[t]}},kd.prototype.bc=function(t,e){this.jh?void 0!==e?t.call(e):t():(this.ee||(this.ee=[]),this.ee.push(void 0!==e?Ia(t,e):t))},kd.prototype.disposeInternal=function(){if(this.ee)for(;this.ee.length;)this.ee.shift()()},nd.prototype.stopPropagation=function(){this.zk=!0},nd.prototype.preventDefault=function(){this.defaultPrevented=!0},u(od,nd);var pd={2:"touch",3:"pen",4:"mouse"};od.prototype.Fm=function(t,e){var i=this.type=t.type,r=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.currentTarget=e,e=t.relatedTarget){if(wc){t:{try{vc(e.nodeName);var n=!0;break t}catch(t){}n=!1}n||(e=null)}}else"mouseover"==i?e=t.fromElement:"mouseout"==i&&(e=t.toElement);this.relatedTarget=e,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.offsetX=xc||void 0!==t.offsetX?t.offsetX:t.layerX,this.offsetY=xc||void 0!==t.offsetY?t.offsetY:t.layerY,this.clientX=void 0!==t.clientX?t.clientX:t.pageX,this.clientY=void 0!==t.clientY?t.clientY:t.pageY,this.screenX=t.screenX||0,this.screenY=t.screenY||0),this.button=t.button,this.keyCode=t.keyCode||0,this.key=t.key||"",this.charCode=t.charCode||("keypress"==i?t.keyCode:0),this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType="string"==typeof t.pointerType?t.pointerType:pd[t.pointerType]||"",this.state=t.state,this.vj=t,t.defaultPrevented&&od.g.preventDefault.call(this)},od.prototype.stopPropagation=function(){od.g.stopPropagation.call(this),this.vj.stopPropagation?this.vj.stopPropagation():this.vj.cancelBubble=!0},od.prototype.preventDefault=function(){od.g.preventDefault.call(this);var t=this.vj;t.preventDefault?t.preventDefault():t.returnValue=!1};var rd=0;function sd(t,e,i,r,n){this.listener=t,this.proxy=null,this.src=e,this.type=i,this.capture=!!r,this.wm=n,this.key=++rd,this.ii=this.Jl=!1}function td(t){t.ii=!0,t.listener=null,t.proxy=null,t.src=null,t.wm=null}function ud(t){this.src=t,this.ob={},this.pl=0}function wd(t,e){var i=e.type;if(!(i in t.ob))return!1;var r,n=t.ob[i],o=Qa(n,e);return(r=0<=o)&&Array.prototype.splice.call(n,o,1),r&&(td(e),0==t.ob[i].length&&(delete t.ob[i],t.pl--)),r}function vd(t,e,i,r){for(var n=0;n<t.length;++n){var o=t[n];if(!o.ii&&o.listener==e&&o.capture==!!i&&o.wm==r)return n}return-1}m=ud.prototype,m.add=function(t,e,i,r,n){var o=t.toString();(t=this.ob[o])||(t=this.ob[o]=[],this.pl++);var s=vd(t,e,r,n);return-1<s?(e=t[s],i||(e.Jl=!1)):((e=new sd(e,this.src,o,!!r,n)).Jl=i,t.push(e)),e},m.remove=function(t,e,i,r){if(!((t=t.toString())in this.ob))return!1;var n=this.ob[t];return-1<(e=vd(n,e,i,r))&&(td(n[e]),Array.prototype.splice.call(n,e,1),0==n.length&&(delete this.ob[t],this.pl--),!0)},m.ia=function(t){t=t&&t.toString();var e,i=0;for(e in this.ob)if(!t||e==t){for(var r=this.ob[e],n=0;n<r.length;n++)++i,td(r[n]);delete this.ob[e],this.pl--}return i},m.Kp=function(t,e,i,r){var n=-1;return(t=this.ob[t.toString()])&&(n=vd(t,e,i,r)),-1<n?t[n]:null},m.bq=function(t,e){var i=void 0!==t,r=i?t.toString():"",n=void 0!==e;return Ka(this.ob,function(t){for(var o=0;o<t.length;++o)if(!(i&&t[o].type!=r||n&&t[o].capture!=e))return!0;return!1})};var xd="closure_lm_"+(1e6*Math.random()|0),yd={},zd=0;
2function Ad(t,e,i,r,n){if(r&&r.once)return Cd(t,e,i,r,n);if(Array.isArray(e)){for(var o=0;o<e.length;o++)Ad(t,e[o],i,r,n);return null}return i=Dd(i),hd(t)?t.pd.add(String(e),i,!1,ya(r)?!!r.capture:!!r,n):Ed(t,e,i,!1,r,n)}function Ed(t,e,i,r,n,o){if(!e)throw Error("Invalid event type");var s=ya(n)?!!n.capture:!!n,a=Fd(t);if(a||(t[xd]=a=new ud(t)),(i=a.add(e,i,r,s,o)).proxy)return i;if(r=Gd(),i.proxy=r,r.src=t,r.listener=i,t.addEventListener)id||(n=s),void 0===n&&(n=!1),t.addEventListener(e.toString(),r,n);else if(t.attachEvent)t.attachEvent(Hd(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}return zd++,i}function Gd(){var t=Id;return function e(i){return t.call(e.src,e.listener,i)}}function Cd(t,e,i,r,n){if(Array.isArray(e)){for(var o=0;o<e.length;o++)Cd(t,e[o],i,r,n);return null}return i=Dd(i),hd(t)?t.pd.add(String(e),i,!0,ya(r)?!!r.capture:!!r,n):Ed(t,e,i,!0,r,n)}function Jd(t,e,i,r,n){if(Array.isArray(e)){for(var o=0;o<e.length;o++)Jd(t,e[o],i,r,n);return null}return r=ya(r)?!!r.capture:!!r,i=Dd(i),hd(t)?t.pd.remove(String(e),i,r,n):!!t&&!(!(t=Fd(t))||!(e=t.Kp(e,i,r,n)))&&Kd(e)}function Kd(t){if("number"==typeof t||!t||t.ii)return!1;var e=t.src;if(hd(e))return wd(e.pd,t);var i=t.type,r=t.proxy;return e.removeEventListener?e.removeEventListener(i,r,t.capture):e.detachEvent?e.detachEvent(Hd(i),r):e.addListener&&e.removeListener&&e.removeListener(r),zd--,(i=Fd(e))?(wd(i,t),0==i.pl&&(i.src=null,e[xd]=null)):td(t),!0}function Hd(t){return t in yd?yd[t]:yd[t]="on"+t}function Ld(t,e){var i=t.listener,r=t.wm||t.src;return t.Jl&&Kd(t),i.call(r,e)}function Id(t,e){return!!t.ii||Ld(t,new od(e,this))}function Fd(t){return(t=t[xd])instanceof ud?t:null}var Md="__closure_events_fn_"+(1e9*Math.random()>>>0),Nd,Od,Pd,Qd,Rd,Sd,Td,Ud,Vd;function Dd(t){return"function"==typeof t?t:(t[Md]||(t[Md]=function(e){return t.handleEvent(e)}),t[Md])}function I(){kd.call(this),this.pd=new ud(this),this.ky=this,this.er=null}function Wd(){}function Xd(t,e,i){this.type=t,this.data=e,this.Er=Rc(),this.resolve=z(this.resolve,this),this.reject=z(this.reject,this),this.priority=Yd,i!==A&&(this.priority=i),this.Gp().add(this)}u(I,kd),I.prototype[gd]=!0,m=I.prototype,m.Ib=function(){return this.er},m.ea=function(t){this.er=t},m.addEventListener=function(t,e,i,r){Ad(this,t,e,i,r)},m.removeEventListener=function(t,e,i,r){Jd(this,t,e,i,r)},m.dispatchEvent=function(t){var e,i=this.Ib();if(i)for(e=[];i;i=i.Ib())e.push(i);i=this.ky;var r=t.type||t;if("string"==typeof t)t=new nd(t,i);else if(t instanceof nd)t.target=t.target||i;else{var n=t;Oa(t=new nd(r,i),n)}if(n=!0,e)for(var o=e.length-1;!t.zk&&0<=o;o--){var s=t.currentTarget=e[o];n=s.Kf(r,!0,t)&&n}if(t.zk||(n=(s=t.currentTarget=i).Kf(r,!0,t)&&n,t.zk||(n=s.Kf(r,!1,t)&&n)),e)for(o=0;!t.zk&&o<e.length;o++)n=(s=t.currentTarget=e[o]).Kf(r,!1,t)&&n;return n},m.disposeInternal=function(){I.g.disposeInternal.call(this),this.pd&&this.pd.ia(void 0),this.er=null},m.Kf=function(t,e,i){if(!(t=this.pd.ob[String(t)]))return!0;t=t.concat();for(var r=!0,n=0;n<t.length;++n){var o=t[n];if(o&&!o.ii&&o.capture==e){var s=o.listener,a=o.wm||o.src;o.Jl&&wd(this.pd,o),r=!1!==s.call(a,i)&&r}}return r&&!i.defaultPrevented},m.Kp=function(t,e,i,r){return this.pd.Kp(String(t),e,i,r)},m.bq=function(t,e){return this.pd.bq(void 0!==t?String(t):void 0,e)},t("H.util.EventTarget",I),I.prototype.ea=I.prototype.ea,I.prototype.setParentEventTarget=I.prototype.ea,I.prototype.Ib=I.prototype.Ib,I.prototype.getParentEventTarget=I.prototype.Ib,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,I.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.kz=I.prototype.Kf,I.prototype.Kf=function(t,e,
2i){var r,n,o=!0,s=i[i.currentTarget===i.target?"AT_TARGET":e?"CAPTURING_PHASE":(r=!0,"BUBBLING_PHASE")];return(!r||"pointerenter"!==(n=i.type)&&"pointerleave"!==n)&&(i.eventPhase=s,o=I.prototype.kz.apply(this,arguments),r&&this.Ib&&null===this.Ib()&&delete i.eventPhase),o},I.prototype.ax=function(t){for(var e,i=this;i&&(e=i.Ib())&&e!==t;)i=e;e||i.ea(t)},I.prototype.setRootParentEventTarget=I.prototype.ax,t("H.util.ICancelable",Wd),Wd.prototype.cancel=function(){},Wd.prototype.cancel=Wd.prototype.cancel;var Yd=1,Zd={SD:0,VD:Yd,QD:2};function $d(t,e,i){$d.g.constructor.call(this,t,i),this.data=e}function ae(t,e,i){var r=[],n=arguments.length;return t&&r.push($a(t)),1<n&&(n=2<n&&db(i)?" out of ["+i[0]+"..."+i[1]+"]":"",r.push("("+e+n+")")),r=Error(r.join(" ")),Object.setPrototypeOf(r,ae.prototype),r}function be(t){var e;for(e in this.tg={},Zd)this.tg[Zd[e]]=[];this.Jk=t,this.Jk.addEventListener("allocatable",z(this.Qt,this))}m=Xd.prototype,m.then=function(t,e,i){return this.Er.promise.then(t,e,i)},m.resolve=function(t){this.state=3,this.Er.resolve(t)},m.reject=function(t){this.state=5,this.Er.reject(t)},m.state=0,m.cancel=function(){3>this.state&&(this.Xi(),this.Gp().remove(this),this.state=4)},Xd.prototype.cancel=Xd.prototype.cancel,t("H.util.Event",nd),nd.prototype.stopPropagation=nd.prototype.stopPropagation,nd.prototype.stopPropagation=nd.prototype.stopPropagation,nd.prototype.CAPTURING_PHASE=1,nd.prototype.CAPTURING_PHASE=nd.prototype.CAPTURING_PHASE,nd.prototype.AT_TARGET=2,nd.prototype.AT_TARGET=nd.prototype.AT_TARGET,nd.prototype.BUBBLING_PHASE=3,nd.prototype.BUBBLING_PHASE=nd.prototype.BUBBLING_PHASE,nd.prototype.eventPhase=0,nd.prototype.eventPhase=nd.prototype.eventPhase,u($d,nd),t("H.util.DataEvent",$d),u(ae,Error),t("H.lang.OutOfRangeError",ae),ae.prototype.name="OutOfRangeError",t("H.util.JobManager",be);var ce=Object.keys(Zd).map(function(t){return Zd[t]}).sort().reverse();function de(t,e,i){de.g.constructor.call(this,t,i),this.message=e}function ee(t){var e=(t=t||{}).callback;this.Wb=t.label,Wa(e)&&(this.callback=e),this.ub=!!t.disabled,ee.g.constructor.call(this)}be.prototype.add=function(t){B(t,Xd,this.add,0),this.tg[t.priority].push(t),this.Qt()},be.prototype.contains=function(t){return-1<this.tg[t.priority].indexOf(t)},be.prototype.remove=function(t){var e=t.priority,i=this.tg[e].indexOf(t);return-1<i?(this.tg[e].splice(i,1),!0):(t.Bs&&this.Jk.am(t.Bs),!1)},be.prototype.Qt=function(){ce.forEach(function(t){this.tg[t]=this.tg[t].filter(function(t){var e;if((e=this.Jk.Go(t))===x)return!0;var i=z(this.Jk.am,this.Jk,e,t);t.Bs=e,t.then(i,i),t.state=t.Pt(e)?1:5},this)},this)},u(de,nd),t("H.util.ErrorEvent",de),u(ee,I),t("H.util.ContextItem",ee),ee.prototype.Hp=function(){return this.Wb},ee.prototype.getLabel=ee.prototype.Hp,ee.prototype.we=function(t){return this.Wb!==t&&(this.Wb=t,this.dispatchEvent("update")),this},ee.prototype.setLabel=ee.prototype.we,ee.prototype.lq=function(){return this.ub},ee.prototype.isDisabled=ee.prototype.lq,ee.prototype.za=function(t){return t!==this.ub&&(this.ub=t,this.dispatchEvent("update")),this},ee.prototype.setDisabled=ee.prototype.za;var fe=new ee;function ge(t){if(globalThis.document){var e=document.createElement("canvas");return e.width=e.height=1,e.getContext("2d",{willReadFrequently:t})}return null}function he(){return window.devicePixelRatio||1}ee.SEPARATOR=fe,t("H.util.getPixelRatio",he);var ie=/^rgba\(([^,]+),([^,]+),([^,]+),([^)]+)\)$/;function je(t){var e=ke[t],i=globalThis.RegExp;return e||(globalThis.Uint8ClampedArray||(globalThis.Uint8ClampedArray=function(t){return t instanceof Number?Array(t):t.map(function(t){return $b(zb(t),0,255)})}),"none"===t?e=new Uint8ClampedArray([0,0,0,0]):(le.fillStyle="black",le.fillStyle=t,ie.test(le.fillStyle)?e=new Uint8ClampedArray([i.$1,i.$2,i.$3,255*i.$4]):(le.clearRect(0,0,1,1),le.fillRect(0,0,1,1),e=le.getImageData(0,0,1,1).data)),ke[t]=e),e}function me(t){return"none"!==t&&0<je(t)[3]}var ke=Ra(),ne=!!globalThis.VBArray;function oe(t,e){return t!==A?t:e}function pe(t){return/^<svg/.test(t)?"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(t):t}function qe(t){this.yd=0<+t?wb.round(t):0}t("H.util.eval",function(a){return eval(a)}),t("H.util.provide",function(t){var e=wa.$jscomp;if(e&&"function"==typeof e.Gz&&e.Gz())throw Error("goog.provide cannot be used within a module.");xa(t,void 0,void 0)}),qe.prototype.next=function(t){if(9007199254740992===this.yd)throw new ae(t,this.yd,[0,9007199254740991]);return this.yd++};var re=new qe,se=z(re.next,re);function te(){return!0}function ue(){return!1}function ve(){}var we=Ta([]),xe=Ta({});function ye(t){return"CANVAS"===t.tagName?[t]:t.getElementsByTagName("CANVAS")}function ze(t,e,i){var r;if(e=t.ownerDocument===e?t.cloneNode(!0):e.importNode(t,!0),i)for(t=ye(t),r=(i=ye(e)).length;r--;)i[r].getContext("2d").drawImage(t[r],0,0);return e}var le=ge(!0),Ae=ge(!1);
2function Be(t){var e=t.complete,i=0<t.naturalWidth;if(e&&!i&&ne)try{Ae.drawImage(t,0,0),i=!0}catch(t){}return e&&i}var Ce=globalThis.BlobBuilder||globalThis.WebKitBlobBuilder||globalThis.MozBlobBuilder;function De(t,e){if(e=e||"",Ce){var i=new Ce;i.append(t),t=i.getBlob(e)}else t=new Blob([t],{type:e});return t}var Ee=globalThis.navigator.userAgent;function Fe(){var t=Fe.ov;return t||(t=this,Fe.ov=t,kb(Fe.ov),I.call(t),this.zg()),t}function Ge(t,e,i){var r,n,o,s,a,l=i&&i.headers||{},c={},h=this;if(!Wa(e))throw new C(Ge,1,"function required");t+="",Oa(l,Je.headers,l),Oa(c,Je,i||{}),c.headers=l,this.it=e,this.I=r=new XMLHttpRequest,e=c.method;try{for(n in r.open(e,t,!0),l)l.hasOwnProperty(n)&&(o=l[n])&&r.setRequestHeader(n,o);r.withCredentials=!!c.withCredentials,s=z(h.Wh,h),a=+c.timeout||0,He?(Ie(h,"timeout",s),r.timeout=a):a&&(h.Px=setTimeout(function(){r.abort(),h.Wh({type:"timeout"})},a)),Ie(h,"error",s),Ie(h,"load",s),r.send(c.data)}catch(s){this.Wh({type:"cors"})}}Od=/\bedg\b/i.test(Ee),Pd=/\bfirefox\b/i.test(Ee),Qd=!Od&&/\bchrome\b/i.test(Ee),Rd=!Qd&&!Od&&/\bsafari\b/i.test(Ee),Sd=/\bandroid\b/i.test(Ee),Td=/\bmac os\b/i.test(Ee),Ud=/\bwindows\b/i.test(Ee),Vd=/\blinux\b/i.test(Ee),u(Fe,I),m=Fe.prototype,m.disposeInternal=function(){Fe.g.disposeInternal.call(this),this.zg()},m.zg=function(){this.CB=10,this.DB=6,this.ki=Ra(),this.Cr=Ra(),this.Hr=0},m.Go=function(t){t=t.type;var e=this.ki[t]||0;if(this.Hr<this.CB&&e<this.DB){var i=++this.rB;return this.Hr++,this.ki[t]=e+1,this.Cr[i+""]=t,i}return x},m.am=function(t){var e=this.Cr[t];if(!Ya(e)||!this.ki[e])throw new vb(this.am,"Unknown requestId");this.Hr--,this.ki[e]--,this.ki[e]||delete this.ki[e],delete this.Cr[t],this.dispatchEvent("allocatable")},m.rB=-1,t("H.net.Xhr",Ge);var Je={method:"GET",headers:{},data:null},Ke="withCredentials"in new XMLHttpRequest,He="timeout"in new XMLHttpRequest;function Ie(t,e,i){Ke?t.I.addEventListener(e,i):t.I["on"+e]=i}function Le(t,e,i){Ke?t.I.removeEventListener(e,i):t.I["on"+e]=null}function Me(t,e,i,r){if(!Oe[t])throw new C(Me,0,"Mime type is not supported");this.JB=t,"crossOrigin"in(t=r?Ma(r):{})||(t.crossOrigin="anonymous"),this.Fa=t,Pe.href=e.toString(),Xd.call(this,Pe.protocol+"//"+Pe.hostname,e,i)}Ge.prototype.abort=function(){this.I&&(this.I.abort(),this.I&&this.Wh({type:"abort"}))},Ge.prototype.abort=Ge.prototype.abort,Ge.prototype.Wh=function(t){var e,i=t.type;t=this.I,this.Px&&clearTimeout(this.Px),"load"===i?t instanceof XMLHttpRequest&&200!==t.status&&(e="network"):e=4===t.readyState&&0===t.status&&"error"==i?"cors":"error"!=i?i:"network",Le(this,"timeout",i=this.Wh),Le(this,"error",i),Le(this,"load",i),t=0===t.status||e&&"network"!==e?dd.error():new dd(t.responseText||null,t),e=this.it,delete this.Wh,delete this.it,delete this.I,e(t)},u(Me,Xd),Me.prototype.Pt=function(){return this.br=Oe[this.JB].call(this),!0},Me.prototype.Xi=function(){this.br&&(this.br.abort(),delete this.br)};var Oe={"application/json":function(){var t=this,e=Qe(this.Fa),i=e.headers;return e.headers=i=i?Ma(i):{},i.Accept="application/json",new Ge(this.data,function(e){200<=e.status&&300>e.status?t.resolve(e.json()):t.reject(e)},e)},"text/plain":function(){var t=this;return new Ge(this.data,function(e){200<=e.status&&300>e.status?t.resolve(e.text()):t.reject(e)},Qe(this.Fa))},image:function(){var t=globalThis.document.createElement("img"),e=this,i=this.data;return t.onload=z(this.resolve,this,t),t.onerror=function(){e.reject(dd.error())},t.crossOrigin=this.Fa.crossOrigin,t.src=i,{abort:function(){t.onerror=t.onload=null,ne&&Be(t)||t.removeAttribute("src")}}}};!function(){try{var t=new XMLHttpRequest;t.open("get","/",!0)}catch(e){t={}}"response"in t&&(Oe.arraybuffer=function(){var t,e=new XMLHttpRequest,i=this,r=this.Fa,n=r.headers;if(e.open("GET",this.data),Re(e,r),e.responseType="arraybuffer",n)for(t in n)e.setRequestHeader(t,n[t]);return e.onerror=e.ontimeout=function(){i.reject(dd.error())},e.onload=function(){i.resolve(new dd(e.response))},e.send(),e})}();var Se=new be(new Fe);Me.prototype.Gp=function(){return Se};var Pe=globalThis.document.createElement("a");function Qe(t){var e=Ma(t);return delete e.crossOrigin,Re(e,t),e}function Re(t,e){t.withCredentials="use-credentials"===e.crossOrigin}function Te(t,e,i){var r=$b(+t,-90,90);if(e&&E(r))throw new C(e,i,t);return r}function Ue(t,e,i){var r=+t;if((-180>r||180<r)&&(r=Yb(r+180,360)-180),e&&E(r))throw new C(e,i,t);return r}function Ve(t,e,i){var r;if(t!==A&&E(r=+t)&&e)throw new C(e,i,t);return r}function We(t,e){return 0>t!=0>e&&180<Cb(e-t)}function Xe(){Za(this,Xe)}function Ye(t,e,i){this.lat=Te(t,Ye,0),this.lng=Ue(e,Ye,1),i!==A&&(this.alt=Ve(i,Ye,2))}function Ze(t,e,i){var r=ya(t)&&!(E(t.lat=Te(t.lat))||E(t.lng=Ue(t.lng))||t.alt!==A&&E(t.alt=Ve(t.alt)));if(!r&&e)throw new C(e,i,t);return r}function $e(t){if(!t)throw new C($e,0,t);return new Ye(t.lat,t.lng,t.alt)}t("H.geo.isDBC",We),t("H.geo.AbstractGeometry",Xe),Xe.prototype.getBoundingBox=Xe.prototype.C,Xe.prototype.equals=Xe.prototype.da,Xe.prototype.ac="",Xe.prototype.Jc="",Xe.prototype.toString=function(){return this.xf([this.ac.toUpperCase()," "]).join("")},Xe.prototype.toString=Xe.prototype.toString,Xe.prototype.ye=function(){return{type:this.Jc,coordinates:this.wf()}},Xe.prototype.toGeoJSON=Xe.prototype.ye,Xe.prototype.P=function(){return{type:this.ac,coordinates:this.Pd(),boundingBox:this.C().P()}},Xe.prototype.forWorkerMessage=Xe.prototype.P,u(Ye,Xe),t("H.geo.Point",Ye),Ye.prototype.da=function(t){return this===t||!!t&&this.lat===t.lat&&this.lng===t.lng&&(this.alt||0)===(t.alt||0)},Ye.prototype.equals=Ye.prototype.da,Ye.prototype.ib=function(t){if(this===t||this.lat===t.lat&&this.lng===t.lng)t=0;else{var e=this.lat*Tb,i=t.lat*Tb;t=12742001.58*Ib(xb(1,Eb(Fb(Hb((e-i)/2),2)+Jb(e)*Jb(i)*Fb(Hb((this.lng*Tb-t.lng*Tb)/2),2))))}return t},Ye.prototype.distance=Ye.prototype.ib,Ye.prototype.oo=function(t,e,
2i){var r;if(i){if(r=e/6371000.79){e=t*Tb,t=Tb*this.lat;var n=Hb(t);i=Hb(r);var o=Jb(r);r=Tb*this.lng;var s=Jb(t);t=Ib(s*Jb(e)*i+n*o),e=(r+(e=Mb(Hb(e)*s*i,o-n*Hb(t)))+Ob)%(2*Ob)-Ob,n=new Ye(t*Ub,(540+(e*=Ub))%360-180)}return n||this}return 0==(90+(t=(t%360+360)%360))%180?(t=this.lng+e/(6371000.79*Rb*Jb(this.lat*Tb))*(270===t?-360:360),new Ye(this.lat,(t+540)%360-180)):((e/=6371000.79)&&(t*=Tb,n=this.lat*Tb,i=this.lng*Tb,o=(r=n+e*Jb(t))-n,s=Db(Kb(r/2+Qb)/Kb(n/2+Qb)),s=E(o/s)?Jb(n):o/s,t=e*Hb(t)/s,Cb(r)>Pb&&(r=0<r?Ob-r:-(Ob+r)),r=new Ye(r*Ub,((i+t+Sb+(Cb(n+o)>Pb?Ob:0))%Rb-Ob)*Ub)),r||this)},Ye.prototype.walk=Ye.prototype.oo,Ye.prototype.C=function(){return new J(this.lat,this.lng,this.lat,this.lng)},Ye.prototype.getBoundingBox=Ye.prototype.C,Ye.validate=Ze,Ye.fromIPoint=$e,m=Ye.prototype,m.ac="Point",m.xf=function(t){return t.push("(",this.lng," ",this.lat,")"),t},m.Jc="Point",m.wf=function(){return[this.lng,this.lat,this.alt||0]},m.Pd=function(){return[this.lat,this.lng,this.alt||0]};var af=[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],bf="undefined"!=typeof BigInt?BigInt:Number;function cf(t){var e=bf(0),i=bf(0),r=[];if(t.split("").forEach(function(t){t=bf(af[t.charCodeAt(0)-45]),e|=(t&bf(31))<<i,(t&bf(32))===bf(0)?(r.push(e),e=bf(0),i=bf(0)):i+=bf(5)}),0<i)throw Error("Invalid encoding");return r}function df(t){return t&bf(1)&&(t=~t),+(t>>=bf(1)).toString()}function ef(t){var e=void 0===t.precision?5:t.precision,i=void 0===t.il?0:t.il,r=void 0===t.jl?0:t.jl;t=t.kr;var n=Math.pow(10,e),o=Math.pow(10,r);if(0>e||15<e)throw Error("precision out of range. Should be between 0 and 15");if(0>r||15<r)throw Error("thirdDimPrecision out of range. Should be between 0 and 15");if(0>i||7<i||4===i||5===i)throw Error("thirdDim should be between 0, 1, 2, 3, 6 or 7");e=ff(1)+ff(r<<7|i<<4|e);var s=[],a=bf(0),l=bf(0),c=bf(0);return t.forEach(function(t){var e=bf(Math.round(t[0]*n));s.push(gf(e-a)),a=e,e=bf(Math.round(t[1]*n)),s.push(gf(e-l)),l=e,i&&(t=bf(Math.round(t[2]*o)),s.push(gf(t-c)),c=t)}),[].concat(e instanceof Array?e:fa(ea(e)),s instanceof Array?s:fa(ea(s))).join("")}function ff(t){var e="";for(t=bf(t);31<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"[t&bf(31)|bf(32)],t>>=bf(5);return e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"[t]}function gf(t){var e=0>(t=bf(t));return t<<=bf(1),e&&(t=~t),ff(t)}function hf(t){return ef({kr:t.polyline,precision:t.precision,il:t.thirdDim,jl:t.thirdDimPrecision})}function jf(t){if(1!==+(t=cf(t))[0].toString())throw Error("Invalid format version");var e=+t[1].toString();e={precision:15&e,il:e>>4&7,jl:e>>7&15};for(var i=Math.pow(10,e.precision),r=Math.pow(10,e.jl),n=e.il,o=0,s=0,a=0,l=[],c=2;c<t.length;){var h=df(t[c+1])/i;o+=df(t[c])/i,s+=h,n?(a+=df(t[c+2])/r,l.push([o,s,a]),c+=3):(l.push([o,s]),c+=2)}if(c!==t.length)throw Error("Invalid encoding. Premature ending reached");return{polyline:(t=Object.assign({},e,{kr:l})).kr,precision:t.precision,thirdDim:t.il,thirdDimPrecision:t.jl}}function J(t,e,i,r){kf(this,Te(t,J,0),Ue(e,J,1),Te(i,J,2),Ue(r,J,3))}function kf(t,e,i,r,n){return t.W=i,t.ca=n,e<r&&(i=e,e=r,r=i),t.fa=e,t.ga=r,t.ml=t.Si=t.Df=null,t}function mf(t,e){return(t=e-t)+(0>t?360:0)}function lf(t,e){return(t+=e/2)-(180<t?360:0)}function nf(t,e,i,r,n,o,s,a,l){i=xb(i,s),t=yb(t,n);var c=lf(e,n=mf(e,r)),h=lf(o,s=mf(o,a))-c;if(180>(h+=0>h-1e-6?360:0)-1e-6){c=e;var u=a}else h=360-h,c=o,u=r;return 360<=(h=h+n/2+s/2)+5e-7?(c=-180,u=180):h-5e-7<n?(c=e,u=r):h-5e-7<s&&(c=o,u=a),l?kf(l,t,c,i,u):new J(t,c,i,u)}function of(t,e,i){return i||(Ze(t,of,0),Ze(e,of,1)),new J(t.lat,t.lng,e.lat,e.lng)}function pf(t,e){var i=1,r=t.length,n=null;if(!Ba(t))throw new C(pf,0,t);if(0<r){var o=t[0];for(n=of(o,o,e);i<r;i++)o=t[i],n.cf(o.lat,o.lng,e,n)}return n}function qf(t,e){var i,r=3,n=t.length;if(!(e||t&&null!=t.length))throw new C(qf,0,t);if(0<n)for(i=new J(t[0],t[1],t[0],t[1]);r<n;r+=3)i.cf(t[r],t[r+1],e,i);return i}function rf(t,e){var i,r=1,n=t.length;if(e&&(!t||null==t.length))throw new C(rf,0,t);
2if(0<n)for(i=new J(t[0].fa,t[0].W,t[0].ga,t[0].ca);r<n;r++)i.xd(t[r],e,i);return i}function sf(t,e,i,r,n,o){Za(this,sf),this.Ph=t||10,this.yj=null,this.Zi=r||0,this.$i=n||0,this.Ck=e||1,this.Dk=i||1,this.Ox=!!o,this.flush()}function tf(t){var e=t.yj;if(t.Ox&&!e){var i=t.head;(i.entries||i[0]||i[1]||i[2]||i[3])&&(e=uf([e=[i],e,e,e],[i[6],i[7],i[4],i[5]]),t.yj=e)}return e}function uf(t,e){var i,r,n,o,s=0;for(i=3;0<=i;i--){var a=i+4,l=0<i%3,c=[],h=e[i],u=t[i];for(r=u.length;r--;){var p=u[r];if(n=p.entries)for(o=n.length;o--;){var d=n[o].Nf(i);(l?d>h:d<h)&&(h=d)}for(o=4;o--;)(n=p[o])&&(l?n[a]>h:n[a]<h)&&c.push(n)}s+=c.length,e[i]=h,t[i]=c}return s&&(e=uf(t,e)),e}function vf(t,e,i){var r,n;if(t.Ox&&(r=t.yj))for(n=3;0<=n;n--){var o=e.Nf(n);if(n%3?o>=r[n]:o<=r[n]){if(!i){t.yj=null;break}r[n]=o}}}function xf(t,e,i,r,n,o,s,a,l){var c,h=e.entries,u=e[7],p=e[4],d=e[5],m=e[6],f=e[8],g=e[9];if(h){var y=h.length;if(n>p||r>u||s<m||o<d)for(;y--;)p=(u=h[y]).Nf(3),d=u.Nf(0),m=u.Nf(1),u.Nf(2)>=n&&m>=r&&(d<s||a&&d==s)&&(p<o||l&&p==o)&&i.push(u);else for(;y--;)i.push(h[y])}(o>f||l&&o==f)&&(n<g&&(c=e[1])&&xf(t,c,i,r,n,o,s,a,l),(s>g||a&&s==g)&&(c=e[3])&&xf(t,c,i,r,n,o,s,a,l)),r<f&&(n<g&&(c=e[0])&&xf(t,c,i,r,n,o,s,a,l),(s>g||a&&s==g)&&(c=e[2])&&xf(t,c,i,r,n,o,s,a,l))}t("H.util.flexiblePolyline.encode",hf),t("H.util.flexiblePolyline.decode",jf),u(J,Xe),t("H.geo.Rect",J),J.prototype.ac="Polygon",J.prototype.xf=function(t){var e=this.fa,i=this.W,r=this.ga,n=this.ca;return t.push("(","(",i," ",e,",",n," ",e,",",n," ",r,",",i," ",r,",",i," ",e,")",")"),t},J.prototype.da=function(t){var e=this===t;return!e&&B(t,J)&&(e=this.fa===t.fa&&this.W===t.W&&this.ga===t.ga&&this.ca===t.ca),e},J.prototype.equals=J.prototype.da,J.prototype.clone=function(){return new J(this.fa,this.W,this.ga,this.ca)},J.prototype.clone=J.prototype.clone,J.prototype.Nc=function(){return this.ml||(this.ml=new Ye(this.fa,this.W)),this.ml},J.prototype.getTopLeft=J.prototype.Nc,J.prototype.Lc=function(){return this.Si||(this.Si=new Ye(this.ga,this.ca)),this.Si},J.prototype.getBottomRight=J.prototype.Lc,J.prototype.MA=function(){return this.fa},J.prototype.getTop=J.prototype.MA,J.prototype.Az=function(){return this.ga},J.prototype.getBottom=J.prototype.Az,J.prototype.gA=function(){return this.W},J.prototype.getLeft=J.prototype.gA,J.prototype.CA=function(){return this.ca},J.prototype.getRight=J.prototype.CA,J.prototype.vb=function(){return this.Df||(this.Df=new Ye(this.ga+(this.fa-this.ga)/2,lf(this.W,this.oc()))),this.Df},J.prototype.getCenter=J.prototype.vb,J.prototype.oc=function(){return mf(this.W,this.ca)},J.prototype.getWidth=J.prototype.oc,J.prototype.yh=function(){return this.fa-this.ga},J.prototype.getHeight=J.prototype.yh,J.prototype.pc=function(){return this.W>this.ca},J.prototype.isCDB=J.prototype.pc,J.prototype.Jm=function(){return!this.oc()&&!this.yh()},J.prototype.isEmpty=J.prototype.Jm,J.prototype.C=function(){return new J(this.fa,this.W,this.ga,this.ca)},J.prototype.getBoundingBox=J.prototype.C,J.prototype.Ql=function(t,e,i){var r=this.vb();return i||(t=Te(t,this.Ql,0),e=Ue(e,this.Ql,1)),(t=(e=this.cf(t,e,i)).vb()).lat===r.lat&&t.lng===r.lng&&this.yh()===e.yh()&&this.oc()===e.oc()},J.prototype.containsLatLng=J.prototype.Ql,J.prototype.Ff=function(t,e){return e||Ze(t,this.Ff,0),this.Ql(t.lat,t.lng,e)},J.prototype.containsPoint=J.prototype.Ff,J.prototype.Xo=function(t,e){var i=this.vb();if(!e&&!B(t,J))throw new C(this.Xo,0,t);return(t=(e=this.xd(t,e)).vb()).lat===i.lat&&t.lng===i.lng&&this.yh()===e.yh()&&this.oc()===e.oc()},J.prototype.containsRect=J.prototype.Xo,J.prototype.cf=function(t,e,i,r){if(!i){if(E(t=Te(t)))throw new C(this.cf,0,t);if(E(e=Ue(e)))throw new C(this.cf,1,e)}return nf(this.fa,this.W,this.ga,this.ca,t,e,t,e,r)},J.prototype.mergeLatLng=J.prototype.cf,J.prototype.wv=function(t,e,i){return e||Ze(t,this.wv,0),this.cf(t.lat,t.lng,e,i)},J.prototype.mergePoint=J.prototype.wv,J.prototype.xd=function(t,e,i){if(!e&&!B(t,J))throw new C(this.xd,0,t);return nf(this.fa,this.W,this.ga,this.ca,t.fa,t.W,t.ga,t.ca,i)},J.prototype.mergeRect=J.prototype.xd,J.prototype.ce=function(t,e,
2i,r,n,o){return n||(t=Te(t,this.ce,0),e=Ue(e,this.ce,1),i=Te(i,this.ce,2),r=Ue(r,this.ce,3)),nf(this.fa,this.W,this.ga,this.ca,t,e,i,r,o)},J.prototype.mergeTopLeftBottomRight=J.prototype.ce,J.prototype.Vf=function(t,e){var i=this.W<=this.ca,r=t.W<=t.ca,n=this.W<t.ca,o=t.W<this.ca;if(!e&&!B(t,J))throw new C(this.Vf,0,t);return this.ga<=t.fa&&t.ga<=this.fa&&(!i&&(!r||n||o)||!r&&(n||o)||n&&o)},J.prototype.intersects=J.prototype.Vf,J.merge=nf,J.fromPoints=of,J.coverPoints=pf,J.coverLatLngAlts=qf,J.coverRects=rf,J.prototype.Mw=function(t,e){var i=this.W,r=this.fa,n=this.ca,o=this.ga,s=this.vb().lng;Ze(t,this.Mw,0);var a=t.lat-o-(r-o)/2,l=t.lng-s;return t=-180>(t=i+(0>(l=180<l||-180>l?-(s+t.lng):l)?2*l:0))?360+t:t,n=180<(n+=0<l?2*l:0)?n-360:n,90<=(r=0<a?r+2*a:r)&&(r=90),-90>=(o=0>a?o+2*a:o)&&(o=-90),e?kf(e,r,t,o,n):new J(r,t,o,n)},J.prototype.resizeToCenter=J.prototype.Mw,J.prototype.Jc="Polygon",J.prototype.wf=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]]},J.prototype.P=function(){return this.Pd()},J.prototype.Pd=function(){return[this.fa,this.W,this.ga,this.ca]},m=sf.prototype,m.remove=function(t){var e,i,r,n=!1;return t&&(e=t.node)&&e.ol===this&&(i=e.entries)&&0<=(r=i.indexOf(t))&&(i.splice(r,1),this.Ml(e),vf(this,t,!1),n=!0),n},m.flush=function(){var t=new wf(A,NaN,this.Zi-this.Ck,this.$i-this.Dk,this.Zi+this.Ck,this.$i+this.Dk);t.ol=this,this.head=this.root=t,this.yj=null},m.jd=function(t){var e,i=this.head;if(t){var r=t;if(r!==i)for(i=r;r=r.parent;)(r.entries||1<r.fb)&&(i=r)}else for(;!i.entries&&2>(e=i.fb)&&e;)i=r;this.head=i},m.nb=function(t,e,i,r,n,o){var s=[],a=this.head,l=this.root;return t<=a[5]&&e<=a[6]&&(n?i>=a[7]:i>a[7])&&(o?r>=a[4]:r>a[4])&&xf(this,a,s,t,e,i,r,o||r>=l[6],n||i>=l[5]),s},m.ze=ba(1);var yf=0;function wf(t,e,i,r,n,o){this.Eo=e,t&&(this.parent=t,this.ol=t.ol,1&e?(i=t[8],n=t[5]):(i=t[7],n=t[8]),2&e?(r=t[9],o=t[6]):(r=t[4],o=t[9])),this[7]=i,this[5]=n,this[8]=(i+n)/2,this[4]=r,this[6]=o,this[9]=(r+o)/2}function zf(t,e,i,r,n){var o=t[5],s=t[6];return t[7]<=e&&t[4]<=i&&(o>r||o===r&&o===t.ol.root[5])&&(s>n||s===n&&s===t.ol.root[6])}function Af(t,e,i,r,n,o){Af.g.constructor.apply(this,arguments)}function Bf(t,e,i,r,n){if(zf(t.root,e,i,r,n))return t.Vb(t.root,e,i,r,n,t.Ph);throw Error("Coordinates out of bounds")}function Cf(t,e,i,r){this.id=yf++,this[0]=e,this[1]=i,this[2]=r,this[3]=t}function Df(t){this.Ae=new Af(+t||10,180,90,0,0,!0),this.Ll=[],this.jq=!1,this.Cf=this.Mg=this.J=null}function Ef(t,e,i,r,n,o,s){var a,l=(t=t.Ll).length,c=[];if(l){var h=i+360;for(a=n+360;l--;){var u=t[l];(Ff(u,e,i,r,n,o,s)||Ff(u,e,h,r,a,o,s))&&c.push(u)}}return c}function Ff(t,e,i,r,n,o,s){var a=t[3],l=t[0],c=t[1];return t=t[2],(o?l<=r:l<r)&&(s?a<=n:a<n)&&t>=e&&c>=i}function Gf(t,e){var i,r,n;if(i=e.length){var o=t.length;for(r={};o--;)r[t[o].id]=1;for(;i--;)(n=e[i]).id in r||t.push(n)}}function K(t){K.g.constructor.call(this),t&&Hf(t,K,0),this.S=t||[],this.gd=If(this,0,this.S.length)}function If(t,e,i){t=t.S;var r=0;for(e=yb(e,0),i=xb(i,t.length),i-=2,e+=1;e<i;)r+=We(t[e],t[e+=3]);return r}function Jf(t,e,i,r,n){var o=t.S.length;e=Te(e,n),i=Ue(i,n),t.S.push(Te(e,n),Ue(i,n),r===A?0:Ve(r,n)),o&&(t.gd+=We(t.S[o-2],i)),delete t.J,delete t.ur}function Hf(t,e,i){for(var r,n=t.length,o=!(n%3);o&&n;)o=!(E(t[--n]=Ve((r=t[n])===A?0:r))||E(t[--n]=Ue(t[n]))||E(t[--n]=Te(t[n])));if(!o&&e)throw new C(e,i,t)}function Kf(t){var e=new K,i=0,r=t.length;if(r%2)throw new C(Kf,0,t);for(;i<r;)Jf(e,t[i++],t[i++],0,Kf);return e}function Lf(t,e){return t.vo-e.vo}function Mf(t,e){var i,r=t.S,n=-2,o=[],s=t.ur;if(!s){s=t.ur=new Df;var a=0,l=t.S,c=l.length;for(i=0;i<c;i+=3){var h=l[i],u=l[i+1];if(i){var p=s.Lu(p,d,h,u);p.vo=a++}p=h;var d=u}}for(l=(s=s.Gm(e).sort(Lf)).length,e=0;e<l;e++){if(c=3*(a=(a=s[e]).vo),a>n+1){var m=[r[c],r[c+1]];o.push(m)}n=a,m.push(r[c+3],r[c+4])}if(t.gd){for(r=[],n=o.length,e=0;e<n;e++)if(s=(m=o[e]).length){for(l=[],t=0;t<s;t+=2)a=m[t],c=m[t+1],l.push(a,c),i=m[t-1],t&&We(c,i)&&(r.push(l),i+=0>i?360:-360,(l=[]).push(m[t-2],i,a,c));r.push(l)}o=r}return o}function Nf(t){var e=jf(t);t=e.polyline;var i=e.thirdDim;if(e=2===i||3===i,i=0===i,!t)throw new C(Nf,0,"data");if(e||i){i=t.length;for(var r=Array(3*i),n=0,o=0;n<i;n++){var s=t[n];r[o++]=s[0],r[o++]=s[1],r[o++]=e?s[2]:0}}if(!r)throw new C(Nf,0,"only ABSENT, ALTITUDE or ELEVATION are supported as type of the 3rd dimension");return new K(r)}function Of(t,e,i,r,n,o){var s,a,l,c,h=t.length;if(h)for(s=[];h--;){var u=t[h],p=u.length,d=0;for(l=1;l<p;l++)if(c=Pf(u[l-1],u[l],i,e,r,n)){var m=c[0],f=c[1];d&&d.da(m)?a.push(f):s.push(a=c),d=f,o&&(l=p,h=0)}}else s=t;return s}function Pf(t,e,i,r,n,o){var s=t.x;t=-t.y;var a=e.x;if(e=-e.y,i=-i,o=-o,s>a){if(a>n||s<r)return;var l=s,c=t;s=a,t=e,a=l,e=c,l=1}else if(s>n||a<r)return;if(t>e){if(e>i||t<o)return;var h=1;t=-t,e=-e,c=o,o=-i,i=-c}else if(t>i||e<o)return;if(s<r){if((t+=(r-s)*(e-t)/(a-s))>i)return;s=r}if(t<o){if((s+=(o-t)*(a-s)/(e-t))>n)return;t=o}return a>n&&(e=t+(n-s)*(e-t)/(a-s),a=n),e>i&&(a=s+(i-t)*(a-s)/(e-t),e=i),h&&(t=-t,e=-e),l?[new F(a,-e),new F(s,-t)]:[new F(s,-t),new F(a,-e)]}function Qf(t,e,i){var r,n;t=Rf(t,!0),e=Rf(e,!1);var o={},s=r=1;switch(~~(1*(i||0))){case 1:s=r=0;break;case 2:r=0,s=1;break;case 3:r=1,s=0}i=r;var a=s;if(e&&t){for(e.lj=new Sf(e.x,e.y,null,Tf(e)),t.lj=new Sf(t.x,t.y,null,Tf(t)),s=e;s.next;s=s.next)if(!s.nb)for(r=t;r.next;r=r.next)if(!r.nb){var l=Uf(s.next),c=Uf(r.next);if(n=Vf(s,l,r,c,o)){n=o.oy;var h=o.py,u=o.MD,p=o.ND;
2Wf(n=new Sf(u,p,null,null,null,null,!0,0,0,n),s,l),Wf(l=new Sf(u,p,null,null,null,null,!0,0,0,h),r,c),n.Mq=l,l.Mq=n}}for(o=dc(e,Xf(t)),i&&(o=!o),s=e;s;s=s.next)s.nb&&(s.mq=o,o=!o);for(o=dc(t,Xf(e)),a&&(o=!o),r=t;r.next;r=r.next)r.nb&&(r.mq=o,o=!o);for(Yf(e),Yf(t);(t=Zf(e))!=e;){for(i=null;!t.mo;t=t.Mq){for(o=t.mq;(i=new Sf(t.x,t.y,i)).artificial=t.nb||t.Su,t.mo=1,t=o?t.next:t.Bd;)if(t.nb){t.mo=1;break}if(!t)break}i.Nq=d||null;var d=i}return d}}function Sf(t,e,i,r,n,o,s,a,l,c){this.x=t,this.y=e,this.next=i||null,this.Bd=r||null,this.Nq=n||null,this.Mq=o||null,this.nb=!!s,this.mq=!!a,this.mo=l||0,this.alpha=c||0,r&&(r.next=this),i&&(i.Bd=this),this.Su=!1,this.lj=null}function Uf(t){for(;t&&t.nb;)t=t.next;return t}function Tf(t){if(t)for(;t.next;)t=t.next;return t}function Zf(t){var e=t;if(e)do{e=e.next}while(e!=t&&(!e.nb||e.nb&&e.mo));return e}function Yf(t){var e=Tf(t);e.Bd.next=t,t.Bd=e.Bd}function Vf(t,e,i,r,n,o){var s,a=e.x-t.x,l=e.y-t.y,c=r.x-i.x,h=r.y-i.y,u=a*h-l*c;return u?(c=((i.x-t.x)*h-(i.y-t.y)*c)/u,u=(l*(i.x-t.x)-a*(i.y-t.y))/u,0>c||1<c||0>u||1<u?0:(0===c?s=t:1===c?s=e:0===u?s=i:1===u&&(s=r),s&&!o?(s.x+=2480549651603763e-20,s.y+=7321997314118067e-20,s.lj&&(s.lj.x=s.x,s.lj.y=s.y),Vf(t,e,i,r,n)):(n.MD=t.x+c*a,n.ND=t.y+c*l,n.oy=c,n.py=u,1))):0}function Xf(t){for(var e=[];t;)e.push(t.x,t.y),t=t.next;return e}function Wf(t,e,i){for(e=e.next;e!==i&&e.alpha<=t.alpha;)e=e.next;t.next=e,t.Bd=e.Bd,t.next.Bd=t,t.Bd.next=t}function Rf(t,e){for(var i,r=null,n=0,o=t.length;n<o;n++)(i=new Sf(t[n].x,t[n].y,r)).Su=e,(i.next=r)&&(r.Bd=i),r=i;return r}function L(t,e){var i;if(L.g.constructor.call(this),B(t,K,L,0),e!==A&&db(e,L,1)){for(i=0;i<e.length;i++)B(e[i],K,L,1,"index "+i);this.bb=e}else this.bb=[];this.Eb=t,this.Uj=[]}function $f(t){var e=L,i=K,r=t.fa,n=t.W,o=t.ga,s=t.ca;return n=[r,n,A,r,s,A,o,s,A,o,n,A],180<=t.oc()&&(n.splice(9,0,o,t=t.vb().lng,A),n.splice(3,0,r,t,A)),new e(new i(n))}m=wf.prototype,m.fb=0,m.th=function(t){return this[t]||(++this.fb,this[t]=new wf(this,t))},m.removeChild=function(t){var e=t.Eo;this[e]===t&&(delete this[e],delete t.parent,--this.fb)},m.ze=ba(0),m.Qg=function(t){(this.entries||(this.entries=[])).push(t),t.node=this},u(Af,sf),Af.prototype.Ml=function(t){for(var e,i,r=this.head;t&&!((e=t.entries)&&e.length||(e&&delete t.entries,t.fb||!(i=t.parent)));)i.removeChild(t),r===t&&(r=i),t=i;this.head!==r&&(this.head=r,this.jd())},Af.prototype.Lu=function(t,e,i,r){if(t>i){var n=t;t=i,i=n}return e>r&&(n=e,e=r,r=n),Bf(this,t,e,i,r)},Af.prototype.Yd=function(t,e){return Bf(this,t,e,t,e)},Af.prototype.Vb=function(t,e,i,r,n,o){var s=t[8],a=t[9],l=0,c=0;return o&&(r<s||(l=+(e>=s)))&&(n<a||(c=+(i>=a)))?e=this.Vb(t.th(l|c<<1),e,i,r,n,o-1):(t.Qg(e=new Cf(e,i,r,n)),vf(this,e,!0),this.jd(t)),e},Cf.prototype.Nf=function(t){return this[t]},t("H.geo.QuadTree",Df),m=Df.prototype,m.jc=0,m.pc=function(){return this.jq},m.C=function(){var t,e;if(!this.J){var i,r,n,o=[];if(!this.Mg&&(t=tf(this.Ae))&&(this.Mg=new J(-t[0],t[3],-t[2],t[1])),(e=this.Mg)&&o.push(e),!this.Cf&&(n=(r=this.Ll).length)){t=90;var s=360,a=-90;for(i=0;n--;){var l=r[n];t=xb(t,l[0]),s=xb(s,l[3]),a=yb(a,l[2]),i=yb(i,l[1])}this.Cf=new J(-t,s,-a,i-360)}(e=this.Cf)&&o.push(e),(e=o[0])&&(o[1]&&(e=e.xd(o[1],!0)),this.J=e)}return this.J},m.Vb=function(t,e,i,r,n){return n?(n=new Cf(r,-t,e+360,-i),this.Ll.push(n),this.jq=!0,this.Cf&&this.Cf.ce(t,e,i,r,!0,this.Cf)):(n=Bf(this.Ae,e,-t,r,-i),this.Mg&&this.Mg.ce(t,e,i,r,!0,this.Mg)),++this.jc,this.J=null,n},m.Yd=function(t){var e=t.lng;return t=t.lat,this.Vb(t,e,t,e,!1)},m.Ju=function(t){var e=t.Nc(),i=t.Lc();return(t=t.pc())?this.Vb(e.lat,i.lng,i.lat,e.lng,t):this.Vb(e.lat,e.lng,i.lat,i.lng,t)},Df.prototype.insertBoundingBox=Df.prototype.Ju,Df.prototype.Lu=function(t,e,i,r){if(e<r)var n=e;else n=r,r=e;return t<i?e=i:(e=t,t=i),this.Vb(e,n,t,r,180<r-n)},Df.prototype.remove=function(t){var e;if(t.node){var i=this.Ae.remove(t);this.Mg=null}else(i=0<=(t=(e=this.Ll).indexOf(t)))&&(e.splice(t,1),this.jq=0<e.length,this.Cf=null);return i&&(--this.jc,this.J=null),i},Df.prototype.remove=Df.prototype.remove,Df.prototype.Gm=function(t,e,
2i){var r=this.Ae,n=t.Nc(),o=t.Lc(),s=-n.lat;n=n.lng;var a=-o.lat;return o=o.lng,!e&&s===a||!i&&n===o?t=[]:t.pc()?(Gf(t=r.nb(-180,s,o,a,i,e),r.nb(n,s,180,a,!1,e)),Gf(t,Ef(this,s,o,a,n+360,e,i))):Gf(t=r.nb(n,s,o,a,i,e),Ef(this,s,n,a,o,e,i)),t},Df.prototype.intersectBoundingBox=Df.prototype.Gm,u(K,Xe),t("H.geo.LineString",K),K.prototype.tr=function(t,e,i){Jf(this,t,e,i,this.tr)},K.prototype.pushLatLngAlt=K.prototype.tr,K.prototype.Zk=function(t,e,i){i&&Hf(i,this.Zk,2),void 0===e&&(e=this.S.length),e&&(this.gd-=If(this,t-3,t+e+3));var r=i?this.S.splice.apply(this.S,[t,e].concat(i)):this.S.splice(t,e);return i&&(this.gd+=If(this,t-3,t+i.length+3)),e&&!i&&(this.gd+=If(this,t-3,t-3)),delete this.J,delete this.ur,r},K.prototype.spliceLatLngAlts=K.prototype.Zk,K.prototype.Ku=function(t,e,i,r){this.Zk(t,0,[e,i,r])},K.prototype.insertLatLngAlt=K.prototype.Ku,K.prototype.Dw=function(t){this.Zk(t,3)},K.prototype.removeLatLngAlt=K.prototype.Dw,K.prototype.sg=function(t){Jf(this,t.lat,t.lng,t.alt,this.sg)},K.prototype.pushPoint=K.prototype.sg,K.prototype.Yd=function(t,e){this.Ku(3*t,e.lat,e.lng,e.alt)},K.prototype.insertPoint=K.prototype.Yd,K.prototype.Fk=function(t){this.Dw(3*t)},K.prototype.removePoint=K.prototype.Fk,K.prototype.xj=function(t,e){var i=this.S,r=3*t;t=i[r];var n=i[r+1];return i=i[r+2],e&&(e.lat=t,e.lng=n,e.alt=i),e||new Ye(t,n,i)},K.prototype.extractPoint=K.prototype.xj,K.prototype.bz=function(t,e,i){var r=this.S;e=e||0,i=oe(i,r.length/3);for(var n=3*e;e<i;)t(r[n++],r[n++],r[n++],e++)},K.prototype.eachLatLngAlt=K.prototype.bz,K.isDBC=We,K.prototype.Dp=function(t){var e=this.gd;return t&&(e+=We((t=this.S)[t.length-2],t[1])),e},K.prototype.getDBCs=K.prototype.Dp,K.prototype.Nj=function(){return this.S.length/3},K.prototype.getPointCount=K.prototype.Nj,K.prototype.dA=function(){return this.S},K.prototype.getLatLngAltArray=K.prototype.dA,K.prototype.J=x,K.prototype.C=function(){var t;if(!(t=this.J)){var e,i,r=(t=this.S).length,n=3,o=x;if(3<=r){var s=e=t[0],a=i=t[1];for(o=new J(s,a,e,i);n<r;n+=3){if(s=t[n-3],a=t[n-2],e=t[n],a>(i=t[n+1])&&180<i-a||a<i&&-180>a-i||i<a&&180>Cb(i-a)){var l=a;a=i,i=l}s<e&&(l=s,s=e,e=l),nf(o.fa,o.W,o.ga,o.ca,s,a,e,i,o)}}t=this.J=o}return t},K.prototype.getBoundingBox=K.prototype.C,K.prototype.YA=function(){return this.J!==x},K.prototype.hasBoundingBox=K.prototype.YA,K.fromLatLngArray=Kf,K.prototype.da=function(t){var e,i=this===t;if(!i&&(i=B(t,K))){var r=this.S;for(t=t.S,i=(e=r.length)===t.length;i&&e--;)i=r[e]==t[e]}return i},K.prototype.equals=K.prototype.da,m=K.prototype,m.ac="LineString",m.xf=function(t,e){var i,r=this.S,n=r.length;if(n){for(t.push("("),i=0;i<n;i+=3)i&&t.push(","),t.push(r[i+1]," ",r[i]);e&&(r[0]!==r[n-3]||r[1]!==r[n-2])&&t.push(",",r[1]," ",r[0]),t.push(")")}else t.push("EMPTY");return t},m.Jc="LineString",m.wf=function(){var t,e=[],i=this.S,r=i.length;for(t=0;t<r;t+=3)e.push([i[t+1],i[t],i[t+2]]);return e},m.Pd=function(){var t,e=this.S;if(this.C().pc()){var i=1;for(t=(e=e.slice()).length;i<t;i+=3)0>e[i]&&(e[i]+=360)}return e},m.CD=function(t){t=void 0===t?5:t;for(var e=this.S,i=e.length,r=[],n=0;n<i;n+=3)r.push([e[n],e[n+1],e[n+2]]);return hf({polyline:r,precision:t,thirdDim:2,thirdDimPrecision:t})},K.prototype.toFlexiblePolyline=K.prototype.CD,K.fromFlexiblePolyline=Nf,t("H.math.clipping.clipStrips",Of),t("H.math.clipping.clipPolygon",Qf),u(L,Xe),t("H.geo.Polygon",L),L.fromRect=$f;var ag={NORTH:90,SOUTH:-90};function bg(t,e){var i,r,n;return(n=t.C())&&((i=t.Dp(!0))&&(r=t.Nj())&&(n=n.xd(pf([t.xj(0),t.xj(r-1)],!0),!0)),360===n.oc()&&1==i%2&&(n=n.cf(e,0))),n}function cg(t,e,i,r){var n=t.bb,o=dg.bind(null,e,i);return cc(e,i,t.Eb.S,0,!0,3)!==bc.NONE&&(void 0!==r&&!r||!n.some(o))}function dg(t,e,i){return cc(t,e,i.S,0,!0,3)===bc.SURFACE}function eg(t,e){e=e.S,t=t.Eb.S;var i,r,n=e.length-3,o=t.length-3,s={};for(i=0;i<n;i+=3){var a=e[i],l=e[i+1],c=e[i+3],h=e[i+4];for(r=0;r<o;r+=3){var u=t[r],p=t[r+1],d=t[r+3],m=t[r+4];if(Vf(new Sf(l,a),new Sf(h,c),new Sf(p,u),new Sf(m,d),s,!0))return!0}}return!1}function fg(t,e){var i=e.Eb,r=e.bb,n=r.length,o=i.S,s=o.length,a=t.Eb.S,l=a.length;
2if(eg(t,i))return!0;for(i=0;i<s;i+=3)if(cg(t,o[i],o[i+1]))return!0;for(i=0;i<l;i+=3)if(cg(e,a[i],a[i+1]))return!0;for(i=0;i<n;i++)if(eg(t,r[i]))return!0;return!1}function gg(t){Za(this,gg),gg.g.constructor.call(this),this.ha=hg(this,t,this.constructor,0)}function hg(t,e,i,r){var n,o=[];if(!db(e))throw new C(i,r);for(n=0;n<e.length;n++){if(!t.sq(e[n]))throw new C(i,r);o.push(t.sw(e[n]))}return o}function ig(t){ig.g.constructor.call(this,t)}function jg(t){jg.g.constructor.call(this,t)}function kg(t){kg.g.constructor.call(this,t)}function lg(t,e,i){var r,n=6;if(e){for(r=' expected close to: "'+e;n--;)-1!==(e=t.lt.next())&&(r+=String.fromCharCode(e));r+='"'}throw new C(mg,0,"- Malformed WKT: "+(r?i+r:"unexpected end of stream"))}function ng(t,e){var i=t.next();i!==(e=e?")":"(")&&lg(t,i,'"'+e+'"')}function og(t){return","===t.cb()&&(t.next(),!0)}function pg(t,e,i,r,n){var o,s,a=2+e+i;for(s=1;s<=a;s++)(i=t.next())?(o=+i)!==o?lg(t,i,"number"):1===s?r[n+1]=o:2===s?r[n+0]=o:3===s&&(r[n+2]=o):lg(t,i);e||(r[n+2]=0)}L.Direction=ag,L.prototype.jf=ag.NORTH,L.prototype.$w=function(t){return this.jf!==t&&(this.J=x,this.Uj.length=0,this.jf=t),this},L.prototype.setPoleCovering=L.prototype.$w,L.prototype.uA=function(){return this.jf},L.prototype.getPoleCovering=L.prototype.uA,L.prototype.Qz=function(){return this.Eb},L.prototype.getExterior=L.prototype.Qz,L.prototype.Xw=function(t){if(!B(t,K))throw new C(this.Xw,0,t);this.Eb=t,this.J=x},L.prototype.setExterior=L.prototype.Xw,L.prototype.aA=function(){return this.bb},L.prototype.getInteriors=L.prototype.aA,L.prototype.io=function(t,e,i){var r,n=arguments.length;for(r=2;r<n;r++)B(arguments[r],K,this.io,r);var o=this.bb.splice.apply(this.bb,arguments);for(r=2;r<n;r++)arguments[r]=A;return this.Uj.splice.apply(this.Uj,arguments),o},L.prototype.spliceInteriors=L.prototype.io,L.prototype.HC=function(t){return this.io(t,1)[0]},L.prototype.removeInteriorAt=L.prototype.HC,L.prototype.GC=function(t){return 0>(t=this.bb.indexOf(t))?A:this.io(t,1)[0]},L.prototype.removeInterior=L.prototype.GC,L.prototype.zw=function(t){if(!B(t,K))throw new C(this.zw,0,t);this.bb.push(t)},L.prototype.pushInterior=L.prototype.zw,L.prototype.C=function(){var t=this.J;return t||(this.J=t=bg(this.Eb,this.jf)),t},L.prototype.getBoundingBox=L.prototype.C,m=L.prototype,m.bu=function(t){var e=this.bb.length;if(0>t||t>=e)throw new ae(this.bu,t,[0,e-1]);return(e=this.Uj[t])||(this.Uj[t]=e=bg(this.bb[t],this.jf)),e},m.ac="Polygon",m.xf=function(t){var e,i=this.bb,r=i.length;if(this.Eb.Nj()){for(t.push("("),this.Eb.xf(t,!0),e=0;e<r;e++)i[e].Nj()&&(t.push(","),i[e].xf(t,!0));t.push(")")}else t.push("EMPTY");return t},m.Jc="Polygon",m.wf=function(){var t,e=[],i=this.bb,r=this.Eb.wf();for(r[0].toString()!==r[r.length-1].toString()&&r.push(r[0]),e.push(r),t=0;t<i.length;t++)(r=i[t].wf())[0].toString()!==r[r.length-1].toString()&&r.push(r[0]),e.push(r);return e},m.P=function(){var t=L.g.P.call(this);return this.C().pc()&&(t.type="Multi"+t.type),t},m.Pd=function(){var t=[],e=this.bb,i=e.length;for(t.push(this.Eb.Pd());i--;)t[i+1]=e[i].Pd();return this.C().pc()?[t]:t},m.da=function(t){var e=!1;if(B(t,L)){var i=t.bb,r=this.bb.length;e=i.length;var n=0;for(e=this.Eb.da(t.Eb)&&r===e;e&&n<r;)e=e&&this.bb[n].da(i[n]),n++}return e},L.prototype.equals=L.prototype.da,u(gg,Xe),t("H.geo.MultiGeometry",gg),gg.prototype.splice=function(t,e,i){return t=[t],e!==A&&t.push(e),i&&(e=hg(this,i,this.splice,2),t=t.concat(e)),this.J=x,this.ha.splice.apply(this.ha,t)},gg.prototype.splice=gg.prototype.splice,gg.prototype.Cd=function(t){var e=this.ha.length;if(!(0<=t&&t<e))throw new ae(this.Cd,t,[0,e-1]);return this.J=x,this.ha.splice(t,1)[0]},gg.prototype.removeAt=gg.prototype.Cd,gg.prototype.remove=function(t){if(0<=(t=this.ha.indexOf(t))){var e=this.ha.splice(t,1)[0];this.J=x}return e||x},gg.prototype.remove=gg.prototype.remove,gg.prototype.Wz=function(){return this.ha},gg.prototype.getGeometries=gg.prototype.Wz,gg.prototype.push=function(t){var e=hg(this,[t],this.push,0)[0];this.J&&(this.J=this.J.xd(t.C())),this.ha.push(e)},gg.prototype.push=gg.prototype.push,gg.prototype.C=function(){var t,e,i;if(!(t=this.J)&&(t=x,this.ha.length))for(t=this.ha[0].C(),i=1;i<this.ha.length;
2i++)(e=this.ha[i].C())&&(t=t?t.xd(e):e);return this.J=t},gg.prototype.getBoundingBox=gg.prototype.C,gg.prototype.J=x,gg.prototype.sw=function(t){return t},gg.prototype.da=function(t){var e,i=this===t;if(!i&&(i=B(t,this.constructor))){var r=this.ha;for(t=t.ha,i=(e=r.length)===t.length;i&&e--;)i=r[e].da(t[e])}return i},gg.prototype.equals=gg.prototype.da,gg.prototype.xf=function(t){var e,i,r=this.ha,n=r.length,o=!1;if(n){for(t.push("("),e=0;e<n;e++)(i=0<e&&o)&&t.push(","),r[e].xf(t),"EMPTY"===t[t.length-1]?t.splice(-1-+i,+i+1):o=!0;o?t.push(")"):t.splice(-1,1,"EMPTY")}else t.push("EMPTY");return t},gg.prototype.Pd=function(){for(var t=[],e=this.ha,i=e.length;i--;)t[i]=e[i].Pd();return t},gg.prototype.P=function(){var t=gg.g.P.call(this);return t.type=this.ac,t},gg.prototype.wf=function(){for(var t=[],e=this.ha,i=e.length;i--;)t[i]=e[i].wf();return t},u(ig,gg),t("H.geo.MultiPolygon",ig),ig.prototype.sq=function(t){return B(t,L)},ig.prototype.ac="Multi"+L.prototype.ac,ig.prototype.Jc="Multi"+L.prototype.Jc,u(jg,gg),t("H.geo.MultiPoint",jg),jg.prototype.sq=function(t){return Ze(t)},jg.prototype.sw=function(t){return B(t,Ye)?t:$e(t)},jg.prototype.ac="Multi"+Ye.prototype.ac,jg.prototype.Jc="Multi"+Ye.prototype.Jc,u(kg,gg),t("H.geo.MultiLineString",kg),kg.prototype.sq=function(t){return B(t,K)},kg.prototype.ac="Multi"+K.prototype.ac,kg.prototype.Jc="Multi"+K.prototype.Jc;var qg=[];function rg(t,e,i,r){return r||ng(t,0),pg(t,e,i,qg,0),r||ng(t,1),new Ye(qg[0],qg[1],e?qg[2]:A)}function sg(t,e,i){var r=[];ng(t,0);do{pg(t,e,i,r,r.length)}while(og(t));return ng(t,1),new K(r)}function tg(t,e,i){ng(t,0);var r=sg(t,e,i);if(og(t)){var n=[];do{n.push(sg(t,e,i))}while(og(t))}return ng(t,1),new L(r,n)}var ug=[],vg=[tg],wg=[rg],xg={POINT:wg,LINESTRING:[sg],POLYGON:vg,MULTIPOINT:[rg,jg],MULTILINESTRING:[sg,kg],MULTIPOLYGON:[tg,ig],GEOMETRY:ug,GEOMETRYCOLLECTION:ug,CIRCULARSTRING:ug,COMPOUNDCURVE:ug,CURVEPOLYGON:ug,MULTICURVE:ug,MULTISURFACE:ug,CURVE:ug,SURFACE:ug,POLYHEDRALSURFACE:ug,TIN:ug,TRIANGLE:ug},yg={Z:1,M:2,ZM:3};function mg(t){var e,i=(t=new zg(t)).next();if((e=xg[i.toUpperCase()])||lg(t,i,"type name"),e!==ug){i=t.cb();var r=1&(i=yg[i.toUpperCase()]),n=i>>1;if(r|n&&t.next(),"EMPTY"===(i=t.cb()))if(t.next(),r=e[1])var o=new r([]);else e!==wg&&(o=new K([]),e===vg&&(o=new L(o)));else if("("===i){if(o=e[0],e=e[1]){var s=[];if(ng(t,0),o===rg){var a="("!==t.cb();do{s.push(o(t,r,n,a))}while(og(t))}else do{s.push(o(t,r,n))}while(og(t));ng(t,1),r=new e(s)}else r=o(t,r,n);o=r}else lg(t,i,'"Z", "M", "ZM", "(" or "EMPTY"');t.next()&&lg(t,i,"end of stream")}return o||x}function zg(t){this.lt=t}zg.prototype.cb=function(){var t=this.gw;if(t===A){for(t=this.lt;t.cb()===Ag;)t.next();if(Bg[t.cb()])t=(t=t.next())===Cg?"":String.fromCharCode(t);else{t.yi();do{t.next()}while(!Bg[t.cb()]);t=String.fromCharCode.apply(null,t.mh())}this.gw=t}return t},zg.prototype.next=function(){var t=this.cb();return""!==t&&delete this.gw,t};var Ag=32,Cg=-1,Dg={XD:Ag,RD:40,WD:41,OD:44,PD:Cg},Bg=Object.keys(Dg).reduce(function(t,e){return t[Dg[e]]=!0,t},Ra());function Eg(){}function Fg(t){this.Iu=String(t),this.mw=0,this.Dc=[],this.Xf=!1}function Gg(t,e,i,r){if(!t||!e||!i)throw new C(Gg,A,"Must specify name, version and revision parameter");this.name=t,this.version=e,this.revision=i,r&&Oa(this,r)}t("H.util.ICharStream",Eg),Eg.prototype.next=function(){},Eg.prototype.yi=function(){},Eg.prototype.mh=function(){},Eg.prototype.cb=function(){},t("H.util.CharStream",Fg),Fg.prototype.next=function(){var t=this.Iu.charCodeAt(this.mw++);return t=isNaN(t)?-1:t,this.Xf&&this.Dc.push(t),t},Fg.prototype.yi=function(){this.Xf=!0,this.Dc=[]},Fg.prototype.mh=function(){var t=this.Dc.slice();return this.Xf=!1,this.Dc=[],t},Fg.prototype.cb=function(){var t=this.Iu.charCodeAt(this.mw+0);return isNaN(t)?-1:t},t("H.util.wkt.toGeometry",function(t){return mg(new Fg(t))}),t("H.util.BuildInfo",Gg),Gg.prototype.toString=function(){var t,e=[];for(t in this)eb(this[t])&&e.push(this[t]);return e.join(";")};var Hg={};function Ig(t,e,i,r){if(!t)throw new C(Ig,1,"Must specify a name parameter");return Hg[t]||(Hg[t]=new Gg(t,e,i,r))}function Jg(){Jg.g.constructor.call(this),this.fd=Kg(this),this.En=Ra(),this.pn=z(this.pn,this),this.fd.addEventListener("message",this.pn),this.fl={}}Gg.get=Ig,u(Jg,I),Jg.prototype.disposeInternal=function(){this.fd.terminate()},Jg.prototype.uw=function(t){var e=t.type,i=!!this.En[e],r=t.data,n=Lg++,o=r&&r.FD?r.FD:A,s=!0;return i?(this.fl[n]=t,Mg(this,e,n,r&&r.message,o)):(t.reject(new C(this.uw,0,"processor_not_found")),s=!1),s},Jg.prototype.pn=function(t){t=t.data;var e=this.fl[t.taskId],i=t.taskId,r=t.data,n=this;if(2===t.type)new Me("arraybuffer",r).then(function(t){return t.arrayBuffer()}).then(function(t){n.fd.postMessage(["3",i,[t]],[t])},function(){n.fd.postMessage(["3",i,[null,"ERROR"]])});else{if(e){switch(t.type){case 1:e.resolve(r);break;case 0:e.reject(r)}delete this.fl[i]}this.dispatchEvent(new nd(this.j.IDLE))}};var Lg=0,Rg,Tg;function Ng(t,e,i){var r,n=Lg++;return t.fl[n]=r=Rc(),Mg(t,e,n,i),r.promise}function Mg(t,e,i,r,n){r===A||Ba(r)||(r=[r]);try{t.fd.postMessage([e,i,r],n)}catch(e){(t=t.fl[i]).reject(e.message)}}function Kg(a){var b=globalThis.H.__bootstrap__;if(b=Wa(b)?(""+b).replace(/^[^{]+{((.|[\r\n])+?)}\s*$/,"$1"):""+b,globalThis.Worker&&globalThis.URL)try{var c=new globalThis.Worker(globalThis.URL.createObjectURL(De(b,"application/javascript")))}catch(t){}return c||(a=new Og(a),function(){eval("var self = arguments[0];"+b)}(a),c=new Pg(a)),c}function Pg(t){I.call(this),this.fd=t}function Og(a){I.call(this),this.fd=a,this.addEventListener=z(this.addEventListener,this),this.removeEventListener=z(this.removeEventListener,this),this.postMessage=z(this.postMessage,this),this.eval=z(eval,this)}function Qg(){var t=Rg;return t||(t=Rg=this,I.call(t),this.zg()),t}function Sg(t,e,i){Xd.call(this,t,e,i)}function Ug(t){Ug.g.constructor.call(this),void 0!==t&&(this.data=t)}function Vg(){}Jg.prototype.j={IDLE:"idle",Hs:"error"},Jg.prototype.my=function(t,e){var i=this.dz||(this.dz=new nd(this.j.Hs));i.data=e,delete this.En[t],this.dispatchEvent(i)},Jg.prototype.importScripts=function(t){Ng(this,"0",t)},u(Pg,I),Pg.prototype.postMessage=function(t){globalThis.setTimeout(z(this.xC,this,t),0)},Pg.prototype.xC=function(t){var e=new nd("message");e.data=t,this.fd.dispatchEvent(e)},Pg.prototype.terminate=function(){this.fd.l(),this.l()},u(Og,I),Og.prototype.postMessage=function(t){var e=new nd("message");e.data=t,globalThis.setTimeout(z(this.fd.pn,this.fd,e),0)},u(Qg,I),m=Qg.prototype,m.disposeInternal=function(){Qg.g.disposeInternal.call(this),this.zg()},m.zg=function(){var t,e=this.qo;if(e)for(t=e.length;t--;)e[t].l();this.qo=[],kb(this.qo),this.Em={},this.ww=Ra()},m.Go=function(t){var e;if(t=t.type,!(e=this.ww[t]))throw new vb(this.Go,'Unknown type "'+t+'"');var i=this.qo,r=i[0];return r||(r=i[0]=new Jg,this.bc(Ja(jd,r)),La(this.Em)||r.importScripts(globalThis.Object.keys(this.Em))),(i=r).En[t]||(i.En[t]=e,Ng(i,"1",[t,Wa(e)?e+"":e]).then(ve,z(i.my,i,t))),r},m.am=function(){},m.registerProcessor=function(t,e){var i=this.ww,r=i[t];if(r){if(e!==r)throw new vb(this.registerProcessor,'Type "'+t+'" is already registered')}else i[t]=e},m.importScripts=function(t){[].concat(t).forEach(function(t){this.Em[t]||(this.Em[t]=!0,this.qo.forEach(function(e){e.importScripts(t)}))},this)},u(Sg,Xd),Sg.prototype.Gp=function(){return Tg||(Tg=new be(new Qg)),Tg},Sg.prototype.Xi=function(){},Sg.prototype.Pt=function(t){return t.uw(this)},u(Ug,I),t("H.map.Feature",Ug),Ug.prototype.getData=function(){return this.data},Ug.prototype.getData=Ug.prototype.getData,Ug.prototype.disposeInternal=function(){Ug.g.disposeInternal.call(this),delete this.data},t("H.map.provider.Invalidations",Vg),Vg.MARK_INITIAL=Wb,Vg.prototype.update=function(t,e){e!==Wg.NONE&&(this.Kd=t,e&Wg.SPATIAL&&(this.ix=t),e&Wg.VISUAL&&(this.Mx=t),e&Wg.ADD&&(this.Ys=t),e&Wg.REMOVE&&(this.Ew=t),e&Wg.Z_ORDER&&(this.Qx=t),e&Wg.VOLATILITY&&(this.Nx=t))},Vg.prototype.update=Vg.prototype.update,Vg.prototype.kA=function(){return this.Kd},Vg.prototype.getMark=Vg.prototype.kA,Vg.prototype.Kd=Wb,Vg.prototype.gB=function(t){return this.Kd>t},Vg.prototype.isAny=Vg.prototype.gB,Vg.prototype.Mx=Wb,Vg.prototype.Kh=function(t){return this.Mx>t},Vg.prototype.isVisual=Vg.prototype.Kh,Vg.prototype.ix=Wb,Vg.prototype.rq=function(t){return this.ix>t},Vg.prototype.isSpatial=Vg.prototype.rq,Vg.prototype.Ys=Wb,Vg.prototype.Pu=function(t){return this.Ys>t},Vg.prototype.isAdd=Vg.prototype.Pu,Vg.prototype.Ew=Wb,Vg.prototype.Lm=function(t){return this.Ew>t},Vg.prototype.isRemove=Vg.prototype.Lm,Vg.prototype.Qx=Wb,Vg.prototype.tq=function(t){return this.Qx>t},Vg.prototype.isZOrder=Vg.prototype.tq,Vg.prototype.Nx=Wb,Vg.prototype.lB=function(t){return this.Nx>t},Vg.prototype.isVolatility=Vg.prototype.lB;var Wg={NONE:0,VISUAL:1,SPATIAL:2,ADD:4,REMOVE:8,Z_ORDER:16,VOLATILITY:32};function M(t){if(Za(this,M),M.g.constructor.call(this,t?t.data:A),this.Sj=Xg.next(),t){var e="min";hb(t[e])&&(this.yb=t[e]),hb(t[e="max"])&&(this.Pc=t[e]),(e="visibility")in t&&(this.Jd=!!t[e]),(e="volatility")in t&&(this.no=!!t[e]),(e="zIndex")in t&&(this.Hi=+t[e]||0),(e="provider")in t&&!B(t[e],N)&&(this.D=t[e],this.qa(Wg.ADD))}}
2Vg.Flag=Wg,u(M,Ug),t("H.map.Object",M);var Xg=new qe(1),Yg={ANY:31,OVERLAY:1,SPATIAL:2,MARKER:4,DOM_MARKER:8,GROUP:16};function Zg(t,e,i){var r,n;if(!i||t[0]|e[0]){var o=t.length,s=e.length,a=xb(o,s),l=1;for(n=+i+1;l<a;l+=n)if(r=t[l]-e[l])return r}return i?0:o-s}function $g(t,e){return t.ot(e)}function ah(t,e,i){if(null===e||e===A)return null;if(0<=Object.keys(e).length&&"[object Object]"!==Object.prototype.toString.call(e))throw Error(bh(t,i));try{return JSON.stringify(e),e}catch(e){throw Error(bh(t,i))}}function bh(t,e){return"Object Remote-Id: "+t.gi+" - "+(e?"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.")}function ch(t,e){this.w=+t,this.h=+e}function dh(t,e,i,r,n){switch(e&&(this.ff=e),Ya(i)&&(this.Jo=!!i),this.Jo&&r&&(this.Ko=new ch(r.w,r.h)),Ya(n)&&(this.Hk={crossOrigin:n}),eh[cb(t)]){case 2:this.eb=t,fh(this,1);break;case 1:if(Be(t)){this.eb=t,gh(this),fh(this,1);break}t=t.src;case 0:if(t){t=pe(t),this.Dm=new Me("image",t,A,this.Hk),this.Dm.then(z(this.cC,this),z(this.bC,this));break}default:throw fh(this,-1),new C(dh,0,"No image data")}}function fh(t,e){t.o=e,delete t.Dm,t.ff&&t.ff(e,t)}function gh(t){if(t.Jo){var e=t.eb,i=hh(t),r=i&&i.w||+e.width,n=i&&i.h||+e.height,o=he();if(B(e,globalThis.HTMLCanvasElement))i=e;else{(i=e.ownerDocument.createElement("canvas")).width=Bb(r*o),i.height=Bb(n*o);var s=i.getContext("2d");s.scale(o,o),s.drawImage(e,0,0,r,n),Od&&(s.clearRect(0,0,r,n),s.drawImage(e,0,0,r,n))}t.eb=i}}M.Type=Yg,M.prototype.wb=function(){return this.Sj},M.prototype.getId=M.prototype.wb,M.prototype.Zr=function(t){if(!hb(t)&&!eb(t))throw new C(this.Zr,0,"id must be a number or a string");return this.gi=t,this},M.prototype.setRemoteId=M.prototype.Zr,M.prototype.BA=function(){return this.gi},M.prototype.getRemoteId=M.prototype.BA,M.prototype.yb=-1/0,M.prototype.Pc=1/0,M.prototype.ju=function(t){var e=this.Pc;if(t)for(t=this;t=t.Na;)e=xb(e,t.Pc);return e},M.prototype.getMax=M.prototype.ju,M.prototype.lu=function(t){var e=this.yb;if(t)for(t=this;t=t.Na;)e=yb(e,t.yb);return e},M.prototype.getMin=M.prototype.lu,M.prototype.Jd=!0,M.prototype.Zb=function(t){return(t=!!t)!==this.Jd&&(this.Jd=t,this.invalidate(Wg.VISUAL)),this},M.prototype.setVisibility=M.prototype.Zb,M.prototype.Vd=function(t){for(var e,i=this;(e=i.Jd)&&t&&(i=i.Na););return e},M.prototype.getVisibility=M.prototype.Vd,M.prototype.no=!1,M.prototype.tm=function(t){for(var e,i=this;!(e=i.no)&&t&&(i=i.Na););return e},M.prototype.getVolatility=M.prototype.tm,M.prototype.cx=function(t){var e=this.no;return e!==!!t&&(this.no=!e,this.invalidate(Wg.VOLATILITY)),this},M.prototype.setVolatility=M.prototype.cx,M.prototype.Hi=A,M.prototype.uu=function(){return this.Hi},M.prototype.getZIndex=M.prototype.uu,M.prototype.ui=function(t){return t!==this.Hi&&(this.Ik(),this.Hi=t,this.invalidate(Wg.Z_ORDER)),this},M.prototype.setZIndex=M.prototype.ui,M.prototype.so=A,M.prototype.Ve=function(){var t,e,i=this.so;if(!i){var r=+((t=this.Hi)!==A);(i=this.Na)?(i=i.Ve().slice())[0]|=r:i=[r],i.push(t||0,0>(e=this.cs)?this.Sj:e),this.so=i}return i},M.prototype.getZInfo=M.prototype.Ve,M.prototype.Ik=function(){this.so=A},M.compareZInfo=Zg,M.compareZOrder=$g,M.prototype.ot=function(t){return this.to-t.to||Zg(this.Ve(),t.Ve(),!1)},M.prototype.compareZOrder=M.prototype.ot,m=M.prototype,m.previousSibling=x,m.nextSibling=x,m.cs=-1,m.Na=x,m.pA=function(){return this.Na},M.prototype.getParentGroup=M.prototype.pA,M.prototype.qd=function(){for(var t,e=this;t=e.Na;)e=t;return e},M.prototype.getRootGroup=M.prototype.qd,M.prototype.contains=function(t){return this===t},M.prototype.contains=M.prototype.contains,M.prototype.ea=function(t){if(this.Na)throw new vb(this.ea,"Not allowed for a child of a group");M.g.ea.call(this,t)},M.prototype.setParentEventTarget=M.prototype.ea,M.prototype.draggable=M.prototype.draggable=!1,M.prototype.D=x,M.prototype.Qp=function(){return this.D},M.prototype.getProvider=M.prototype.Qp,M.prototype.ti=function(t,e){var i,r=this.D;if(i=r!==t){if(e&&(r&&!B(r,N)||t&&!B(t,N)))throw new vb(e,"Only LocalObjectProvider allows an object transfers");e=this.type!==Yg.GROUP,r&&(this.invalidate(Wg.REMOVE),e&&r.Oa(this)),(this.D=t)&&(e&&t.Y(this),this.Wf=x,this.invalidate(Wg.ADD))}return i},M.prototype.Wf=x,M.prototype.Mc=function(){return this.Wf||(this.Wf=new Vg)},M.prototype.getInvalidations=M.prototype.Mc,M.prototype.qa=function(t){var e,i=this.D;return(e=!!i)&&i.invalidateObject(this,t),e},M.prototype.invalidate=M.prototype.qa,M.prototype.disposeInternal=function(){this.Na&&this.Na.Oa(this),M.g.disposeInternal.call(this)},M.prototype.setData=function(t){return this.data=t,this},M.prototype.setData=M.prototype.setData,M.prototype.ye=function(t){if(t&&!Wa(t))throw new C(M.prototype.ye,0,"opt_callback must be a function");return t=ah(this,t?t(this.data):this.data,!!t),t=Wa(this.V)?{type:"Feature",properties:t,geometry:this.V().ye()}:{type:"FeatureCollection",features:we},this.gi&&(t.id=this.gi),t},M.prototype.toGeoJSON=M.prototype.ye,M.prototype.P=function(){return{id:this.Sj,properties:{min:this.lu(),max:this.ju(),zIdx:this.Hi,sIdx:this.cs,parent:this.Na?this.Na.wb():0,visible:this.Vd(),volatile:this.tm()},type:"Feature"}},M.prototype.forWorkerMessage=M.prototype.P,t("H.math.Size",ch),dh.prototype.o=0,dh.prototype.getState=function(){return this.o},dh.prototype.Jo=!0,dh.prototype.getData=function(){return this.eb||x};var eh={String:0,HTMLImageElement:1,HTMLCanvasElement:2};function hh(t){var e,i=t.Ko;if(!i){var r=t.eb;
2if(0===(i=r.naturalWidth||r.width)&&ne&&1===eh[cb(r)]){var n=!0;if(e=r.parentNode)var o=r.nextSibling;document.body.appendChild(r)}t.Ko=i=new ch(r.naturalWidth||r.width,r.naturalHeight||r.height),n&&(e?e.insertBefore(r,o):document.body.removeChild(r))}return i}function ih(t,e,i){var r="anonymous",n=1;this.Wg=z(this.Wg,this),M.call(this,i),this.X(t),i&&((t="crossOrigin")in i&&(r=i[t]),(t="opacity")in i&&(n=i[t])),this.Ww(e,r),this.Dd(n)}function jh(t,e,i,r){this.left=+t,this.top=+e,this.right=+i,this.bottom=+r}function kh(t,e){return new jh(t.x,t.y,e.x,e.y)}function lh(t){var e;if(t){var i=B(t,lh);for(e in t)if(e in this){var r=t[e];r!==this[e]&&("fillColor"===e||0<(r=+r))&&(this[e]=r)}(t=i?t.Oc:!!(me(this.fillColor)&&this.width&&this.width))||(this.Oc=t)}Ta(this)}function mh(t,e,i){this.paths=this.Sc=t,e!==A&&(this.interiorsIndex=this.Vj=e),i!==A&&(this.outlinesIndex=this.un=i)}m=dh.prototype,m.Ko=x,m.mc=function(){return 1===this.o?hh(this):x},m.cC=function(t){this.eb=t,gh(this),fh(this,1)},m.bC=function(){fh(this,-1)},m.cancel=function(){this.Dm&&this.Dm.cancel()},u(ih,M),t("H.map.Overlay",ih),ih.prototype.type=Yg.OVERLAY,ih.prototype.C=function(){return this.J},ih.prototype.getBoundingBox=ih.prototype.C,ih.prototype.si=function(t){return B(t,J,this.si,0,t),this.X(t)},ih.prototype.setBoundingBox=ih.prototype.si,ih.prototype.V=function(){return this.J},ih.prototype.getGeometry=ih.prototype.V,ih.prototype.X=function(t){var e=this.J,i=!e;return B(t,J,this.X,0,t),!i&&e.da(t)||(this.J=t,i||this.qa(Wg.SPATIAL)),this},ih.prototype.setGeometry=ih.prototype.X,ih.prototype.Se=function(){return this.eb.getData()},ih.prototype.getBitmap=ih.prototype.Se,ih.prototype.Ww=function(t,e){var i=this.eb;return i&&1!==i.getState()&&i.cancel(),this.eb=new dh(t,this.Wg,!0,A,e),this},ih.prototype.setBitmap=ih.prototype.Ww,ih.prototype.Wg=function(t,e){this.eb=e,1===t&&this.qa(Wg.VISUAL)},ih.prototype.Ue=function(){return this.Rc},ih.prototype.getOpacity=ih.prototype.Ue,ih.prototype.Dd=function(t){var e=this.Rc,i=2>e;if(!(0<=(t-=0)&&1>=t))throw new C(this.Dd,0);return t!==e&&(this.Rc=t,i&&this.qa(Wg.VISUAL)),this},ih.prototype.setOpacity=ih.prototype.Dd,ih.prototype.P=function(){var t=ih.g.P.call(this);return t.geometry=$f(this.J).P(),t.properties.overlay=!0,t},ih.prototype.forWorkerMessage=ih.prototype.P,t("H.math.Rect",jh),jh.prototype.set=jh,jh.prototype.set=jh.prototype.set,jh.prototype.Nc=function(){return this.ml||(this.ml=new F(this.left,this.top))},jh.prototype.getTopLeft=jh.prototype.Nc,jh.prototype.Lc=function(){return this.Si||(this.Si=new F(this.right,this.bottom))},jh.prototype.getBottomRight=jh.prototype.Lc,jh.prototype.Rl=function(t,e){return this.left<=t&&this.right>=t&&this.top<=e&&this.bottom>=e},jh.prototype.containsXY=jh.prototype.Rl,jh.fromPoints=kh,jh.prototype.clone=function(){return new jh(this.left,this.top,this.right,this.bottom)},jh.prototype.clone=jh.prototype.clone,t("H.map.ArrowStyle",lh),lh.prototype.Oc=!0,lh.prototype.fillColor="rgba(255,255,255,.75)",lh.prototype.width=1.2,lh.prototype.length=1.6,lh.prototype.frequency=5,lh.prototype.cu=function(){return new lh(this)},lh.prototype.da=function(t){var e=this===t;return!e&&t&&(e=t.width===this.width&&t.fillColor===this.fillColor&&t.length===this.length&&t.frequency===this.frequency),e},lh.prototype.equals=lh.prototype.da,mh.prototype.Vj=Vb,mh.prototype.interiorsIndex=mh.prototype.Vj,mh.prototype.un=Vb,mh.prototype.outlinesIndex=mh.prototype.un;var nh=Ua(new mh([])),oh=Ta([]);function P(t){var e;if(t){var i=ph;for(e=B(t,P);i--;){var r=qh[i];if(t.hasOwnProperty(r)){var n=t[r];if(e)this[r]=n;else{if((n=rh[i](n))===sh)throw new C(P,0,r+": "+t[r]);n!==this[r]&&n!==A&&(this[r]=n)}}}(i=e?t.Yj:this.lineWidth&&me(this.strokeColor))||(this.Yj=i),(i=e?t.Oc:me(this.fillColor))||(this.Oc=i),(i=e?t.Wj:"none"!==this.strokeColor&&this.lineWidth)||(this.Wj=i)}Ta(this)}t("H.map.SpatialStyle",P),P.prototype.Oc=!0,P.prototype.Yj=!0,P.prototype.Wj=!0;var qh="strokeColor fillColor lineWidth lineCap lineJoin miterLimit lineDash lineDashOffset lineDashImage lineHeadCap lineTailCap".split(" ");P.prototype.strokeColor="rgba(0,85,170,.6)",P.prototype.strokeColor=P.prototype.strokeColor,P.prototype.fillColor="rgba(0,85,170,.4)",P.prototype.fillColor=P.prototype.fillColor,P.prototype.lineWidth=2,P.prototype.lineWidth=P.prototype.lineWidth,P.prototype.lineCap="round",P.prototype.lineCap=P.prototype.lineCap,P.prototype.lineJoin="miter",P.prototype.lineJoin=P.prototype.lineJoin,P.prototype.miterLimit=1,P.prototype.miterLimit=P.prototype.miterLimit,P.prototype.vB=we,P.prototype.lineDash=P.prototype.vB,P.prototype.lineDashOffset=0,P.prototype.lineDashOffset=P.prototype.lineDashOffset,P.prototype.wB=A,P.prototype.lineDashImage=P.prototype.wB,P.prototype.xB=A,P.prototype.lineHeadCap=P.prototype.xB,P.prototype.yB=A,P.prototype.lineTailCap=P.prototype.yB;var ph=qh.length;P.prototype.da=function(t){var e=this===t;if(!e&&t){for(e=0;e<ph;e++){var i=qh[e];if(this[i]!==t[i])break}e=e===ph}return e},P.prototype.equals=P.prototype.da,P.prototype.du=function(t){if(t){var e={};Oa(e,this,t)}else e=this;return new P(e)},P.prototype.getCopy=P.prototype.du;var sh=Ta({}),rh=[function(t){return t?Sa(t):sh},function(t){return t?Sa(t):sh},function(t){return 0<=t&&100>=t?+t:sh},function(t){return"butt"===(t=Sa(t))||"square"===t||"round"===t||"arrow-head"===t||"arrow-tail"===t?t:sh}
2,function(t){return"round"===t||"bevel"===t||"miter"===t?t:sh},function(t){return 0<t&&100>=t?+t:sh},function(t){return t&&t.every&&t.every(ib)?t:sh},function(t){return E(+t)?sh:+t},function(t){return t===A||t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||Object.values(th).includes(t)?t:sh},function(t){return Ya(t)?rh[3](t):A},function(t){return Ya(t)?rh[3](t):A}],uh=new Image;uh.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 vh=new Image;vh.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>');var th={ARROW:uh,CIRCLE:vh};P.DashImage=th,P.MAX_LINE_WIDTH=100;var wh=new P;P.DEFAULT_STYLE=wh;var xh="fillColor strokeColor lineWidth lineCap lineJoin miterLimit lineDashOffset lineDash lineTailCap lineHeadCap".split(" ");function yh(t,e){var i;yh.g.constructor.call(this,e),e&&this.Bb(e.style),t&&(this.We=!0),e&&(i=e.arrows)&&this.Uw(i)}function zh(t,e){var i,r=!1,n=!1;if(e.length){for(r=0;r<e.length;r++)if(e[r]!==nh){n=!0;break}e=t.style,r=n?e.Yj||e.Oc&&t.We||(i=t.Tg||!1)&&e.Wj&&i.Oc:e.Oc}return r&&t.Vd(!0)}function Ah(t,e){Ah.g.constructor.call(this,t,e)}function Bh(t,e,i,r){var n,o=[],s=e.length;for(n=0;n<s;n++){var a=e[n];if(a.length){var l=o,c=l.push,h=void 0,u=t,p=i,d=r,m=[],f=a.length,g=0;for(u.Dt=0,h=h||0;g<f;)m.push(Ch(u,a[g++],a[g++],h,d));p&&m.push(Ch(u,a[0],a[1],h,d)),c.call(l,m)}}return o}function Ch(t,e,i,r,n){var o=t.Dt;return o&&180<Cb(o-i)&&(i+=0>o?-360:360),t.Dt=i,n.vq(e,i+r)}function Dh(t,e,i){for(var r,n,o,s=e,a=t.length+e;s--;){for(n=(e=t[s]).length,r=Array(n);n--;)o=e[n],r[n]=new F(o.x+i,o.y);t[--a]=r}}function Eh(t,e){var i=e&&(+e.extrusion||+e.extrude)||0,r=e&&+e.elevation||0,n=0;if(Eh.g.constructor.call(this,!0,e),0<r&&(n+=r,this.If=r),0<i&&(n+=i,this.nh=i),2047<n)throw new ae(Eh,n,[0,2047]);B(t,K)?this.X(new L(t)):this.X(t)}P.prototype.P=function(){for(var t,e={},i=xh.length;i--;)e[t=xh[i]]=this[t];return e},P.prototype.forWorkerMessage=P.prototype.P,u(yh,M),t("H.map.Spatial",yh),yh.prototype.type=Yg.SPATIAL,yh.prototype.to=0,yh.prototype.style=wh,yh.prototype.K=function(){return this.style},yh.prototype.getStyle=yh.prototype.K,yh.prototype.Bb=function(t){var e=!0;return t?this.style=B(t,P)?t:new P(t):this.style?delete this.style:e=!1,e&&this.invalidate(Wg.VISUAL),this},yh.prototype.setStyle=yh.prototype.Bb,yh.prototype.xz=function(){return this.Tg},yh.prototype.getArrows=yh.prototype.xz,yh.prototype.Uw=function(t){var e=this.Tg,i=!1;return!t&&e?(delete this.Tg,i=!0):!t||e&&e.da(t)||(this.Tg=new lh(t),i=!0),i&&"none"!==this.style.strokeColor&&this.qa(1),this},yh.prototype.setArrows=yh.prototype.Uw,yh.prototype.We=!1,yh.prototype.hB=function(){return this.We},yh.prototype.isClosed=yh.prototype.hB,yh.prototype.getGeometriesForTile=yh.prototype.xh,yh.prototype.Ip=function(){return A},yh.prototype.getLabels=yh.prototype.Ip,u(Ah,yh),t("H.map.GeoShape",Ah),Ah.prototype.getBoundingBox=Ah.prototype.C,u(Eh,Ah),t("H.map.Polygon",Eh);var Fh=new L(new K([0,0,0,0,0,0,0,0,0]));function Gh(t,e,i,r){var n,o,s=0,a=!0;if(n=Hh(t,e.Eb,i,r,e.C())){var l=new mh(n),c=e.bb;if(o=c.length)for(l.Vj=l.Sc.length;s<o;s++)(n=Hh(t,c[s],i,r,e.bu(s)))&&(l.Sc=l.Sc.concat(n));for(o=l.Sc.length,s=0;s<o;s++)if(l.Sc[s]!==oh){a=!1;break}a&&(l=s%2?nh:A)}return l}function Hh(t,e,i,r,n){var o,s=i.Qj(),a=n,l=a.oc(),c=[[]],h=e.S,u=[],p=h.length,d=!1;for(o=0;o<p;o+=3){var m=h[o],f=h[o+1];d||180!=Cb(f)||(u.push(m),u.push(f),u.push(m),u.push(-f),d=!0),u.push(m),u.push(f)}if(h=u,360>l&&-180==a.W&&(a=new J(a.fa,180,a.ga,a.ca)),360>l&&180==a.ca&&(a=new J(a.fa,a.W,a.ga,-180)),a.pc()){for(m=(l=h).length,h=-1,u=0;u<m-2;u+=2)if(We(l[u+1],l[u+3])){h=u+2;break}-1===h&&We(l[m-1],l[1])&&(h=m),-1!==h&&(p=l[h-2],u=l[h-1],o=l[h%m],d=l[(h+1)%m],180!==Cb(p)&&180!==Cb(o)&&(f=Cb(o-p),m=Cb(d-u),m+=180<m?-360:0,d=Cb(180-d),d+=180<d?-360:0,m&&d&&(f/=Cb(m)/Cb(d),p=o+(o>p?-f:f),u=0<u?180:-180,l.splice(h,0,p,u,p,-u)))),h=l}if(c[0]=Ih([].concat(h),a.W),360>a.oc()&&a.Ff(new Ye(a.fa,180))&&(h=Ih([].concat(h),a.ca),c.push(h)),t=Bh(t,c,!0,a=i.qm()),360===n.oc()&&1==e.Dp(!0)%2){for(e=t,t=i.Qj(),e[0][1].x>e[0][e[0].length-1].x&&(e[0]=e[0].reverse()),h=[],l=e[0].length-1,c=0;c<l;c++)u=e[0][c],h[c]=new F(u.x-2*a.w,u.y),h[c+l]=new F(u.x-a.w,u.y),h[c+2*l]=new F(u.x,u.y),h[c+3*l]=new F(u.x+a.w,u.y),h[c+4*l]=new F(u.x+2*a.w,u.y);e[0]=h,(c=a.vq(r,0)).y=2*t[r===ag.NORTH?"top":"bottom"],r=c.clone(),c.x=e[0][e[0].length-1].x+1,r.x=e[0][0].x-1,e[0].push(c,r),t=e}if(Of(t,r=s.left,e=s.top,c=s.right,s=s.bottom,!0).length){if(!i.om().Xo(n)){for(i=t,n=[new F(r,e),new F(c,e),new F(c,s),new F(r,s)],s=[],t=i.length;t--;)if(r=Qf(n,i[t]))for(e=Jh(r),s.push(e);r.Nq;)e=Jh(r=r.Nq),s.push(e);t=s}}else i=Kh(r,e,t[0]),t[1]&&(i=i!==Kh(r,e,t[1])),t=i?[oh]:A;return t}function Kh(t,e,i){var r,n,o,s=r=i[0].x,a=n=i[0].y,l=1;for(o=i.length;l<o;l++){var c=i[l].x,h=i[l].y;c>r?r=c:c<s&&(s=c),h>n?n=h:h<a&&(a=h)}return s<=t&&t<=r&&a<=e&&e<=n&&dc({x:t,y:e},ec(i.concat(i[0])))}function Jh(t){var e=[],i=t;do{var r=zb(100*(i.pC?i.pC:i.x))/100,n=zb(100*(i.qC?i.qC:i.y))/100;if(!o||.01<Eb(Fb(o.x-r,2)+Fb(o.y-n,2))){var o=new F(r,n);e.push(o)}i=i.next}while(i&&i!==t);return e}function Ih(t,e){var i,r=Number.POSITIVE_INFINITY,n=-1,o=t.length;for(i=0;i<o;i+=2){var s=Cb(t[i+1]-e);(s+=180<s?360-s:s)<r&&(r=s,n=i)}return 0<i?(e=t.splice(n,t.length-n)).concat(t):t}function Lh(t,e){var i,r=t,n=e||[];if(t!==Mh.NONE){if(e=i=n.length,-1===Nh.indexOf(r))throw new C(Lh,0,t);if(!n)throw new C(Lh,1,n);for(;i--;)if(E(n[i]))throw new C(Lh,1,n);if(r===Mh.RECT&&3<e&&(n=[n[0],n[1],n[2],n[1],n[2],n[3],n[0],n[3]],r=Mh.POLYGON),r===Mh.CIRCLE&&2<e&&0<(t=n[2])){r=n[0];var o=n[1],s=360/(i=xb(2*Bb(t),40));for(n=[];i--;){var a=s*i*Tb;n.push(r+Hb(a)*t,o+Jb(a)*t)}
2r=Mh.POLYGON}if(r!==Mh.POLYGON||!e||n.length%2)throw new C(Lh,1,n);this.lw=n}}Eh.prototype.nh=0,Eh.prototype.If=0,Eh.prototype.Gb=Fh,Eh.MAX_EXTRUDE_HEIGHT=2047,Eh.prototype.Pr=function(t){var e=+t;if(e!==t)throw new C(this.Pr,0,t);if(0>e||2047<this.If+e)throw new ae(this.Pr,this.If+e,[0,2047]);this.nh=e,this.qa(Wg.SPATIAL)},Eh.prototype.setExtrusion=Eh.prototype.Pr,Eh.prototype.Rz=function(){return this.nh},Eh.prototype.getExtrusion=Eh.prototype.Rz,Eh.prototype.Or=function(t){var e=+t;if(e!==t)throw new C(this.Or,0,t);if(0>e||2047<this.nh+e)throw new ae(this.Or,this.nh+e,[0,2047]);this.If=e,this.qa(Wg.SPATIAL)},Eh.prototype.setElevation=Eh.prototype.Or,Eh.prototype.Mz=function(){return this.If},Eh.prototype.getElevation=Eh.prototype.Mz,Eh.prototype.V=function(){return this.Gb},Eh.prototype.getGeometry=Eh.prototype.V,Eh.prototype.X=function(t){if(B(t,L))var e=!1;else B(t,ig,this.X,0),e=!0;return this.Uf=e,e=this.Gb,this.Gb=t,e!==Fh&&this.qa(Wg.SPATIAL),this},Eh.prototype.setGeometry=Eh.prototype.X,Eh.prototype.C=function(){return this.V().C()},Eh.prototype.getBoundingBox=Eh.prototype.C,Eh.prototype.xh=function(t){var e,i,r,n=this.V();if(this.Uf){var o=0;for(r=(n=n.ha).length;o<r;o++)(i=Gh(this,n[o],t,n[o].jf))&&(e||(e=[]),e.push(i))}else(i=this.jf)===A&&(i=this.Uf?ag.NORTH:this.V().jf),(i=Gh(this,n,t,i))&&(e=[i]);return e},Eh.prototype.getGeometriesForTile=Eh.prototype.xh,Eh.prototype.Ti=x,Eh.prototype.P=function(){var t,e=Eh.g.P.call(this),i=this.V(),r=this.Uf?i.ha:[i],n=e.properties,o=e.geometry=i.P();if(n.style=this.K().P(),n.height=this.nh+this.If,n.min_height=this.If,this.C().pc()&&(o.type="MultiPolygon",this.Uf)){var s=[];r.forEach(function(e,i){t=o.coordinates[i],e.C().pc()?s=s.concat(t):s.push(t)}),o.coordinates=s}return e},Eh.prototype.forWorkerMessage=Eh.prototype.P,t("H.map.HitArea",Lh);var Mh={NONE:0,RECT:1,CIRCLE:2,POLYGON:3};Lh.ShapeType=Mh;var Nh=[Mh.RECT,Mh.CIRCLE,Mh.POLYGON];function Oh(t,e){var i;Za(this,Oh),Oh.g.constructor.call(this,e),this.X(t),e&&"icon"in e&&(i=e.icon),this.ve(i||this.Ep())}Lh.prototype.Cm=function(t,e,i){return this.lw?cc(t,e,this.lw,i,!0):bc.NONE},Lh.prototype.hitTest=Lh.prototype.Cm,u(Oh,M),t("H.map.AbstractMarker",Oh),Oh.prototype.V=function(){return this.im},Oh.prototype.getGeometry=Oh.prototype.V,Oh.prototype.X=function(t){var e=this.im;return B(t,Ye)||B(t,jg)?this.im=t:(Ze(t,this.X,0),this.im=$e(t)),e&&this.qa(Wg.SPATIAL),this},Oh.prototype.setGeometry=Oh.prototype.X,Oh.prototype.C=function(){return this.im.C()},Oh.prototype.kc=function(){return this.icon},Oh.prototype.getIcon=Oh.prototype.kc,Oh.prototype.ve=function(t){var e=this.icon,i=!e;if(e!==t){if(!this.Wu(t)){if(i)throw new C(this.constructor,1,t);throw new C(this.ve,0,t)}this.icon=t,i||this.qa(Wg.VISUAL)}return this},Oh.prototype.setIcon=Oh.prototype.ve,Oh.prototype.Ep=function(){var t=this.Ry;return t||(t=this.constructor.prototype.Ry=this.rt(Ph)),t};var Ph={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 ch(38,47),anchor:new F(19,45),hitArea:new Lh(Mh.POLYGON,[19,46,2,27,0,18,5,6,19,0,32,5,38,15,36,27,19,47])};function Qh(t,e){if(!B(t,Element)){if(Rh.innerHTML=t,!(t=Rh.firstElementChild))throw new C(Qh,0,"No element data");Rh.removeChild(t);var i=!0;Rh.innerHTML=""}this.Wo=0!==ye(t).length,this.Lt=i?t:ze(t,globalThis.document,this.Wo),e&&((i="onAttach")in e&&ab(t=e[i],"Function",Qh,1,i)&&(this.Oq=t),(i="onDetach")in e&&ab(t=e[i],"Function",Qh,1,i)&&(this.Sq=t))}Oh.prototype.P=function(){var t=Oh.g.P.call(this),e=this.kc(),i=e.mc(),r=e.Cb;return t.geometry=this.V().P(),i&&((e=t.properties.icon={id:e.uid}).size={w:i.w,h:i.h},e.offset=[i.w/2-(r?r.x:0),i.h/2-(r?r.y:0)]),t},Oh.prototype.forWorkerMessage=Oh.prototype.P,t("H.map.DomIcon",Qh);var Rh=document.createElement("DIV");function Sh(t,e){Sh.g.constructor.call(this,t,e)}Qh.prototype.Oq=null,Qh.prototype.Sq=null,Qh.prototype.cu=function(t){return ze(this.Lt,t,this.Wo)},Qh.prototype.Wo=!1,u(Sh,Oh),t("H.map.DomMarker",Sh),Sh.prototype.type=Yg.DOM_MARKER,Sh.prototype.to=2,Sh.prototype.rt=function(t){var e=new Qh(t.svg,t);return t=t.anchor,e.Lt.style.margin=-t.y+"px 0 0 -"+t.x+"px",e},Sh.prototype.Wu=function(t){return B(t,Qh)};var Th={PENDING:0,ACTIVE:1,DONE:2};function Uh(t,e,i){Uh.g.constructor.call(this,Fh,i),this.ao(t),this.Yr(e),i&&this.nw in i&&this.Xr(i[this.nw])}function Vh(t){t.Gb!==x&&Uh.g.X.call(t,Wh(t))}function Wh(t){var e=t.Df,i=e.lat,r=t.wr,n=0,o=new K;if(90===Cb(i))for(i=e.oo(0,r,!0).lat;360>n;n+=120)o.tr(i,n-180,A);else for(t=360/(t=t.Bn);360>n;n+=t)o.sg(e.oo(n,r,!0));return e=new L(o),0>i&&e.$w(ag.SOUTH),e}function Xh(t,e){var i,r="anonymous";if(this.uid=Yh.next(),Xh.g.constructor.call(this),e){var n="size";if(n in e){var o=e[n];if(!o||isNaN(o.w)||isNaN(o.h))throw new C(Xh,1,n);this.fo=new ch(o.w,o.h)}if((n="anchor")in e){if(!(o=e[n])||isNaN(o.x)||isNaN(o.y))throw new C(Xh,1,n);
2this.Cb=new F(o.x,o.y)}(n="hitArea")in e&&(B(o=e[n],Lh,Xh,1),this.Bm=e[n]),(n="asCanvas")in e&&(i=e[n]),(n="crossOrigin")in e&&(r=e[n]),(o=e.stickHeight)===+o&&0<o&&(this.pD=o),o=e[n="stickColor"],n in e&&eb(o)&&(this.oD=o)}t=new dh(t,z(this.Wg,this),i,this.fo,r),0!==(e=this.o=t.getState())?this.Wg(e,t):this.Fl=t}t("H.map.render.RenderState",Th),u(Uh,Eh),t("H.map.Circle",Uh),Uh.prototype.ao=function(t){(t=$e(t)).da(this.Df)||(this.Df=t,Vh(this))},Uh.prototype.setCenter=Uh.prototype.ao,Uh.prototype.vb=function(){return this.Df},Uh.prototype.getCenter=Uh.prototype.vb,Uh.prototype.Yr=function(t){if(E(t=$b(t,0,6371000.79*Ob/2)))throw new C(this.Yr,0,t);this.wr!==t&&(this.wr=t,Vh(this))},Uh.prototype.setRadius=Uh.prototype.Yr,Uh.prototype.AA=function(){return this.wr},Uh.prototype.getRadius=Uh.prototype.AA,Uh.prototype.Bn=60,Uh.prototype.Xr=function(t){if(!hb(t))throw new C(this.Xr,0,t);this.Bn!==(t=$b(zb(t),4,360))&&(this.Bn=t,Vh(this))},Uh.prototype.setPrecision=Uh.prototype.Xr,Uh.prototype.nw="precision",Uh.prototype.xA=function(){return this.Bn},Uh.prototype.getPrecision=Uh.prototype.xA,Uh.prototype.X=function(){return this},Uh.prototype.setGeometry=Uh.prototype.X,Uh.prototype.V=function(){return this.Gb===Fh&&Uh.g.X.call(this,Wh(this)),this.Gb},Uh.prototype.getGeometry=Uh.prototype.V,u(Xh,I),t("H.map.Icon",Xh);var Yh=new qe;Xh.State={ERROR:-1,LOADING:0,READY:1},Xh.prototype.getState=function(){return this.o},Xh.prototype.getState=Xh.prototype.getState,Xh.prototype.Wg=function(t,e){if(this.eb=e.getData(),1===t){var i=this.fo;i||(i=this.fo=e.mc()),this.Cb||(this.Cb=new F(i.w/2|0,i.h))}this.Fl&&(this.o=t,delete this.Fl,this.dispatchEvent("statechange"))},Xh.prototype.eb=x,Xh.prototype.Se=function(){return this.eb},Xh.prototype.getBitmap=Xh.prototype.Se,Xh.prototype.mc=function(){return this.fo||x},Xh.prototype.getSize=Xh.prototype.mc,Xh.prototype.Cb=x,Xh.prototype.zp=function(){return this.Cb},Xh.prototype.getAnchor=Xh.prototype.zp,Xh.prototype.Bm=x,Xh.prototype.Xz=function(){return this.Bm},Xh.prototype.getHitArea=Xh.prototype.Xz,Xh.prototype.disposeInternal=function(){Xh.g.disposeInternal.call(this),this.eb?(this.eb.removeAttribute("src"),delete this.eb):(this.Fl.cancel(),delete this.Fl)},t("H.util.events.listenOnce",Cd),t("H.util.events.dispatchEvent",function(t,e){return t.dispatchEvent(e)}),t("H.util.events.fireListeners",function(t,e,i,r){if(hd(t))i=t.Kf(e,i,r);else{var n=!0;if((t=Fd(t))&&(e=t.ob[e.toString()]))for(e=e.concat(),t=0;t<e.length;t++){var o=e[t];o&&o.capture==i&&!o.ii&&(o=Ld(o,r),n=n&&!1!==o)}i=n}return i}),t("H.util.events.listen",Ad),t("H.util.events.unlisten",Jd);var Zh=Ld,di;function $h(t,e){$h.g.constructor.call(this,t,e)}function ai(t,e){ai.g.constructor.call(this,!1,e),this.X(t)}function bi(t,e){if(!B(t,K)||2>t.Nj())throw new C(e,0)}function ci(t,e,i,r){var n=Mf(e,i.om());if(n.length&&(n=(t=Bh(t,n,!1,e=i.qm())).length)){var o=i.Qj();e=e.w,i.x||Dh(t,n,-e),i.x===(1<<i.z)-1&&Dh(t,n,e),(i=Of(t,o.left,o.top,o.right,o.bottom,!1)).length&&r.push(new mh(i))}}function ei(t,e){if(globalThis.URL)return new globalThis.URL(t,e).toString();if(!t||!fi(t))return t;if(!e||fi(e))throw new TypeError("Failed to construct 'URL': Invalid base URL");di||kb(di=document.createElement("a"));var i=di;return i.href=e,"/"!==t[0]?t=i.href.replace(/\/[^\/]*$/,"/")+t:((e=i.origin)||(e=i.protocol+"//"+i.host),t=e+t),t}function fi(t){var e=!1;return"string"==typeof t&&(e=!(-1<t.search(/^(http|https|data|blob):/)||"//"===t.substr(0,2))),e}function gi(t,e){if(gi.g.constructor.call(this),e&&fi(e))throw new C(gi,1,"Base URL must be absolute");this.o=hi.INIT,this.Ia=null,this.kd=e}Ld=function(t,e){var i,r,n=!0,o=e[e.currentTarget===e.target?"AT_TARGET":t.capture?"CAPTURING_PHASE":(i=!0,"BUBBLING_PHASE")];return(!i||"pointerenter"!==(r=e.type)&&"pointerleave"!==r)&&(e.eventPhase=o,n=Zh(t,e),i&&t.src&&t.src.Ib&&null===t.src.Ib()&&delete e.eventPhase),n},u($h,Oh),t("H.map.Marker",$h),$h.prototype.type=Yg.MARKER,$h.prototype.to=1,$h.prototype.qa=function(t){if(t!==Wg.VISUAL||1===this.qw||1===this.icon.getState())var e=$h.g.qa.call(this,t);return e||!1},$h.prototype.invalidate=$h.prototype.qa,m=$h.prototype,m.qw=0,m.Wu=function(t){return B(t,Xh)},m.pq=!1,m.Lv=function(){this.qa(Wg.VISUAL)},m.ve=function(t){var e=this.icon;return this.pq&&(e.removeEventListener("statechange",this.Lv,!1,this),delete this.pq),e&&(this.qw=e.getState()),$h.g.ve.call(this,t),0===t.getState()&&(this.pq=!0,Cd(t,"
2statechange",this.Lv,!1,this)),this},$h.prototype.setIcon=$h.prototype.ve,$h.prototype.rt=function(t){return new Xh(t.svg,t)},$h.prototype.P=function(){var t=this.getIcon(),e=t.pD||0,i=$h.g.forWorkerMessage.call(this),r=i.properties.icon;return r&&0<e&&Oa(r,{stick_color:t.oD,stick_height:e}),i},$h.prototype.forWorkerMessage=$h.prototype.P,u(ai,Ah),t("H.map.Polyline",ai),ai.prototype.C=function(){return this.Gb.C()},ai.prototype.getBoundingBox=ai.prototype.C,ai.prototype.X=function(t){var e,i,r=this.X;if(B(t,kg)){var n=t.ha;if(!(e=n.length))throw new C(r,0);for(i=0;i<e;i++)bi(n[i],r)}else bi(t,r);return this.Uf=!!n,this.Gb=t,this.qa(Wg.SPATIAL),this},ai.prototype.setGeometry=ai.prototype.X,ai.prototype.V=function(){return this.Gb},ai.prototype.getGeometry=ai.prototype.V,ai.prototype.clip=function(t){var e=this.Gb;return Mf(this.Uf?e.ha[0]:e,t)},ai.prototype.clip=ai.prototype.clip,ai.prototype.xh=function(t){var e,i=this.Gb,r=[];if(this.Uf)for(e=(i=i.ha).length;e--;)ci(this,i[e],t,r);else ci(this,i,t,r);return r.length?r:A},ai.prototype.getGeometriesForTile=ai.prototype.xh,ai.prototype.P=function(){var t=ai.g.P.call(this),e=t.properties;return t.geometry=this.V().P(),e.style=this.K().P(),e.height=0,t},ai.prototype.forWorkerMessage=ai.prototype.P,u(gi,I),t("H.map.render.Style",gi),gi.prototype.load=gi.prototype.load,gi.prototype.getState=function(){return this.o},gi.prototype.getState=gi.prototype.getState,gi.prototype.F=function(t){this.o=t},gi.prototype.setState=gi.prototype.F,gi.prototype.Kc=function(){return this.kd},gi.prototype.getBaseUrl=gi.prototype.Kc,gi.prototype.Qd=function(){return Va(this.Ia)},gi.prototype.getConfig=gi.prototype.Qd,gi.prototype.Ez=function(){return this.Ia},gi.prototype.getConfigReference=gi.prototype.Ez,gi.prototype.Dg=function(t){this.Ia=t},gi.prototype.setConfig=gi.prototype.Dg,gi.prototype.Hc=function(t){this.Ia=null,this.F(hi.ERROR),this.bq(ii)?this.dispatchEvent(new de(ii,t,this)):console.error(t)},gi.prototype.dispatchError=gi.prototype.Hc,gi.prototype.disposeInternal=function(){gi.g.disposeInternal.call(this),this.Ia=null};var ii="error",ji={zf:"change",Hs:ii},hi={ERROR:-1,INIT:0,LOADING:1,READY:2};function ki(t,e){var i,r,n,o=arguments.length;for(i=1;i<o;i++)if((r=arguments[i])&&r!==t&&r!==s){var s=r;for(n in r){var a=r[n];t[n]!==a&&(li(a)?li(t[n])?t[n]=ki(t[n],a):t[n]=Va(a):void 0!==a&&(t[n]=Va(a)))}}return t}gi.State=hi,t("H.util.webgl.mergeObjects",ki);var mi=Ra();function ni(t,e,i){var r=i[t];return e&&r in e&&0>Xa.indexOf(r)?(e=e[r],++t<i.length?ni(t,e,i):e):mi}var oi=ni.bind(null,0),pi={polygons:1,lines:1,"pattern-lines":1,points:1,text:1,raster:1,custom_icons:1,overlays:1},qi={data:1,draw:1,enabled:1,filter:1,properties:1},ri=Object.keys(qi);function si(t,e,i,r,n,o){var s=r[t],a=i[s];if(++t<r.length){var l=e[s]||{};for(i=ri.length;i--;){var c=ri[i];if("draw"!==c||!o){var h=a[c];h!==A&&(l[c]=Va(h))}}si(t,l,a,r,n,o)}else n?l=Va(a):(l=a,delete i[s]);e[s]=e[s]?ki(e[s],l):l}var ti=si.bind(null,0);function ui(t,e){t in pi&&(e[t]=1)}function vi(t,e,i){var r,n,o;for(r in t)if(qi[r]){if("draw"===r){var s=t[r];for(n in s){var a=s[n];(o=a.style)?(a.style=e+o,ui(o,i)):(delete s[n],s[e+n]=a,ui(n,i))}}}else vi(t[r],e,i)}function wi(t,e){var i,r,n,o,s={};if(e+="_",i=(t=ki({},t)).styles)for(r in i){var a=i[r];if(delete i[r],i[e+r]=a,n=a.mix)for(eb(n)&&(n=[n]),o=n.length;o--;)ui(n[o],s),n[o]=e+n[o];(o=a.base)&&(n||(n=a.mix=[]),n.unshift(e+o),delete a.base,ui(o,s)),ui(r,s)}else i=t.styles={};if(a=t.layers)for(r in a)n=a[r],delete a[r],(o=n.data)&&!o.layer&&(o.layer=r),a[e+r]=n,vi(n,e,s);for(r in s)i[e+r]={base:r};return t}function xi(t,e){var i,r=t.sources,n=Object.keys(r)[0],o=ki(r[n],{uid:e});for(i in r=t.layers,t.sources={},t.sources[e]=o,r)(t=r[i]).data?t.data.source===n&&(t.data.source=e):t.data={source:e}}function yi(t,e){var i,r=t.textures;for(i in t=t.fonts,r){var n=r[i];n.url&&(n.url=ei(n.url,e))}for(i in t)if(db(n=t[i]))for(r=0;r<n.length;r++){var o=n[r];o.url=o.url&&ei(o.url,e)}else(o=n).url=o.url&&ei(o.url,e)}function zi(t,e){return"function(){return feature."+t+(e||"")+";}"}function Ai(t){return zi("style."+t,void 0)}function Bi(t,e,i,r){return t={base:t,blend:e,blend_order:i}
2,r&&(t.clean_depth=!!r),t}function Ci(t){var e={};return e["translucent-"+(t?"extruded-":"")+"polygons"]={color:Ai("fillColor"),order:1,interactive:!0,extrude:t},e}function Di(t,e,i,r){return t={data:{source:t,layer:e}},i&&(t.draw=i),r&&(t.filter=r),t}function li(t){return ya(t)&&!db(t)}function Ei(t,e){if(Ei.g.constructor.call(this,t,e),eb(t))Fi.test(t)&&-1===t.indexOf("import:")?(this.xc=t,e||(this.dB=fi(this.xc)?A:this.xc)):this.ro=t;else{if(!ya(t))throw new C(Ei,0,"invalid style configuration");this.Dg(Va(t))}}function Li(t){var e,i=t.Ia;if(ya(i)){var r;if(r=t.rs){for(var n in r=!1,i=i&&i.sources)if(i[n].type===t.rs){r=!0;break}r=!(!i||r)}r&&(e="invalid source, the only valid type is "+t.rs)}else e="invalid style configuration";return e&&t.Hc(e),!e}function Ji(t){t.dispatchEvent(new nd("change",t))}function Hi(t){if(t.getState()!==hi.READY)throw new vb(t.gk,"style is not ready yet")}function Ii(t,e,i,r){var n,o,s=[],a=db(e)?e:[e];for(void 0===r&&(r=!0),a=a.sort().reverse();n=a.pop();){e=String(n).split(".");for(var l=t.Ia,c=e.length;c--&&!qi[e[c]];);if(l&&0>c&&li(l=oi(l.layers,e))||(l=mi),l===mi)throw new C(i,0,'Unresolvable layer ID "'+n+'"');if(s.push({id:e,xb:l}),r)for(o in l)!qi[o]&&li(l[o])&&a.push(n+"."+o)}return s}function Ki(t,e){var i,r=0;for(i=e.length;r!==i;){var n=e[r++],o=t;if(!(t=o[n]))break}return r===i?{node:t,parent:o,Gn:n}:void 0}u(Ei,gi),t("H.map.render.webgl.Style",Ei),Ei.prototype.load=function(){var t=this,e=this.Kc();this.xc?(this.F(hi.LOADING),new Me("text/plain",this.xc).then(function(t){var i={};return Gi(t,e,!1,(i[e]=!0,i))}).then(function(e){return t.Dg(e)},function(e){return t.Hc(e.message)}),delete this.xc):this.ro&&(this.F(hi.LOADING),Gi(this.ro,e).then(function(e){return t.Dg(e)},function(e){return t.Hc(e.message)}),delete this.ro)},Ei.prototype.load=Ei.prototype.load,Ei.prototype.Zw=function(t,e,i){var r;for(Hi(this),t=Ii(this,t,this.Zw,i),i=0;i<t.length;i++){var n=t[i].xb.draw;for(r in n){var o=n[r];li(o)&&(o.interactive=!!e)}}Ji(this)},Ei.prototype.setInteractive=Ei.prototype.Zw,Ei.prototype.setProperty=function(t,e,i){var r,n=t.split("."),o=0,s=n.length;if(Hi(this),!Ya(e))throw new C(this.setProperty,1,"value");if(r=Ki(this.Ia,n)){if(!(r.parent instanceof Object)||r.parent instanceof Array){if(!i)throw new C(this.setProperty,0,t+" property is not primitive type");
2n.pop(),n=Ki(this.Ia,n),r.parent=n.parent[n.Gn]={}}r.parent[r.Gn]=e}else{for(r=this.Ia;o!==s-1;)r[n[o]]={},r=r[n[o++]];r[n[o]]=e}Li(this)&&Ji(this)},Ei.prototype.setProperty=Ei.prototype.setProperty,Ei.prototype.Pp=function(t){return Hi(this),(t=Ki(this.Ia,t.split(".")))?Va(t.node):void 0},Ei.prototype.getProperty=Ei.prototype.Pp,Ei.prototype.removeProperty=function(t){Hi(this),(t=Ki(this.Ia,t.split(".")))&&t.parent&&t.parent.hasOwnProperty(t.Gn)&&(delete t.parent[t.Gn],Li(this)&&Ji(this))},Ei.prototype.removeProperty=Ei.prototype.removeProperty,Ei.prototype.wj=function(t,e,i){var r;Hi(this);var n=this.Ia,o=n.layers,s=Ii(this,t,this.wj,!1);for(t=s.length,r={};t--;)ti(r,o,s[t].id,!!e,!!i);for(i={},t=(s=Object.keys(n)).length;t--;){var a=s[t],l=n[a];i[a]=l===o?r:Va(l)}return e||Ji(this),i},Ei.prototype.extractConfig=Ei.prototype.wj,Ei.prototype.gk=function(t){if(Hi(this),!ya(t))throw new C(this.gk,0,"config");this.Dg(ki(this.Ia,t))},Ei.prototype.mergeConfig=Ei.prototype.gk,Ei.prototype.Yb=ba(2),Ei.prototype.toString=function(){return this.getState()===hi.READY?globalThis.H.gl.yaml.dump(this.Ia,{lineWidth:120}):""},Ei.prototype.disposeInternal=function(){Ei.g.disposeInternal.call(this),delete this.ro,delete this.xc};var Fi=/^(http[s]?)?.*\.ya?ml/i;function Gi(t,e,i,r){i=void 0!==i&&i,r=void 0===r?{}:r;try{var n=globalThis.H.gl.yaml.load(t,{json:!0})}catch(t){return Promise.reject(t)}return n&&(eb(t=n.import)&&(t=[t]),i&&e&&Mi(n,e),delete n.import,db(t)&&t.length)?(i=t.reduce(function(t,i){var n=e?ei(i,e):i;return r[n]||(r[n]=!0,t.push(new Me("text/plain",n).then(function(t){return Gi(t,n,!0,r)}))),t},[]),Promise.all(i).then(function(t){var e={};return t.forEach(function(t){return t&&ki(e,t)}),ki(e,n),e})):Promise.resolve(n)}function Mi(t,e){function i(t){t.url&&(t.url=ei(t.url,e))}var r=t&&t.fonts;if(r)for(var n in r)db(r[n])?r[n].forEach(i):i(r[n]);if(t=t&&t.textures)for(var o in t)i(t[o])}function Ni(t,e){Ni.g.constructor.call(this,Fh,e),this.si(t)}function Oi(t,e,i){Oi.g.constructor.call(this,t),this.oldValue=i,this.newValue=e}Ei.normalize=Mi,Ei.prototype.Dg=function(t){Ei.g.Dg.call(this,t),Li(this)&&(this.F(hi.READY),Ji(this))},Ei.prototype.Qd=function(){return Ei.g.Qd.call(this)},Ei.prototype.getConfig=Ei.prototype.Qd,Ei.prototype.Kc=function(){return this.dB||Ei.g.Kc.call(this)},Ei.prototype.getBaseUrl=Ei.prototype.Kc,t("H.map.Style",Ei),Ei.State=hi,u(Ni,Eh),t("H.map.Rect",Ni),Ni.prototype.si=function(t){if(!B(t,J))throw new C(this.si,0,t);t.da(this.Ti)||(this.Ti=this.J=t,this.Gb!==x&&Ni.g.X.call(this,$f(t)))},Ni.prototype.setBoundingBox=Ni.prototype.si,Ni.prototype.C=function(){return this.J},Ni.prototype.getBoundingBox=Ni.prototype.C,Ni.prototype.X=function(){return this},Ni.prototype.setGeometry=Ni.prototype.X,Ni.prototype.V=function(){return this.Gb===Fh&&Ni.g.X.call(this,$f(this.Ti)),this.Gb},Ni.prototype.getGeometry=Ni.prototype.V,u(Oi,nd),t("H.util.ChangeEvent",Oi),t("H.util.constants.DEFAULT_MIN_ZOOM_LEVEL",0),t("H.util.constants.DEFAULT_MAX_ZOOM_LEVEL",22);var Pi={FEATURE:1,SOURCE:2,PROVIDER:3};t("H.map.provider.PickingMode",Pi);var Qi={PROVIDES_BY_VIEWPORT:1,PROVIDES_RASTERS:2,PROVIDES_SPATIALS:4,PROVIDES_OVERLAYS:8,PROVIDES_MARKERS:16,PROVIDES_DOM_MARKERS:32,PROVIDES_GEOJSON:64,PRO
2VIDES_OMV:128,CROP_LINES_BY_TILE:256,CROP_POLYGONS_BY_TILE:512,HAS_VOLATILE_DATA:1024};function Ri(t,e,i){this.Da=t,this.uid=e,this.opacity=i,this.an=this.Da&Qi.PROVIDES_BY_VIEWPORT?"function(){return sources[$source].isInMinMaxRange(feature, $zoom) && feature.ref.effectiveVisibility;}":A,this.ag={}}function Si(t){this.Da=t}function Ti(t,e,i,r,n){this.Da=t,this.uid=e,this.Av=i,this.Kq=r,this.tileSize=n}function Ui(t,e,i,r){return t={type:e,uid:t.uid,tiled:i,max_zoom:t.Kq},r&&Oa(t,r),t}function Vi(t,e,i,r,n,o){this.Da=t,this.uid=e,this.Av=i,this.Kq=r,this.opacity=n,this.tileSize=o}function R(t){var e,i=""+se();if(R.g.constructor.call(this),t=t||{},this.min=t.min||0,this.max=t.max||22,e=t.uri){if(/_/.test(e))throw new C(R,0,"uri "+e)}else e=i;if(this.uri=e||i,this.uid=i,t.getCopyrights&&ab(t.getCopyrights,"Function",R)&&(this.getCopyrights=t.getCopyrights),this.Db=this.Db.bind(this),this.kq=!0,this.jb=t.engineType||Wi,this.jb===Xi.HARP&&!H.map.render.harp)throw new C(R,0,"HARP engine is not supported, module not found")}function Yi(t){if(t.jb===Xi.WEBGL){var e=new Vi(t.getCapabilities(),t.uid,t.min,t.max,t.Rc,t.tileSize);t.Xa=new Ei(e.Je())}else t.jb===Xi.HARP&&H.map.render.harp&&(t.Xa=new H.map.render.harp.Style({}));t.kq=!0}function Zi(){}function $i(t){return xb(1,yb(0,.5-Db(Kb(Qb+Pb*t/180))/Ob/2))}function aj(t){return 0>=t?90:1<=t?-90:Ub*(2*Lb(Gb(Ob*(1-2*t)))-Pb)}t("H.map.provider.Capabilities",Qi),Qi.PROVIDES_WEBGL_RENDERABLE_OBJECTS=Qi.PROVIDES_SPATIALS|Qi.PROVIDES_OVERLAYS|Qi.PROVIDES_MARKERS,Ri.prototype.Je=function(){if(this.Da&Qi.PROVIDES_RASTERS&&(this.ag["tile_layer_"+this.uid]=Di(this.uid,"_default",{"translucent-raster":{color:[1,1,1,this.opacity],order:0}})),this.Da&Qi.PROVIDES_SPATIALS){var t={"translucent-pattern-lines":{color:Ai("strokeColor"),width:Ai("lineWidth * $meters_per_pixel"),join:Ai("lineJoin"),cap:Ai("lineCap"),tail_cap:Ai("lineTailCap"),head_cap:Ai("lineHeadCap"),miter_limit:Ai("miterLimit"),order:"function() { return 2 + feature.effectiveZIdx / 2; }",interactive:!0,dash:Ai("lineDash"),extrude:!0,dash_phase:Ai("lineDashOffset")}},e=this.ag,i="polygon_layer_"+this.uid,r=Di(this.uid,"polygons",void 0,this.an);r.flat={filter:"function(){return !feature.height && !feature.min_height;}",draw:Ci(!1)},r.extruded={filter:"function(){return feature.height || feature.min_height;}",draw:Ci(!0)},e[i]=r,this.ag["outline_layer_"+this.uid]=Di(this.uid,"outlines",t,this.an),this.ag["polyline_layer_"+this.uid]=Di(this.uid,"polylines",t,this.an)}return this.Da&Qi.PROVIDES_OVERLAYS&&(this.ag["overlay_layer_"+this.uid]=Di(this.uid,"overlays",{"translucent-overlays":{color:[1,1,1,this.opacity],order:8190,interactive:!0}})),this.Da&Qi.PROVIDES_MARKERS&&(this.ag["marker_layer_"+this.uid]=Di(this.uid,"markers",{markers:{sprite:zi("icon.id"),offset:zi("icon.offset"),collide:!1,priority:8191,elevate_by_altitude:!0,interactive:!0,stick:{color:zi("icon.stick_color"),height:zi("icon.stick_height")}}},this.an)),this.ag},Si.prototype.Je=function(){var t={};if(this.Da&Qi.PROVIDES_RASTERS&&(t={"translucent-raster":Bi("raster","inlay",1)}),this.Da&Qi.PROVIDES_WEBGL_RENDERABLE_OBJECTS){var e=!!(this.Da&Qi.CROP_LINES_BY_TILE),i={"translucent-polygons":Bi("polygons","inlay",2),"translucent-extruded-polygons":Bi("polygons","translucent",3),"translucent-pattern-lines":Bi("pattern-lines","translucent",4),"translucent-overlays":Bi("overlays","inlay",5),markers:Bi("custom_icons","overlay",6,!1)};i["translucent-polygons"].crop_by_tile=!!(this.Da&Qi.CROP_POLYGONS_BY_TILE),i["translucent-pattern-lines"].crop_by_tile=e,i.markers.suppress_fade=!0,i.markers.stick=!0,Oa(t,i)}return t},Ti.prototype.Je=function(){var t={};return t[this.uid]=this.Da&Qi.PROVIDES_BY_VIEWPORT?Ui(this,"ObjectSource",!1,{progressiveUpdate:!0,has_volatile_data:!!(this.Da&Qi.HAS_VOLATILE_DATA)}):this.Da&Qi.PROVIDES_RASTERS?Ui(this,"RemoteRasterTileSource",!0,{url:""}):Ui(this,"ObjectTileSource",!0,{tile_size:this.tileSize}),t},Vi.prototype.Je=function(){if(this.Da&Qi.PROVIDES_DOM_MARKERS&&!(this.Da&Qi.PROVIDES_MARKERS))return{};var t=new Ti(this.Da,this.uid,this.Av,this.Kq,this.tileSize),e=new Si(this.Da),i=new Ri(this.Da,this.uid,this.opacity);return{sources:t=t.Je(),styles:e=e.Je(),layers:i=i.Je()}},u(R,I),t("H.map.provider.Provider",R),m=R.prototype,m.j={Li:"configchange",Ca:"update"},m.hb=function(t,e){this.dispatchEvent(new $d(this.j.Ca,e,t))},m.Db=function(t){t=new Oi(this.j.Li,t&&t.newValue,t&&t.oldValue),this.dispatchEvent(t)},m.disposeInternal=function(){I.prototype.disposeInternal.call(this),this.Xa&&
2(this.Xa.removeEventListener("change",this.Db),this.Xa.l(),delete this.Xa)},m.U=function(){return null},R.prototype.getCopyrights=R.prototype.U,R.prototype.getCapabilities=function(){var t=0;return this.qr()&&(t|=Qi.PROVIDES_BY_VIEWPORT),this.providesRasters()&&(t|=Qi.PROVIDES_RASTERS),this.providesSpatials()&&(t|=Qi.PROVIDES_SPATIALS),this.providesOverlays()&&(t|=Qi.PROVIDES_OVERLAYS),this.providesMarkers()&&(t|=Qi.PROVIDES_MARKERS),this.providesDomMarkers()&&(t|=Qi.PROVIDES_DOM_MARKERS),this.providesGeoJSON()&&(t|=Qi.PROVIDES_GEOJSON),this.providesOMV()&&(t|=Qi.PROVIDES_OMV),t},R.prototype.getCapabilities=R.prototype.getCapabilities,R.prototype.qr=ue,R.prototype.Ak=ue,R.prototype.providesRasters=R.prototype.Ak,R.prototype.me=ue,R.prototype.providesSpatials=R.prototype.me,R.prototype.sr=ue,R.prototype.providesOverlays=R.prototype.sr,R.prototype.Vc=ue,R.prototype.providesMarkers=R.prototype.Vc,R.prototype.Uc=ue,R.prototype.providesDomMarkers=R.prototype.Uc,R.prototype.rr=ue,R.prototype.providesGeoJSON=R.prototype.rr,R.prototype.Wc=ue,R.prototype.providesOMV=R.prototype.Wc,R.prototype.Oz=function(){return this.jb},R.prototype.getEngineType=R.prototype.Oz,R.prototype.bD=function(t){this.jb=t},R.prototype.setEngineType=R.prototype.bD,R.prototype.yk=ve,R.prototype.preprocessData=R.prototype.yk,R.prototype.Rc=1,R.prototype.Eg=function(t){t=$b(t,0,1),E(t)&&(t=1),this.Rc!==t&&(this.Rc=t,this.kq&&Yi(this),this.jb===Xi.WEBGL&&this.Db(),this.hb())},R.prototype.oA=function(){return this.Rc},R.prototype.getOpacityInternal=R.prototype.oA,R.prototype.Wa=function(t,e){var i=this;if(this.jb===Xi.WEBGL&&!B(t,Ei)||this.jb===Xi.HARP&&!B(t,H.map.render.harp.Style))throw t=Object.entries(Xi).find(function(t){return t[1]===i.jb}),new C(this.Wa,0,"Invalid style for engineType "+t);this.Xa&&(this.Xa.removeEventListener("change",this.Db),this.Xa.removeEventListener(ii,this.Db),this.Xa.l()),this.Xa=t,this.Xa.addEventListener("change",this.Db),this.Xa.addEventListener(ii,this.Db),e||this.Db(),this.kq=!1},R.prototype.setStyleInternal=R.prototype.Wa,R.prototype.lb=function(){return this.Xa||Yi(this),this.Xa},R.prototype.getStyleInternal=R.prototype.lb,R.prototype.pu=function(){var t=this.getCapabilities(),e=Pi.FEATURE;return t&Qi.PROVIDES_BY_VIEWPORT?e=Pi.SOURCE:t&Qi.PROVIDES_RASTERS?e=null:t&Qi.PROVIDES_WEBGL_RENDERABLE_OBJECTS&&(e=Pi.PROVIDER),e},R.prototype.getPickingMode=R.prototype.pu,R.prototype.Tz=function(){return!1},R.prototype.getFeatureProxy=R.prototype.Tz,Zi.prototype.Tm=function(t,e,i){return i?(i.x=e/360+.5,i.y=$i(t)):i=new F(e/360+.5,$i(t)),i},Zi.prototype.latLngToPoint=Zi.prototype.Tm,Zi.prototype.Re=function(t,e){return this.Tm(t.lat,t.lng,e)},Zi.prototype.geoToPoint=Zi.prototype.Re,Zi.prototype.Ya=function(t,e,i){return i?(i.lat=aj(e),i.lng=360*(1===t?1:Yb(t,1))-180):i=new Ye(aj(e),360*(1===t?1:Yb(t,1))-180),i},Zi.prototype.xyToGeo=Zi.prototype.Ya,Zi.prototype.yn=function(t,e){return this.Ya(t.x,t.y,e)},Zi.prototype.pointToGeo=Zi.prototype.yn;var bj=new Zi;function cj(t,e){this.projection=t||bj,this.Ii=0,this.kl=this.exp=Db(e||256)/Nb,dj(this),this.y=this.x=0}t("H.geo.mercator",bj),t("H.geo.PixelProjection",cj);var ej=Cb(24)+Cb(-8);function dj(t){t.kl>ej&&(t.kl=ej),t.w=Fb(2,t.kl),t.h=Fb(2,t.kl)}function fj(t){t=t||{},fj.g.constructor.call(this),this.min=0,this.max=22,this.Py=this.dark=!!t.dark,t.min&&this.Tr(t.min),t.max&&this.Rr(t.max),this.pixelProjection=new cj(t.projection,t.minWorldSize),t.provider&&(this.D=t.provider,this.hb=z(this.hb,this),this.D.addEventListener(R.prototype.j.Ca,this.hb,!1,this),this.Db=z(this.Db,this),this.D.addEventListener(R.prototype.j.Li,this.Db,!1,this))}function gj(t,e,i){var r=t[e],n="min"===e,o=n?t.Tr:t.Rr;if(i!==r){if(!(n?i<=t.max:i>=t.min))throw new C(o,0,"Invalid condition min <= max");t[e]=i,t.hb(),t.Db(),t.dispatchEvent(new Oi(n?t.j.Os:t.j.Ns,i,r))}return t}function hj(t,e){if(e=e||{},!t)throw new C(hj,0,t);this.tileSize=t.tileSize,this.xx={},fj.call(this,{min:void 0!==e.min?e.min:t.min,max:void 0!==e.max?e.max:t.max,minWorldSize:this.tileSize,projection:e.Fn,dark:e.dark,provider:t})}
2function ij(t,e,i,r,n){r=Ab(r);var o=Fb(2,r),s=e.left,a=e.top,l=e.right;i=l+(i?o+(l===e.left?0:1):1);var c=e.bottom,h=[];if(n)var u=s+(1+l-s)/2+n.x/t.tileSize-.5,p=a+(1+c-a)/2+n.y/t.tileSize-.5;for(;s<i;){for(a=e.top;a<=c;)t=s%o,h.push([t,a,r,n?Cb(u-s)+Cb(p-a):0]),a++;s++}return h}function jj(t,e){return e[3]-t[3]}function kj(t,e){kj.g.constructor.call(this,t,e)}cj.prototype.Fn=bj,cj.prototype.projection=cj.prototype.Fn,cj.prototype.x=0,cj.prototype.x=cj.prototype.x,cj.prototype.y=0,cj.prototype.y=cj.prototype.y,cj.prototype.w=Fb(2,ej),cj.prototype.w=cj.prototype.w,cj.prototype.WA=Fb(2,ej),cj.prototype.h=cj.prototype.WA,cj.prototype.Ua=function(t){if(E(t))throw new C(this.Ua,0,t);var e=this.x/this.w,i=this.y/this.h;this.Ii=t,this.kl=this.exp+t,dj(this),this.x=e*this.w,this.y=i*this.h},cj.prototype.rescale=cj.prototype.Ua,cj.prototype.vu=function(){return this.Ii||0},cj.prototype.getZoomScale=cj.prototype.vu,cj.prototype.Fb=function(t,e){return(t=this.projection.Tm(t.lat,t.lng,e)).x=t.x*this.w-this.x,t.y=t.y*this.h-this.y,t},cj.prototype.geoToPixel=cj.prototype.Fb,cj.prototype.tk=function(t,e){return this.projection.Ya((t.x+this.x)/this.w,(t.y+this.y)/this.h,e)},cj.prototype.pixelToGeo=cj.prototype.tk,cj.prototype.Ya=function(t,e,i){return this.projection.Ya((t+this.x)/this.w,(e+this.y)/this.h,i)},cj.prototype.xyToGeo=cj.prototype.Ya,cj.prototype.vq=function(t,e,i){return(t=this.projection.Tm(t,e,i)).x=t.x*this.w-this.x,t.y=t.y*this.h-this.y,t},cj.prototype.latLngToPixel=cj.prototype.vq,cj.prototype.bi=function(t){return new F(t.x*this.w-this.x,t.y*this.h-this.y)},cj.prototype.pointToPixel=cj.prototype.bi,u(fj,I),t("H.map.layer.Layer",fj),fj.prototype.min=0,fj.prototype.min=fj.prototype.min,fj.prototype.max=22,fj.prototype.max=fj.prototype.max,fj.prototype.j={Ca:"update",Li:"configchange",Os:"minchange",Ns:"maxchange"},fj.prototype.Qp=function(){return this.D},fj.prototype.getProvider=fj.prototype.Qp,fj.prototype.kB=function(t){return this.min<=t&&t<=this.max},fj.prototype.isValid=fj.prototype.kB,fj.prototype.Tr=function(t){return gj(this,"min",+t)},fj.prototype.setMin=fj.prototype.Tr,fj.prototype.Rr=function(t){return gj(this,"max",+t)},fj.prototype.setMax=fj.prototype.Rr,fj.prototype.hb=function(){this.dispatchEvent(this.j.Ca)},fj.prototype.Db=function(t){t=new Oi(this.j.Li,t&&t.newValue,t&&t.oldValue),this.dispatchEvent(t)},fj.prototype.disposeInternal=function(){fj.g.disposeInternal.call(this)},fj.prototype.U=function(){return null},fj.prototype.getCopyrights=fj.prototype.U,u(hj,fj),t("H.map.layer.BaseTileLayer",hj),hj.prototype.Cj=function(t,e){var i=this.pixelProjection;if(!B(t,J))throw new C(this.Cj,0,t);if(!E(e)){var r=i.vu();i.Ua(e)}return t=kh(i.Fb(t.Nc()),i.Fb(t.Lc())),!E(r)&&i.Ua(r),t},hj.prototype.geoRectToRect=hj.prototype.Cj,hj.prototype.Fh=function(t,e){var i=Fb(2,Ab(e)),r=this.tileSize;if(!B(t,jh))throw new C(this.Fh,0,t);if(E(e=+e))throw new C(this.Fh,1,e);(e=Ab(t.left/r))===i&&--e;var n=Ab(t.right/r);return n===i&&--n,new jh(e,$b(Ab(t.top/r),0,i-1),n,$b(Ab(t.bottom/r),0,i-1))},hj.prototype.getTileBounds=hj.prototype.Fh,hj.prototype.Pa=function(t,e,i,r){return this.D.requestTile(t,e,i,r)},hj.prototype.requestTile=hj.prototype.Pa,hj.prototype.Ld=function(t,e,i){this.D.cancelTile(t,e,i)},hj.prototype.cancelTile=hj.prototype.Ld,hj.prototype.U=function(t,e){return this.D.getCopyrights?this.D.getCopyrights(t,e):null},hj.prototype.getCopyrights=hj.prototype.U,hj.prototype.Pj=function(t,e,i,r,n,o){var s,a,l=[],c=this.D;o=null!=o?o:"__default__";var h=c.requestTile;if(!B(t,jh))throw new C(this.Pj,0,t);if(E(i=+i))throw new C(this.Pj,1,i);if(r||(s={}),t=(e=ij(this,t,e,i,n)).length)for(r||e.sort(jj),i=t;i--;)n=e[i],r||(s[c.Td.apply(c,n)]=!0),n[3]=+r,(a=h.apply(c,n))&&l.push(a);if(!r){var u;for(u in r=s,s=this.xx[o]||{})s.hasOwnProperty(u)&&s[u]&&!r[u]&&this.D.cancelTileByKey(u);this.xx[o]=r}return{total:t,tiles:l}},hj.prototype.getProviderTiles=hj.prototype.Pj,u(kj,hj),t("H.map.layer.MarkerTileLayer",kj);var lj={markers:[],total:0,requested:0};function mj(t,e,i,r,n){var o,s=Ab(i);for(t.pixelProjection.Ua(s),e=t.Fh(t.Cj(e),s),i=t.Pj(e,e.left>e.right,~~i,r,n),t=i.tiles,i=i.total,r=t.length,n=[],o=0;o<r;o++)for(s=(e=t[o]).data.length;s--;)n.push(e.data[s]);return{markers:n,total:t.length,requested:i}}
2function nj(t,e,i,r){nj.g.constructor.call(this),this.ld=t,this.ja=r,this.element=t.appendChild(this.createElement(t.ownerDocument)),this.Vk(e,i)}function oj(t,e){var i=e||{},r=i.contextType;if(i=i.contextAttributes,oj.g.constructor.call(this,e),ab(t,"Function",oj,0,"invalid render callback"),r){if(-1===pj.indexOf(r))throw new C(oj,1,"invalid context type");this.jj=r}i&&(this.ij=i),this.Ar=t}kj.prototype.pe=function(t,e,i,r){return this.D.providesDomMarkers()?lj:mj(this,t,e,i,r)},kj.prototype.requestMarkers=kj.prototype.pe,kj.prototype.oe=function(t,e,i,r){return this.D.providesDomMarkers()?mj(this,t,e,i,r):lj},kj.prototype.requestDomMarkers=kj.prototype.oe,t("H.util.Disposable",kd),kd.prototype.bc=kd.prototype.bc,kd.prototype.addOnDisposeCallback=kd.prototype.bc,t("H.util.dispose",jd),kd.prototype.l=kd.prototype.l,kd.prototype.dispose=kd.prototype.l,kd.prototype.disposeInternal=kd.prototype.disposeInternal,kd.prototype.disposeInternal=kd.prototype.disposeInternal,u(nj,kd),nj.prototype.B=function(){return this.element},nj.prototype.Vk=function(t,e){this.size?(this.size.w=t,this.size.h=e):this.size=new ch(t,e),this.bx(this.element,this.element.style,t,e,this.ja)},nj.prototype.setSize=nj.prototype.Vk,m=nj.prototype,m.mc=function(){return this.size},m.kb=function(){return this.ja},m.Xu=!0,m.Zb=function(t){t!==this.Xu&&(this.element.style.display=t?"block":"none",this.Xu=t)},m.opacity=1,m.Dd=function(t){this.opacity!==t&&(this.Eg(t),this.opacity=t)},m.Ue=function(){return this.opacity},m.ui=function(t){this.element.style.zIndex=t},nj.prototype.setZIndex=nj.prototype.ui,nj.prototype.uu=function(){return+this.element.style.zIndex},nj.prototype.Qe=function(){},nj.prototype.clear=function(){},nj.prototype.disposeInternal=function(){this.clear(),this.ld.removeChild(this.element),this.Vk(0,0),delete this.element,delete this.ld,nj.g.disposeInternal.call(this)},nj.prototype.disposeInternal=nj.prototype.disposeInternal,nj.prototype.Bw=0,nj.prototype.Un=function(){++this.Bw},nj.prototype.release=function(){--this.Bw||this.l()},u(oj,fj),t("H.map.layer.CanvasLayer",oj);var pj=["2d","webgl","webgl2","experimental-webgl"];function qj(t,e){qj.g.constructor.call(this,e),ab(t,"Function",qj,0,"invalid render callback"),this.Ar=t}function rj(t,e){var i=this;if(!Wa(e))throw new C(rj,1,e);if(!Wa(t.next||Wa(t.cycle)))throw new C(rj,2,'Argument "mode" must implement H.util.AsyncQueue.Mode');this.Bk=[],this.vw=[],this.NB=t,this.process=e,this.zC=function(){sj(i)},this.nr=null,this.Pw=function(){i.nr||(i.nr=globalThis.setTimeout(i.zC,1))}}function sj(t){var e=t.vw,i=0,r=t.NB;for(r.vt(),t.nr=null;i<e.length;){var n=e[i];n.Tu?e.splice(i,1):i++}for(;n=r.next(t.Bk,t.vw);)n.cancelled?n.done(null,"cancelled"):(e.push(n),t.process(n,n.data))}function uj(){tj(this,null,null,null)}function tj(t,e,i,r){return t.data=e,t.cancelled=!1,t.Tu=!1,t.XB=i,t.YB=r,t.So=null,t}function vj(){}m=oj.prototype,m.jj="2d",m.uh=function(){return this.jj},m.getContextAttributes=function(){return this.ij},m.L=function(t,e){return this.Tl&&this.Tl.canvas===t||(this.Tl=t.getContext(this.jj,this.ij)),this.Ar(this.Tl,e)},m.disposeInternal=function(){oj.g.disposeInternal.call(this),delete this.Tl},u(qj,fj),t("H.map.layer.DomLayer",qj),qj.prototype.L=function(t,e){return this.Ar(t,e)},t("H.util.AsyncQueue",rj),rj.prototype.push=function(t,e){if(!Wa(e))throw new C(this.push,1,e);return t=tj(new uj,t,this.Pw,e),this.Bk.push(t),this.Pw(),t},rj.prototype.push=rj.prototype.push,rj.prototype.Cn=function(){sj(this)},rj.Task=uj,uj.prototype.done=function(t,e){this.Tu=!0,this.XB(),this.YB(this,t,e)},uj.prototype.done=uj.prototype.done,uj.prototype.cancel=function(){this.So&&this.So(),this.cancelled=!0},uj.prototype.cancel=uj.prototype.cancel,uj.prototype.aD=function(t){return this.So=t,this},uj.prototype.setCancelFn=uj.prototype.aD,rj.Mode=vj,vj.prototype.next=function(){},vj.prototype.vt=function(){};var wj,xj=function(){function t(){}for(var e,i,r,n=globalThis,o=Sa("o ms moz webkit ").split(void 0!==A?void 0:" "),s=5;s--&&!e;)e=o[s],e=(i=n[e+(e?"R":"r")+"equestAnimationFrame"])&&!E(i.call(window,t))&&(r=n[e
2+(e?"C":"c")+"ancelAnimationFrame"]);return wj=e?function(t){return i.call(n,t)}:function(t){return n.setTimeout(t,25)},e?function(t){return r.call(n,t)}:function(t){return n.clearTimeout(t)}}(),yj=globalThis.performance&&globalThis.performance.now?function(){return globalThis.performance.now()}:function(){return globalThis.Date.now()};function zj(t,e){zj.g.constructor.call(this,new Aj(t),e)}function Aj(t){if(isNaN(t)||0>t)throw new C(zj,1,'Argument "maxTime" must be a positive number');this.GB=t,this.al=yj()}function Bj(t,e,i,r){Bj.g.constructor.call(this,t,e,i),this.modifiers=r}u(zj,rj),t("H.util.SequentialQueue",zj),Aj.prototype.next=function(t){return t.length&&yj()-this.al<this.GB?t=t.shift():null},Aj.prototype.vt=function(){this.al=yj()},u(Bj,Oi),t("H.map.ChangeEvent",Bj);var Cj={SIZE:1,POSITION:2,HEADING:4,TILT:8,INCLINE:16,ZOOM:32,BOUNDS:64};function Dj(t,e){Wa(t)&&(this.Xv=t),hb(e)&&(this.nl=e)}Bj.Type=Cj,Bj.prototype.hy=Cj.SIZE,Bj.prototype.SIZE=Bj.prototype.hy,Bj.prototype.Qs=Cj.POSITION,Bj.prototype.POSITION=Bj.prototype.Qs,Bj.prototype.Is=Cj.HEADING,Bj.prototype.HEADING=Bj.prototype.Is,Bj.prototype.Ts=Cj.TILT,Bj.prototype.TILT=Bj.prototype.Ts,Bj.prototype.Js=Cj.INCLINE,Bj.prototype.INCLINE=Bj.prototype.Js,Bj.prototype.Us=Cj.ZOOM,Bj.prototype.ZOOM=Bj.prototype.Us,Bj.prototype.Cs=Cj.BOUNDS,Bj.prototype.BOUNDS=Bj.prototype.Cs,t("H.util.Request",Dj),Dj.State={PENDING:0,PROCESSING:1,COMPLETE:2,CANCELLED:3,ERROR:4};var Ej=[0,1,2,3,4];function Fj(t,e){t.Dn<t.nl&&(Ya(e)||(e=2),0===e||1===e||0!==t.o&&1!==t.o||(t.Dn++,2!==e&&t.Tt++,t.F(t.Dn<t.nl?1:2)))}function Gj(t,e,i,r,n,o){var s;for(s=[];r<=n;r++){var a=s.concat,l=t,c=i,h=Ab(r);l.pixelProjection.Ua(h);var u=l.Cj(c);c=l.Fh(u,h),h=ij(l,c,u.left>u.right,h),s=a.call(s,h)}for(t=s.length,Dj.call(this,o,t),this.ox=i=[],this.Zq=z(this.Zq,this),this.Yq=z(this.Yq,this),this.F(1);t--;)o=s[t],i.push(Hj(e,o[0],o[1],o[2],this.Zq,this.Yq))}function Ij(t){if(Za(this,Ij),Ij.g.constructor.call(this,t),t&&"tileSize"in t){var e=Db(+t.tileSize)/Nb;if(isNaN(e)||e%1||0>e||30<e)throw new C(Ij,0,"tileSize: "+t.tileSize);this.tileSize=+t.tileSize}}function Jj(t,e){return Xb(t)-8-zb(Xb(e))}function Kj(){}function Lj(t,e,i){if(this.nk=[],e&&this.fi(e),i&&!Wa(i))throw new C(Lj,2,i);this.Ne=0,this.filter=i,this.aa={},this.bk=this.ph=null,this.Sr(t)}function Nj(t,e){return e&&(t.ph=Oj(t,e,t.ph)),e}function Pj(t){for(;t.Ne>t.uv&&t.bk;)t.nf(t.bk,!0)}function Oj(t,e,i){return i!==e&&((e.yd||e.lf)&&t.nf(e,!1),(e.yd=i)&&(e.lf=i.lf,i.lf=e),e.lf||(t.ph=e),e.yd||(t.bk=e),t.Ne+=e.size),e}function Mj(t,e){for(var i=t.nk.length;i--;)t.nk[i].call(t,e.id,e.data,e.size)}function Qj(t,e,i,r){this.key="",this.x=t,this.y=e,this.z=i,this.data=r,this.valid=!0}function S(t){Za(this,S),S.g.constructor.call(this,t),this.sD=new Rj,this.cc=z(this.cc,this),this.ht=Sj,this.createTileInternal=this.nd.bind(this)}Dj.prototype.o=0,Dj.prototype.getState=function(){return this.o},Dj.prototype.getState=Dj.prototype.getState,Dj.prototype.F=function(t){if(0>Ej.indexOf(t))throw new C(this.F,0,t);(this.o!==t||1===t&&1<this.nl)&&(this.o=t,this.Xv&&this.Xv(this))},Dj.prototype.nl=1,Dj.prototype.NA=function(){return this.nl},Dj.prototype.getTotal=Dj.prototype.NA,Dj.prototype.Dn=0,Dj.prototype.yA=function(){return this.Dn},Dj.prototype.getProcessed=Dj.prototype.yA,Dj.prototype.Tt=0,Dj.prototype.Sz=function(){return this.Tt},Dj.prototype.getFailed=Dj.prototype.Sz,Dj.prototype.Xi=function(){},Dj.prototype.cancel=function(){3!==this.o&&(this.Xi(),this.F(3))},Dj.prototype.cancel=Dj.prototype.cancel,u(Gj,Dj),Gj.prototype.Zq=function(){Fj(this,2)},Gj.prototype.Yq=function(){Fj(this,4)},Gj.prototype.Xi=function(){for(var t=this.ox,e=t.length;e--;)t[e].cancel();delete this.ox},u(Ij,R),t("H.map.provider.TileProvider",Ij),Ij.getZoomLevelOffset=Jj,Ij.prototype.requestTile=Ij.prototype.Pa,Ij.prototype.cancelTile=Ij.prototype.Ld,Ij.prototype.cancelTileByKey=Ij.prototype.Yi,Ij.prototype.createTileInternal=Ij.prototype.nd,Ij.prototype.Td=function(t,e,i){return this.uri.concat("_",t,"_",e,"_",i)},Ij.prototype.getTileKey=Ij.prototype.Td,Ij.prototype.tileSize=256,Ij.prototype.tileSize=Ij.prototype.tileSize,t("H.util.ICache",Kj),Kj.prototype.add=function(){},Kj.prototype.add=Kj.prototype.add,Kj.prototype.get=function(){},Kj.prototype.get=Kj.prototype.get,Kj.prototype.dm=function(){},Kj.prototype.drop=Kj.prototype.dm,Kj.prototype.forEach=function(){},Kj.prototype.forEach=Kj.prototype.forEach,Kj.prototype.ia=function(){},Kj.prototype.removeAll=Kj.prototype.ia,Kj.prototype.fi=function(){},Kj.prototype.registerOnDrop=Kj.prototype.fi,Kj.prototype.ip=function(){},Kj.prototype.deRegisterOnDrop=Kj.prototype.ip,t("H.util.Cache",Lj),Lj.prototype.add=function(t,e,
2i){var r,n;if(!hb(i=+i)||0>i)throw new C(this.add,2,i);return t=String(t),(n=!this.filter||this.filter(t,e,i))&&((r=this.aa[t])?(r.data!==e&&Mj(this,r),this.Ne+=i-r.size,r.size=i,r.data=e,Nj(this,r)):this.aa[t]=Oj(this,{id:t,data:e,size:i,yd:null,lf:null},this.ph),Pj(this)),n},Lj.prototype.add=Lj.prototype.add,Lj.prototype.fi=function(t){if(!Wa(t))throw new C(this.fi,0,t);this.nk.push(t)},Lj.prototype.registerOnDrop=Lj.prototype.fi,Lj.prototype.ip=function(t){this.nk=this.nk.filter(function(e){return e!==t})},Lj.prototype.deRegisterOnDrop=Lj.prototype.ip,Lj.prototype.get=function(t,e){return(t=e?this.aa[t]:Nj(this,this.aa[t]))&&t.data},Lj.prototype.get=Lj.prototype.get,Lj.prototype.dm=function(t){var e;(e=this.aa[t])&&this.nf(e,!0)},Lj.prototype.drop=Lj.prototype.dm,Lj.prototype.forEach=function(t,e,i){var r;for(r in this.aa){var n=this.aa[r];(!i||i(r,n.data,n.size))&&t.call(e,r,n.data,n.size)}},Lj.prototype.forEach=Lj.prototype.forEach,Lj.prototype.ia=function(t){var e;for(e in this.aa){var i=this.aa[e];(!t||t(e,i.data,i.size))&&this.nf(this.aa[e],!0)}},Lj.prototype.removeAll=Lj.prototype.ia,Lj.prototype.Sr=function(t){if(!(0<+t))throw new C(Lj.prototype.Sr,0,t);return this.uv=+t,Pj(this),this},Lj.prototype.setMaxSize=Lj.prototype.Sr,Lj.prototype.lA=function(){return this.uv},Lj.prototype.getMaxSize=Lj.prototype.lA,Lj.prototype.Iz=function(){return this.Ne},Lj.prototype.getCurrentSize=Lj.prototype.Iz,Lj.prototype.nf=function(t,e){var i=t.lf,r=t.yd;return(i||r||t==this.ph&&t==this.bk)&&(i?i.yd=r:this.ph=r,r?r.lf=i:this.bk=i,this.Ne-=t.size,e&&(delete this.aa[t.id],Mj(this,t))),t.yd=t.lf=null,t},t("H.map.provider.Tile",Qj),u(S,Ij),t("H.map.provider.RemoteTileProvider",S),S.prototype.Pz=function(){return 1},S.prototype.getEntryWeight=S.prototype.Pz;var Sj,Tj=screen.width,Uj=screen.height,Vj=he();Vj=yb(Vj,1);var Wj=Bb(Tj*Vj*Uj*Vj/1e6);Sj=new Lj(Fb(2,yb(8,xb(12,7+Wj))));var Xj={},Yj={};function Hj(t,e,i,r,n,o){return r=~~r,t.requestInternal(e,i,r,function(s,a){t.rd().put(t.Td(e,i,r),{raw:a&&a.raw||s,timestamp:globalThis.Date.now()},n,o)},o,0)}function ak(t){delete Xj[t],delete Yj[t]}function Zj(t){for(var e in Xj)t.cc(e)&&t.cancelTileByKey(e)}S.prototype.Rb=function(){return this.ht},S.prototype.getCache=S.prototype.Rb,S.prototype.$n=ba(3),S.prototype.cc=function(t){var e=this.uri;return!t.indexOf(e)&&"_"===t.charAt(e.length)},S.prototype.cacheFilter=S.prototype.cc,S.prototype.fB=function(t,e){e.valid=!1},S.prototype.reload=function(t){var e=this.getCache();t?e.ia(this.cc):e.forEach(this.fB,this,this.cc),Zj(this),this.hb(this,{isReload:!0})},S.prototype.reload=S.prototype.reload,S.prototype.Wi=function(){return!1},S.prototype.MAX_STORE_TIME=1/0,S.prototype.rd=function(){return this.sD},S.prototype.tw=function(t,e){e(t)},S.prototype.requestInternal=S.prototype.u,S.prototype.Pa=function(t,e,i,r){var n=this,o=this.getCache();if(E(t=+t))throw new C(this.Pa,0,t);if(E(e=+e))throw new C(this.Pa,0,e);if(E(i=+i))throw new C(this.Pa,0,i);i=~~i;var s=this.getTileKey(t,e,i);return(o=o.get(s))&&o.valid||r||Xj[s]||(o=A,this.requestTileAsPromise(t,e,i,r).then(function(t){n.hb(t)},ve)),o},S.prototype.requestTile=S.prototype.Pa,S.prototype.Lw=function(t,e,i,r){var n,o,s=this,a=this.getCache(),l=this.getTileKey(t,e,i),c=this.rd();return Yj[l]?Yj[l]:(Yj[l]=n=new Hc(function(n,h){function u(o){var u,p=0,d=function(r,o){(u=s.createTileInternal(t,e,i,r,o)).key=l,a.add(l,u,1),n(u),ak(l)};o&&(p=globalThis.Date.now()-o.timestamp),o&&p<s.MAX_STORE_TIME?s.tw(o.raw,d):(0<p&&c.remove(l),(u=a.get(l))&&u.valid||r?n(u||null):Xj[l]=s.requestInternal(t,e,i,d,h))}o=c.get(l,u,u)}),Xj[l]||(Xj[l]=o),n.then(function(){ak(l)},function(){ak(l)}),n)},S.prototype.requestTileAsPromise=S.prototype.Lw,S.prototype.Kw=function(t,e){var i=this,r=t.id,n=t.tile.coords;return new Hc(function(t,o){i.Lw(n.x,n.y,n.z,e).then(function(e){for(var i,n=x,o=(e=e.ab?e.ab():e.data).length;o--;)if((i=e[o]).wb()===r){n=i;break}t(n)},o)})},S.prototype.requestObjectAsPromise=S.prototype.Kw;var bk={cancel:ve};function Rj(){}function ck(t){if(ck.g.constructor.call(this,t),t&&(this.Hk={crossOrigin:t.crossOrigin||"anonymous",headers:t.headers||{}},this.Wp=t.getURL),dk(this)){var e=t&&t.style&&t.style instanceof H.map.render.harp.Style?t.style:new H.map.render.harp.Style({styles:[{technique:"raster",attr:{gamma:1,brightness:1}}]});this.Wa(e)}if(!Wa(this.Wp))throw new C(ck,0,"getURL");if(this.Eg(t.opacity),this.Al=globalThis.URL||globalThis.webkitURL,!(t="anonymous"===(t=this.Hk.crossOrigin)||"use-credentials"===t)){t=this.Wp(0,0,0),e=window.location;var i=document.createElement("a");i.href=t,t=i.hostname===e.hostname&&i.port===e.port&&i.protocol===e.protocol}(this.hx=t&&!!Oe.arraybuffer&&!!this.Al)&&this.Rb().fi(z(this.je,this))}function dk(t){return!!H.map.render.harp&&t.jb===Xi.HARP}function ek(){ek.g.constructor.call(this),this.Rn={},this.ji={position:new Ye(0,0),zoom:0,heading:180,incline:0,tilt:0,bounds:new L(Kf([90,-180,90,0,90,180,-90,180,-90,-180]))},this.xu=!1}
2S.prototype.nd=function(t,e,i,r){return new Qj(t,e,i,r)},S.prototype.createTileInternal=S.prototype.nd,S.prototype.Yi=function(t){var e=Xj[t];e&&(e.cancel(),ak(t))},S.prototype.cancelTileByKey=S.prototype.Yi,S.prototype.Ld=function(t,e,i){this.cancelTileByKey(this.getTileKey(t,e,i))},S.prototype.cancelTile=S.prototype.Ld,S.prototype.disposeInternal=function(){S.g.disposeInternal.call(this),this.getCache().ia(this.cc),Zj(this)},S.NullStorage=Rj,Rj.prototype.get=function(t,e){return e(),bk},Rj.prototype.get=Rj.prototype.get,Rj.prototype.put=function(t,e,i){i&&i()},Rj.prototype.put=Rj.prototype.put,Rj.prototype.clear=function(t){t&&t()},Rj.prototype.clear=Rj.prototype.clear,Rj.prototype.remove=function(t,e){e&&e()},Rj.prototype.remove=Rj.prototype.remove,u(ck,S),t("H.map.provider.ImageTileProvider",ck),ck.prototype.Dd=function(t){this.Eg(t)},ck.prototype.setOpacity=ck.prototype.Dd,ck.prototype.Ue=function(){return this.Rc},ck.prototype.getOpacity=ck.prototype.Ue,ck.prototype.Ak=te,ck.prototype.providesRasters=ck.prototype.Ak,ck.prototype.u=function(t,e,i,r,n,o){var s,a=this,l=this.Wp(t,e,i);if(t=bk,l){var c=globalThis.setTimeout(function(){a.hx?(s=new Me("arraybuffer",l,o,a.Hk)).then(function(t){return t.blob()}).then(function(t){var e=new Image;e.onload=z(r,null,e,{raw:t}),e.onerror=z(n,null,"bad url");try{e.src=a.Al.createObjectURL(t)}catch(t){}},n):(s=new Me("image",l,o,a.Hk)).then(r,n)},150);t={cancel:function(){s?s.cancel():globalThis.clearTimeout(c)}}}else r(null);return t},ck.prototype.requestInternal=ck.prototype.u,ck.prototype.tw=function(t,e){var i=new Image;i.onload=function(){e(this)},i.src=this.Al.createObjectURL(t)},ck.prototype.je=function(t,e){(t=e.data)&&t instanceof HTMLImageElement&&this.Al.revokeObjectURL(t.src)},ck.prototype.K=function(){return this.lb()},ck.prototype.getStyle=ck.prototype.K,ck.prototype.Bb=function(t){dk(this)&&t instanceof H.map.render.harp.Style&&this.Wa(t)},ck.prototype.setStyle=ck.prototype.Bb,u(ek,I),t("H.map.ViewModel",ek),ek.prototype.j={Ca:"update",Pi:"sync"},ek.prototype.$c=function(t,e,i){if(!t)throw new C(this.$c,0,t);var r=t[fk];if(Ya(r)&&!Ze(r))throw new C(this.$c,0,fk);var n=t[gk];if((r=Ya(n))&&E(+n))throw new C(this.$c,0,gk);var o=t[hk];if((n=Ya(o))&&!B(o,Xe))throw new C(this.$c,0,hk);return o=ik(t=Object.assign({},t),this.Rn,this.ji),jk(this,this.Rn,t),this.xu||jk(this,this.ji,t),this.dispatchEvent(new kk(this.Rn,o,!!i&&!r&&n,e)),this},ek.prototype.setLookAtData=ek.prototype.$c,ek.prototype.Hb=function(){var t={};return t[fk]=$e(this.ji[fk]),jk(this,t,this.ji,!0),t},ek.prototype.getLookAtData=ek.prototype.Hb;var fk="position",gk="zoom",hk="bounds",lk={Qs:fk,Us:gk,Is:"heading",Ts:"tilt",Js:"incline",Cs:hk},mk=Object.keys(lk).map(function(t){return lk[t]});function jk(t,e,i,r){t.Ev={},t.Dv={},t.nv=[];for(var n,o,s,a=t.gC,l=t.fC,c=mk.length;c--;)if(s=i[n=mk[c]],null==(o=e[n])||!r)if(null!=s){if(Ya(a)&&a.call(t,n,o,s),e[n]="position"!==n||s&&!E(s.lat)&&!E(s.lng)?s:$e(s),Ya(l)){switch(n){case"position":o=s&&o&&(s.lat!==o.lat||s.lng!==o.lng);break;case"bounds":o=s&&o&&!s.da(o);break;default:o=s!==o}o&&l.call(t,n)}}else delete e[n]}ek.prototype.gC=function(t,e,i){this.Ev[t]=e,this.Dv[t]=i},ek.prototype.fC=function(t){this.nv.push(nk[t])};var nk=mk.reduce(function(t,e){return t[e]=Cj[e.toUpperCase()],t},{});function ik(t,e,i){var r=0;return["tilt","incline","heading",gk].forEach(function(n){E(t[n])?t[n]=E(e[n])?i[n]:e[n]:r|=nk[n]}),[fk,hk].forEach(function(n){t[n]?r|=nk[n]:t[n]=e[n]||i[n]}),r}function ok(t,e){return t|e}function kk(t,e,i,r){kk.g.constructor.call(this,ek.prototype.j.Ca,t,null,e),this.Mu=this.integerZoom=!!i,this.animate=this.animate=hb(r)&&0<r&&1/0>r?r:!!r}function pk(){this.aa=[],pk.g.constructor.call(this)}function qk(t,e,i){if(t=t.aa.length,i)var r=t;else if(E(r=0>(r=+e)?yb(0,t+r):xb(t,r)))throw new ae(pk,e,[0,t-1]);return r}function rk(t,e,i,r,n,o){rk.g.constructor.call(this,e,t),this.idx=i,this.added=r,this.removed=n,this.moved=o}function sk(t){var e;if(sk.g.constructor.call(this),this.dispatchEvent=z(this.dispatchEvent,this),t){var i=t.length;for(e=0;e<i;e++)this.add(t[e])}}function tk(t,e){var i=e.getProvider&&e.getProvider();i&&(uk[i.uid]=i),e.ea(t)}function vk(t){var e=t.getProvider&&t.getProvider();e&&delete uk[e.uid],t.ea(null)}ek.prototype.qb=function(t){var e={},i={};this.xu=!0,jk(this,this.ji,t),this.Rn={},e.lookAt=this.Dv,i.lookAt=this.Ev,t=(t=this.nv).length?t.reduce(ok):0,this.dispatchEvent(new Bj(this.j.Pi,e,i,t))},ek.prototype.synchronize=ek.prototype.qb,ek.prototype.Wk=function(t,e){if(E(t=+t))throw new C(this.Wk,0,gk);this.$c({zoom:t},e)},ek.prototype.Tb=function(){return this.ji.zoom},ek.prototype.Gd=ub,ek.prototype.startControl=ek.prototype.Gd,ek.prototype.control=ub,ek.prototype.control=ek.prototype.control,ek.prototype.hc=ub,ek.prototype.endControl=ek.prototype.hc,u(kk,Bj),u(pk,I),t("H.util.OList",pk),pk.prototype.Do=function(t,e){this.aa.splice(e,0,t),this.dispatchEvent(new rk(this,this.j.Ki,e,t,null,null))},pk.prototype.add=function(t,e){this.Do(t,qk(this,e,E(e)))},pk.prototype.add=pk.prototype.add,pk.prototype.nf=function(t){var e=this.aa.splice(t,1)[0];return this.dispatchEvent(new rk(this,this.j.Mi,t,null,e,null)),e},pk.prototype.Cd=function(t){return this.get(t),this.nf(t)},pk.prototype.removeAt=pk.prototype.Cd,pk.prototype.remove=function(t){return 0<=(t=this.indexOf(t))&&(this.nf(t),!0)},pk.prototype.remove=pk.prototype.remove,pk.prototype.set=function(t,e){if(0!==this.aa.length||0!==t){this.get(t),t=qk(this,t,!1);var i=this.aa[t]}return this.aa[t]=e,this.dispatchEvent(new rk(this,this.j.Ni,t,e,i,null)),i},pk.prototype.set=pk.prototype.set,pk.prototype.indexOf=function(t){return this.aa.indexOf(t)},pk.prototype.indexOf=pk.prototype.indexOf,pk.prototype.get=function(t){var e=qk(this,t,!1),i=this.aa;if(e>=i.length)throw new ae(this.get,t,[0,i.length-1]);return i[e]},pk.prototype.get=pk.prototype.get,pk.prototype.hA=function(){return this.aa.length},pk.prototype.getLength=pk.prototype.hA,pk.prototype.Sa=function(){return[].concat(this.aa)},pk.prototype.asArray=pk.prototype.Sa,pk.prototype.flush=function(){for(var t=this.aa.length;t--;)this.nf(t)},pk.prototype.flush=pk.prototype.flush,pk.prototype.disposeInternal=function(){this.flush(),pk.g.disposeInternal.call(this)},pk.prototype.j={Ki:"add",Mi:"remove",Ni:"set",UD:"move"},u(rk,nd),pk.Event=rk,u(sk,pk),t("H.map.DataModel",sk),sk.prototype.add=function(t,e){B(t,fj,this.add,0),tk(this,t),sk.g.add.call(this,t,e)},sk.prototype.add=sk.prototype.add,sk.prototype.set=function(t,e){return B(e,fj,this.set,0),tk(this,e),(t=sk.g.set.call(this,t,e))&&vk(t),t},sk.prototype.set=sk.prototype.set,sk.prototype.Cd=function(t){var e;return(e=sk.g.Cd.call(this,t))&&vk(e),e},sk.prototype.removeAt=sk.prototype.Cd,sk.prototype.remove=function(t){var e;return(e=sk.g.remove.call(this,t))&&vk(t),e},sk.prototype.remove=sk.prototype.remove,sk.prototype.flush=function(){for(var t=this.aa.length;t--;)this.Cd(t);sk.g.flush.call(this)},sk.prototype.flush=sk.prototype.flush;var uk={};function wk(t,e,i){if(t=uk[t])return B(t[e],Function,wk,1,"invalid method"),t[e].apply(t,i)}function xk(t,e){var i;if(e=e||{},!B(t,Element))throw new C(xk,0,t);var r=t.ownerDocument.createElement("div");this.G=t,xk.g.constructor.call(this),this.padding=new jh(0,0,0,0),this.center=new F(0,0),this.margin=0,this.element=r,r.style.zIndex=0,r.style.height=r.style.width="100%",r.style.direction="ltr",r.style.position="relative"===t.style.position?"absolute":"relative",this.resize(),t.appendChild(r),(i=e.padding)!==A&&this.Vr(i.top,i.right,i.bottom,i.left),this.Qr((i=e.margin)!==A?i:0)}function yk(t,e,i,r){var n=new jh(0,0,0,0);if(yk.g.constructor.call(this),!t)throw new C(yk,0,t);if(!e)throw new C(yk,1,e);if(!i)throw new C(yk,2,i);if("object"!=typeof r)throw new C(yk,3,r+" is not an object");
2if("number"!=typeof r.pixelRatio)throw new C(yk,3,r.pixelRatio+" is not a number");this.ja=r.pixelRatio,this.zoom=0,this.zb=Db(this.ja)/Nb,this.pixelProjection=new cj,this.sl={1:n.clone(),2:n.clone(),4:n.clone()},this.wd=new F(.5,.5),this.Ba=t,zk(this,this.ja),this.Hd=z(this.Hd,this),this.ud=z(this.ud,this),this.ic=z(this.ic,this),t.startInteraction=this.Hd,t.interaction=this.ud,t.endInteraction=this.ic,t.addEventListener(t.j.Ca,this.mg,!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.Va,this.geoToScreen=this.La,this.screenToLookAtData=this.Wn,this.De=e,this.Gd=z(this.Gd,this),this.control=z(this.control,this),this.hc=z(this.hc,this),e.startControl=this.Gd,e.control=this.control,e.endControl=this.hc,e.addEventListener(e.j.Ca,this.ar,!1,this),this.gb=i,this.hn=z(this.hn,this),this.ig=z(this.ig,this),this.jg=z(this.jg,this),this.gn=z(this.gn,this),i.addEventListener(fj.prototype.j.Ca,this.hn,!1,this),i.addEventListener(i.j.Ki,this.ig,!1,this),i.addEventListener(i.j.Mi,this.jg,!1,this),i.addEventListener(i.j.Ni,this.gn,!1,this)}function zk(t,e){var i=t.Ba,r=i.width,n=i.height,o=i.padding,s=o.top,a=o.left,l=o.bottom;o=o.right,i=i.margin;var c=-(r+a-o)/2|0,h=-(n+s-l)/2|0;r+=c,n+=h,(t=t.sl)[1].set((c-i)*e,(h-i)*e,(r+i)*e,(n+i)*e),t[2].set(c*e,h*e,r*e,n*e),t[4].set((c+a)*e,(h+s)*e,(r-o)*e,(n-l)*e)}function Ak(t,e){t.style.transition="opacity 1.5s",Cd(t,"transitionend",e,!1),t.style.opacity=0}kb(uk),sk.invoke=wk,u(xk,I),t("H.map.ViewPort",xk),xk.prototype.j={Ca:"update",Pi:"sync"},xk.prototype.Qr=function(t){if(this.margin!==+t){if(E(this.margin=+t))throw new C(this.Qr,0,t);this.Ce(),this.dispatchEvent(this.j.Ca)}},xk.prototype.setMargin=xk.prototype.Qr,xk.prototype.Vr=function(t,e,i,r){var n=this.padding;if(n.top!==t||n.right!==e||n.bottom!==i||n.left!==r){if(E(t+e+i+r))throw new C(this.Vr);n.top=t,n.right=e,n.bottom=i,n.left=r,this.Ce(),this.dispatchEvent(this.j.Ca)}},xk.prototype.setPadding=xk.prototype.Vr,xk.prototype.Ce=function(){var t=this.padding;this.center.set((this.width+t.left-t.right)/2|0,(this.height+t.top-t.bottom)/2|0)},xk.prototype.resize=function(){var t=this.G.offsetWidth,e=this.G.offsetHeight;
2this.width===t&&this.height===e||(this.UB=new ch(this.width,this.height),this.width=t,this.height=e,this.Ce(),this.dispatchEvent(this.j.Ca))},xk.prototype.resize=xk.prototype.resize,xk.prototype.qb=function(t){this.dispatchEvent(new Bj(this.j.Pi,this.UB,t,Cj.SIZE))},xk.prototype.synchronize=xk.prototype.qb,xk.prototype.disposeInternal=function(){this.G.removeChild(this.element),delete this.G,delete this.element,xk.g.disposeInternal.call(this)},xk.prototype.Hd=ub,xk.prototype.startInteraction=xk.prototype.Hd,xk.prototype.ud=ub,xk.prototype.interaction=xk.prototype.ud,xk.prototype.ic=ub,xk.prototype.endInteraction=xk.prototype.ic,u(yk,I),t("H.map.render.RenderEngine",yk),yk.prototype.Ng=function(){},yk.prototype.mg=function(){zk(this,this.ja)},yk.prototype.disposeInternal=function(){var t=this.Ba,e=this.De,i=this.gb;t.removeEventListener(t.j.Ca,this.mg,!1,this),t.startInteraction===this.Hd&&(t.startInteraction=xk.prototype.Hd),t.interaction===this.ud&&(t.interaction=xk.prototype.ud),t.endInteraction===this.ic&&(t.endInteraction=xk.prototype.ic),e.removeEventListener(e.j.Ca,this.ar,!1,this),e.startControl===this.Gd&&(e.startControl=ek.prototype.Gd),e.control===this.control&&(e.control=ek.prototype.control),e.endControl===this.hc&&(e.endControl=ek.prototype.hc),i.removeEventListener(fj.prototype.j.Ca,this.hn,!1,this),i.removeEventListener(i.j.Ki,this.ig,!1,this),i.removeEventListener(i.j.Mi,this.jg,!1,this),i.removeEventListener(i.j.Ni,this.gn,!1,this)},yk.prototype.Mr=function(t){this.Ho=t},yk.prototype.setAnimationCallback=yk.prototype.Mr,yk.prototype.Dr=function(){this.Ho=void 0},yk.prototype.resetAnimationCallback=yk.prototype.Dr,yk.prototype.control=function(){},yk.prototype.capture=function(){return Qc(Error("not implemented"))};var Bk={ZOOM:1,HEADING:2,TILT:4,INCLINE:8,COORD:16};function Ek(t,e){return e.tilt=Fk(t,e.tilt),e.heading=Gk(t,e.heading),e.incline=t.getCapabilities().lookAt.incline.min,e}function Dk(t,e){var i=t.getCapabilities().lookAt.zoom;return $b(e,yb(i.min,t.zq),xb(i.max,t.yq))}function Fk(t,e){return $b(e,(t=t.getCapabilities().lookAt.tilt).min,t.max)}function Gk(t,e){return $b((e%360+360)%360,(t=t.getCapabilities().lookAt.heading).min,t.max)}function Ck(t,e,i){(i=i?e.addEventListener:e.removeEventListener).call(e,e.j.Os,t.Vq,!1,t),i.call(e,e.j.Ns,t.Vq,!1,t)}yk.InteractionModifiers=Bk,m=yk.prototype,m.j={Ss:"render",Oi:"statechange"},m.pw=0,m.F=function(t){var e=this,i=this.pw;t^i&&(this.pw=t,setTimeout(function(){return e.dispatchEvent(new Oi(e.j.Oi,i,t))}))},m.hn=function(t){this.Mv(t),this.ba()},m.ig=function(t){this.qk(t.idx,t.added)},m.jg=function(t){this.Uq(t.idx,t.removed,t.type===this.gb.j.Ni)},m.gn=function(t){t.removed&&this.jg(t),this.ig(t)},m.Mv=ve,m.qk=function(t,e){this.gq(t,e),0===t&&this.zc(),B(e,fj)&&Ck(this,e,!0),this.li(),this.ba()},m.zc=function(){var t=this.gb.Sa();if(0<t.length){var e=t[0].max;this.zq=t[0].min,this.yq=e}else e=(t=this.getCapabilities().lookAt.zoom).max,this.zq=t.min,this.yq=e;(t=Dk(this,this.zoom))!==this.zoom&&(this.zoom=t,this.pixelProjection.Ua(t),this.qb())},m.qb=function(t){this.uf=this.Hb(),t&&(this.uf.position=t),this.uf.zoom=this.zoom-this.zb,this.uf.position.alt=0},m.yx=0,m.heading=180,m.Hb=function(){return Ek(this,{position:this.pixelProjection.projection.yn(this.wd),zoom:this.zoom,tilt:this.yx,heading:this.heading})},m.gq=ve,m.Uq=ve,m.cD=function(t,e){this.ef={before:t,after:e}},yk.prototype.setOnRenderCallbacks=yk.prototype.cD;var Hk={P2D:0,WEBGL:1,HARP:2};function Ik(t,e){hj.call(this,t,e)}function Jk(t,e,i,r){return(t-=i)*t+(e-=r)*e}function Kk(t,e,i){return Lk(t,e*e,i||0,0,t.length-1)}function Lk(t,e,i,r,n){var o=0,s=r,a=t[r].x,l=t[r].y,c=t[n].x,h=t[n].y,u=r+1,p=Jk(a,l,c,h);if(p)for(;u<n;){var d=t[u++],m=d.x,f=((m-a)*(c-a)+((d=d.y)-l)*(h-l))/p;(m=0>f?Jk(m,d,a,l):1<f?Jk(m,d,c,h):Jk(m,d,a+f*(c-a),l+f*(h-l)))>o&&(o=m,s=u-1)}else for(;u<n;)(m=Jk(m=(d=t[u++]).x,d=d.y,a,l))>o&&(o=m,s=u-1);return o>=e||0<i&&s-r?(--i,1<s-r?(r=Lk(t,e,i,r,s)).splice(r.length-1,1):r=[t[r]],r=1<n-s?r.concat(Lk(t,e,i,s,n)):r.concat(t.slice(s,n+1))):r=[t[r],t[n]],r}
2function Mk(t,e,i,r,n,o,s,a){Mk.g.constructor.call(this,e,i,r,null),this.key=t,this.zd=a,this.ed=n,this.na=o,this.di={},this.zL=s,this.Wm=Bb(P.MAX_LINE_WIDTH/2*this.na+1)}function Nk(t){return t.zd.getInvalidations(Yg.SPATIAL)}function Ok(t){var e,i=Nk(t),r=i.Kd,n=t.yg,o=n===r;if(!(o||i.Pu(n)||i.rq(n))){o=t.Ig;var s=t.di;if(i.Lm(n))for(e=o.length;e--;){var a=o[e];if(a.Mc().Lm(n)){o.splice(e,1);var l=l||Pk(t,a.wb())}}if(i.tq(n)){for(e=o.length;e--;)if((a=o[e]).Mc().tq(n)){var c=1;if((a=s[a.wb()])&&a.xm){l=1;break}}c&&o.sort(Qk)}if(!l&&i.Kh(n))for(e=o.length;e--;)if(o[e].Mc().Kh(n)){var h=1;break}t.xr!==n||h||(t.xr=r,t.pf!==n||l||(t.pf=r)),t.yg=r,o=!0}return o}function Rk(t,e){this.hm=t,this.xm=e}function Pk(t,e){var i=(t=t.di)[e];if(i)return delete t[e],i.xm}function Sk(t){var e,i=Nk(t),r=t.yg,n=t.Ig;if(!Ok(t)){for(e=n.length;e--;){var o=n[e],s=o.Mc();(s.Lm(r)||s.rq(r))&&Pk(t,o.wb())}t.Ig=t.zd.requestSpatialsByTile(t,!1,!1).sort(Qk),t.yg=i.Kd}}function Qk(t,e){return Zg(t.Ve(),e.Ve(),!1)}yk.EngineType=Hk,u(Ik,hj),t("H.map.layer.TileLayer",Ik),Ik.prototype.xg=function(t,e,i,r,n){if(!B(t,J))throw new C(this.xg,0,t);if(E(e=+e))throw new C(this.xg,1,e);e=Ab(e),this.pixelProjection.Ua(e),t=this.Cj(t);var o=this.Fh(t,e);return this.Pj(o,t.left>t.right,e,i,r,n)},Ik.prototype.requestTiles=Ik.prototype.xg,t("H.math.simplifyDP",Kk),u(Mk,Qj),t("H.map.provider.SpatialTile",Mk),Mk.prototype.yg=Wb,Mk.prototype.xr=Wb,Mk.prototype.pf=Wb,Mk.prototype.Ih=function(){var t=Nk(this),e=t.Kd,i=this.pf,r=i===e;return r||(this.zd.yw&&!t.Kh(i)?r=!0:Ok(this)&&(r=this.pf===e)),r},Mk.prototype.isCanvasValid=Mk.prototype.Ih,Object.defineProperty(Mk.prototype,"valid",{get:function(){return this.Ih()},set:ve,configurable:!0}),Mk.prototype.Ig=we,Mk.prototype.ab=function(){return this.Ig},Mk.prototype.getObjects=Mk.prototype.ab,Mk.prototype.KA=function(){return this.ed},Mk.prototype.getTileSize=Mk.prototype.KA;var Tk={};function Vk(t,e,i,r,n,o,s,a,l){var c=t.Sc,h=-s;if(s=o+s,a=a||0,l===A&&(l=c.length),n&&t===nh)e.fillRect(0,0,o,o);else if(l>a){for(e.beginPath(),o=a;o<l;o++){var u=c[o],p=u.length;if(u===oh)e.moveTo(h,h),e.lineTo(h,s),e.lineTo(s,s),e.lineTo(s,h);else{var d=u[0];for(e.moveTo(d.x,d.y),a=1;a<p;a++)d=u[a],e.lineTo(d.x,d.y)}i&&e.closePath()}i&&n&&e.fill(t.Vj!==Vb?"evenodd":"nonzero"),r&&e.stroke()}}function Uk(t,e,i){var r;t.strokeStyle=e.strokeColor,t.lineWidth=e.lineWidth*i,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.setLineDash&&(r=e.lineDash)!==we&&(t.setLineDash(r),t.lineDashOffset=e.lineDashOffset)}function Wk(t,e){t.fillStyle=e.fillColor}function Xk(t,e,i,r,n,o){var s=n*r.width/2,a=(n=n*r.length/2)/2;r=2*n*r.frequency;var l=Eb(Fb(n,2)+Fb(s,2));t=new jh(l,l,t=t.ed-l,t),i=i.Sc;var c,h,u,p,d,m,f,g=Ob/2;for(o=o||0,l=i.length;l-- >o;){var y=0,v=i[l];if(h=c=v.length){var _=v;for(h=_.length,u=0;--h;)u+=_[h].ib(_[h-1]);h=(_=u)>=r}if(h)for(u=(h=_/((h=xb(Ab(_/r),1e3))+1))/2;--c;){for(p=(d=v[c]).ib(m=v[c-1]);u<=y+p;){var b=d.x+(m.x-d.x)*(f=(u-y)/p);f=d.y+(m.y-d.y)*f,t.Rl(b,f)&&(e.save(),e.translate(b,f),e.rotate(-Lb((m.y-d.y)/(d.x-m.x))+(d.x<m.x?g:-g)),e.beginPath(),e.moveTo(-s,-n),e.lineTo(0,n),e.lineTo(s,-n),e.lineTo(0,-a),e.closePath(),e.fill(),e.restore()),u+=h}y+=p}}}Mk.prototype.Qj=function(){var t=this.ed+"_"+this.na,e=Tk[t];if(!e){e=-this.Wm;var i=this.ed-e;e=Tk[t]=new jh(e,e,i,i)}return e},Mk.prototype.getPxClipRect=Mk.prototype.Qj,Mk.prototype.om=function(){var t=this.qz;if(!t){var e=this.qm();t=0;var i=this.ed;this.z&&(i-=t+=this.Qj().top),t=this.qz=of(e.tk(new F(t,t)),e.tk(new F(i,i)))}return t},Mk.prototype.getGeoClipRect=Mk.prototype.om,Mk.prototype.qm=function(){var t=this.BC;if(!t){var e=this.ed;(t=this.BC=new cj(A,e)).Ua(this.z),t.x=this.x*e,t.y=this.y*e}return t},Mk.prototype.getPxProj=Mk.prototype.qm,Mk.prototype.kb=function(){return this.na},Mk.prototype.getPixelRatio=Mk.prototype.kb,Mk.prototype.Jn=function(){var t=this.data;return t&&(this.data=null,this.pf=Wb),t},Mk.prototype.releaseCanvas=Mk.prototype.Jn,Mk.prototype.Kn=function(){this.di={},delete this.Ig,this.yg=Wb},Mk.prototype.releaseData=Mk.prototype.Kn,Mk.prototype.L=function(t){var e,i,r,n,o=t.getContext("2d"),s=0;if(Sk(this),this.pf<this.yg){var a=this.Ig;if(e=a.length){t.width=t.height=this.ed,o.clearRect(0,0,this.ed,this.ed);var l=this.di;for(i=0;i<e;i++){var c=a[i],h=c.wb();if(n=(r=l[h])?r.hm:c.getGeometriesForTile(this)){if(r)c.Mc().Kh(this.pf)&&(r.xm=zh(c,n)),r=r.xm;else{var u;r=zh(c,n);for(var p=n,d=c.We?2:0,m=p.length;m--;){var f=p[m];if(f!==nh){var g=f.Sc;for(u=g.length;u--;)4<(f=g[u]).length&&(g[u]=Kk(f,.6,d))}}this.di[h]=new Rk(n,r)}if(r){for(o.save(),p=c.We?this.IC:this.JC,h=0;h<n.length;h++)p.call(this,c,n[h],c.K(),o);if(n=c.getLabels(this))for(c=o,h=n.length;h--;)for(p=(d=n[h]).size,c.font=p+"px "+d.font,c.fillStyle=d.color,c.textAlign="center",c.translate(d.x,d.y),c.rotate(d.angle),p=d.lineHeight||1.375*p,d=(m=d.lines).length;d--;)c.fillText(m[d],0,d*p);
2o.restore()}s|=+r}}}this.data=s?t:null,this.xr=this.pf=this.yg}else this.data&&(s=1);return 0<s},Mk.prototype.render=Mk.prototype.L,Mk.prototype.data=null,Mk.prototype.JC=function(t,e,i,r){var n;i.Yj&&(Uk(r,i,this.na),Vk(e,r,!1,!0,!1,this.ed,this.Wm)),i.Wj&&(n=t.Tg)&&n.Oc&&(Wk(r,n),Xk(this,r,e,n,i.lineWidth))},Mk.prototype.IC=function(t,e,i,r){var n,o=i.Oc,s=i.Yj,a=this.ed,l=this.Wm;if(e===nh)o&&(Wk(r,i),r.fillRect(0,0,a,a));else{if(s&&Uk(r,i,this.na),i.Wj&&(n=t.Tg)){var c=i.lineWidth;n.Oc||(n=null)}(t=e.un)===Vb?((s||o)&&(Wk(r,i),Vk(e,r,!0,s,o,a,this.Wm)),n&&(Wk(r,n),Xk(this,r,e,n,c,0))):(o&&(Wk(r,i),Vk(e,r,!0,!1,o,a,l,0,t)),s&&Vk(e,r,!1,s,!1,a,l,t),n&&(Wk(r,n),Xk(this,r,e,n,c,t)))}};var Yk=[];function Zk(t,e){var i;Zk.g.constructor.call(this,e),this.xw=t,this.na=t=e.pixelRatio,this.tileSize=i=1<<zb(Xb((e.tileSize||256)*t)),this.ts=Jj(i,t),this.je=z(this.je,this),this.Qq=z(this.Qq,this),this.rg=z(this.rg,this),this.kg=z(this.kg,this),this.ge=z(this.ge,this),this.xw.addEventListener(R.prototype.j.Ca,this.ge,!1,this),this.Zg=[],this.vf=new Lj(e.tileCacheSize||256,this.je),this.fp=new Lj(e.dataCacheSize||512,this.Qq),this.On=new zj(20,this.rg),this.pg={},this.dv=yj()}function $k(t,e){(e=e?Ma(e):{}).tileSize=e.tileSize||256,e.pixelRatio=e.pixelRatio||he(),e.max=24,this.Hg=new Zk(t,e),this.wi=new Ik(this.Hg),e.minWorldSize=this.Hg.tileSize,e.provider=t,$k.g.constructor.call(this,e),this.tileSize=this.wi.tileSize,this.mn=z(this.mn,this),this.Hg.addEventListener(this.Hg.j.Ca,this.mn),t.addEventListener(t.j.Ca,this.mn)}Mk.prototype.Ma=function(t,e,i){for(var r,n,o,s,a,l,c,h=this.Ig,u=h.length,p=we,d=this.na;u--;)if((n=h[u]).Vd(!0)&&(o=this.di[n.wb()])&&(s=o.hm)){for(l="none"!==(r=n.K()).fillColor&&n.We,c="none"===r.strokeColor?0:r.lineWidth*d,r=s.length;r--;){var m;if(a=s[r],!(m=l&&a===nh)&&(m=l||c)){var f;m=t;var g=e,y=l,v=c,_=a.Vj,b=a.un,x=b!==Vb,w=a.Sc,S=w.length,T=0,E=0,M=!1;for(a=0;a<S;a++){var A=w[a],C=a>=b,P=!C&&a>=_;if(A===oh&&y)P?T++:E++;else{var L=A.length;for(Yk.length=2*L,f=0;f<L;f++){var R=A[f];Yk[2*f]=R.x,Yk[2*f+1]=R.y}if(f=y&&!C,C=x&&!C?0:v,f||C){if((C=cc(m,g,Yk,C,f))===bc.EDGE||C===bc.VERTEX){M=!0;break}if(C===bc.SURFACE)if(P)T++;else if(E++,_===Vb)break}}}m=M||0<E&&!(T%2)}if(m){p===we&&(p=[]),p.push(n);break}}if(i&&p.length)break}return p},u(Zk,Ij),Zk.prototype.ge=function(t){(t=t.target).type===Yg.SPATIAL&&this.hb(t)},Zk.prototype.Pa=function(t,e,i,r){var n,o=this.getTileKey(t,e,i);if(n=this.vf.get(o,r)){if(r||n.Ih())return n;r||this.vf.dm(o)}if((n=this.fp.get(o,r))&&(r||Ok(n)))return t=this.Zg.pop()||document.createElement("canvas"),n.L(t)||this.Zg.push(t),this.vf.add(o,n,1),n;r||((n=this.pg[o])?n.count++:((n=this.On.push([o,t,e,i],this.kg)).count=1,this.pg[o]=n))},Zk.prototype.requestTile=Zk.prototype.Pa,Zk.prototype.nd=function(){},Zk.prototype.createTileInternal=Zk.prototype.nd,Zk.prototype.Cn=function(){var t=yj();33<t-this.dv&&(this.On.Cn(),this.dv=t)},Zk.prototype.Ld=function(t,e,i){this.Yi(this.getTileKey(t,e,i))},Zk.prototype.cancelTile=Zk.prototype.Ld,Zk.prototype.Yi=function(t){var e;(e=this.pg[t])&&(e.count--,e.count||(e.cancel(),delete this.pg[t]))},Zk.prototype.cancelTileByKey=Zk.prototype.Yi,m=Zk.prototype,m.rg=function(t,e){var i=e[0],r=e[1],n=e[2],o=e[3];r=(i=this.vf.get(i)||new Mk(i,r,n,o,this.tileSize,this.na,o+this.ts,this.xw)).data||this.Zg.pop()||document.createElement("canvas"),i.L(r)||this.Zg.push(r),e.push(i),t.done(i)},m.kg=function(t,e){t=t.data[0],e&&this.vf.add(t,e,1),delete this.pg[t],this.hb()},m.je=function(t,e){e.data&&this.Zg.push(e.Jn()),this.fp.add(t,e,1)},m.Qq=function(t,e){e.Kn()},m.disposeInternal=function(){for(var t in this.pg)this.pg[t].cancel();this.vf.ia(),this.fp.ia(),this.Zg.length=0,Zk.g.disposeInternal.call(this)},u($k,fj),t("H.map.layer.ObjectLayer",$k),$k.prototype.mn=function(t){t.currentTarget!==this.Hg&&t.target.type===Yg.SPATIAL||this.hb()};var al={markers:we,total:0};$k.prototype.pe=function(t,e,i){var r,n=this.D;return n.providesMarkers()&&(r=n.requestMarkers(t,e,!0,i)).length?{markers:r,total:r.length}:al},$k.prototype.requestMarkers=$k.prototype.pe,$k.prototype.oe=function(t,e,
2i){var r,n=this.D;return n.providesDomMarkers()&&(r=n.requestDomMarkers(t,e,!0,i)).length?{markers:r,total:r.length}:al},$k.prototype.requestDomMarkers=$k.prototype.oe;var bl={tiles:we,total:0};$k.prototype.xg=function(t,e,i,r){if(this.D.providesSpatials()){var n=this.wi.xg(t,e,i,r);i||(this.Hg.Cn(),n=this.wi.xg(t,e,!0,r))}else n=bl;return n},$k.prototype.requestTiles=$k.prototype.xg,$k.prototype.Pa=function(t,e,i,r){return this.wi.Pa(t,e,i,r)},$k.prototype.requestTile=$k.prototype.Pa,$k.prototype.Ld=function(t,e,i){this.wi.Ld(t,e,i)},$k.prototype.cancelTile=$k.prototype.Ld;var cl={overlays:we,total:0},fl,gl;function dl(){if(this.constructor=this.constructor,!eb("STATIC_DB"))throw new C(this.constructor,0);if(this.Hu=el(),!this.Hu)throw new vb(this.constructor,"This browser does not support IndexedDB");this.PB="STATIC_DB",this.gf=[],this.Xh=[],this.$q=z(this.$q,this)}function kl(t,e,i){if(t.ng)t.gf?(t.gf.push(e),i&&t.Xh.push(i)):t.rn?i&&i(t.rn):e(t.ng.result);else{t.ng=t.Hu.open("H_"+t.PB,1),t.ng.onupgradeneeded=t.$q;var r=t.ng.onerror=function(){clearTimeout(t.Yv),t.rn=this.error,t.Xh.forEach(function(e){e(t.rn)}),delete t.gf,delete t.Xh};t.Yv=setTimeout(function(){r.call({error:Error("DbOpenTimeoutError")})},t.Wx),t.ng.onsuccess=function(){clearTimeout(t.Yv),t.gf?(t.gf.forEach(function(t){t(this.result)},this),delete t.gf,delete t.Xh):(delete t.ng,delete t.rn,t.gf=[],t.Xh=[])},t.gf.push(e),i&&t.Xh.push(i)}}function il(t,e,i){kl(t,function(i){i=i.transaction([t.zl],"readwrite"),e(i.objectStore(t.zl))},i)}function jl(t,e,i){e&&(t.onsuccess=function(){e(this.result)}),i&&(t.onerror=function(){i(this.error)})}function hl(t){var e=Object.prototype.toString.call(t);return"[object Blob]"===e||"[object ArrayBuffer]"===e||eb(t)||ya(t)}function ll(){return fl||(fl=new dl),fl}function el(){return globalThis.indexedDB||globalThis.webkitIndexedDB||globalThis.mozIndexedDB||globalThis.msIndexedDB}function ml(){var t="";if(!Ya(gl))if("file:"===window.location.protocol&&Pd&&128<=window.location.href.length)gl=!1;else{try{var e=el();t="H_TEST_DB";var i=e&&e.open(t,1)}catch(t){}gl=!!i&&null===i.onupgradeneeded,i&&e.deleteDatabase&&e.deleteDatabase(t)}return gl}$k.prototype.wg=function(t,e,i){var r=this.D,n=cl;return r.providesOverlays&&r.providesOverlays()&&(e=(t=r.requestOverlays(t,e,!0,i)).length)&&(n={overlays:t,total:e}),n},$k.prototype.requestOverlays=$k.prototype.wg,$k.prototype.disposeInternal=function(){this.Hg.l(),this.wi.l(),this.D.dispose(),$k.g.disposeInternal.call(this)},m=dl.prototype,m.put=function(t,e,i,r){if(!eb(t)&&!hb(t))throw new C(this.put,0);if(!hl(e))throw new C(this.put,1);il(this,function(n){jl(n.put(e,t),i,r)},r)},m.get=function(t,e,i){var r;if(!eb(t)&&!hb(t))throw new C(this.get,0);if(!Wa(e))throw new C(this.get,1);return il(this,function(n){jl(r=n.get(t),e,i)},i),{cancel:function(){r&&(r.onsuccess=ve)}}},m.remove=function(t,e,i){if(!eb(t)&&!hb(t))throw new C(this.remove,0);il(this,function(r){jl(r.delete(t),e,i)},i)},m.clear=function(t,e){il(this,function(i){jl(i.clear(),t,e)},e)},m.zl="data",m.Wx=500,m.$q=function(){var t=this.ng.result;t.objectStoreNames.contains(this.zl)||t.createObjectStore(this.zl)},t("H.util.IndexedDBStorage.getInstance",ll),t("H.util.IndexedDBStorage.isSupported",ml);var nl={lookAt:{zoom:{min:-8,max:24},tilt:{min:0,max:85},incline:{min:0,max:0},heading:{min:0,max:360}},interaction:{ZOOM:Bk.ZOOM,COORD:Bk.COORD},capture:!0};function ol(t,e){if(E(this.zo=+t))throw new C(ol,0,t);this.ho=this.sj=0,e&&this.Yw(e)}function pl(t,e){if(E(this.x=+t))throw new C(pl,0,t);if(E(this.y=+e))throw new C(pl,1,e)}function ql(t){return Eb(t.Jt(t))}function rl(t){t=t||xe,this.LB=Ya(t.KB)?t.KB:3,this.vv=Ya(t.FB)?t.FB:300,this.Lx=Ya(t.KD)?t.KD:3,this.AD=Ya(t.zD)?t.zD:50,this.ei=[],this.clear()}function ul(t,e){t.jk^=t.jk&e}t("H.map.render.webgl.capabilities",nl),t("H.util.kinetics.KineticMove",ol),ol.prototype.Yw=function(t){return this.ho=t,this.sj=this.eu(),this},ol.prototype.setInitialSpeed=ol.prototype.Yw,ol.prototype.eu=function(){return Math.abs(this.ho/this.zo)},ol.prototype.getDuration=ol.prototype.eu,ol.prototype.Ij=function(t){return this.ho+this.zo*t},ol.prototype.getCurrentSpeed=ol.prototype.Ij,ol.prototype.Hz=function(t){return this.ho*t+this.zo*t*t/2},ol.prototype.getCurrentPath=ol.prototype.Hz,m=pl.prototype,m.add=function(t){return new pl(this.x+t.x,this.y+t.y)},m.Jt=function(t){if(!B(t,pl))throw new C(this.Jt,0,t);return(t=this.multiply(t)).x+t.y},m.multiply=function(t){if(!B(t,pl))throw new C(this.multiply,0,t);return new pl(this.x*t.x,this.y*t.y)},m.Ua=function(t){return new pl(this.x*t,this.y*t)},m.normalize=function(){var t=ql(this);return 0!==t?new pl(this.x/t,this.y/t):this},t("H.map.render.InteractionUtils",rl),rl.prototype.iB=function(){return this.Jh},rl.prototype.isGestureDetected=rl.prototype.iB,rl.prototype.start=function(t,e){var i=Bk.HEADING,r=Bk.TILT;this.R&&this.clear(),this.jk=t,this.Km=!!e,this.R=!0,this.Jh=!(t&(i|r))||t===i||t===r},rl.prototype.start=rl.prototype.start,rl.prototype.store=function(t,e,
2i,r,n){var o=!1;if(this.R){if(o=(t=new sl(t,e,i,r,n)).Qu,this.Xn=this.$e,this.$e=t,this.zj){if(this.zm=!0,o){e=this.jk;var s=this.Jh;if(!s&&this.zm){n=Bk.HEADING;var a=Bk.TILT;i=Bk.COORD,r=Bk.ZOOM;var l=e&(i|a)?this.Ah(!0):tl,c=e&r?this.km(!0):1,h=e&n?Cb(this.Cp(!0)):0,u=Cb(l.x),p=Cb(l.y);l=10<u||10<p,u=10<p&&p>3*u,c=.8>c||1.2<c,h=7<h,e&a&&(h||c||l&&!u?ul(this,a):u&&(ul(this,~a>>>0),s=!0)),!s&&e&n&&e&(i|r)&&(c||l?(ul(this,n),s=!0):h&&(ul(this,a),s=!0)),this.Jh=s}}}else this.zj=t,o||(this.Jh=!0);this.Km&&this.ei.push(t)}return o},rl.prototype.store=rl.prototype.store,rl.prototype.clear=function(){this.ei.length=0,this.R=this.Km=this.zm=this.Jh=!1,this.zj=this.Xn=this.$e=void 0},rl.prototype.clear=rl.prototype.clear,rl.prototype.$d=function(t){return 0<(this.jk&t)},rl.prototype.isModifierEnabled=rl.prototype.$d,rl.prototype.Mm=function(){return this.R},rl.prototype.isRunning=rl.prototype.Mm;var tl=Ta(new pl(0,0));function sl(t,e,i,r,n){this.ke=new F(t,e),i!==A&&(this.qg=new F(i,r),this.Qu=!0),this.timestamp=n!==A?n:yj()}function wl(t){var e=t.ke;return(t=t.qg)?new F(e.x-(e.x-t.x)/2,e.y-(e.y-t.y)/2):A}function yl(t,e){var i=t.ke;return(t=t.qg)&&t.ib(e)<i.ib(e)?t:i}function vl(t,e){var i=t.qg,r=e.qg;return r&&i?(e=wl(e),t=wl(t)):i?t=yl(t,e=e.ke):r?e=yl(e,t=t.ke):(e=e.ke,t=t.ke),new pl(e.x-t.x,e.y-t.y)}function xl(t){var e=t.qg;return e?t.ke.ib(e):0}function zl(t){var e,i=this,r=globalThis.H.gl;zl.g.constructor.call(this),this.m=e=r.Scene.create(globalThis.URL.createObjectURL(De(JSON.stringify(Al))),{viewport:t.viewport,container:t.ld,disableRenderLoop:!0,devicePixelRatio:t.devicePixelRatio,logLevel:"error"}),t.eC&&e.subscribe({load:t.eC}),e.subscribe({view_complete:function(){i.Jr=!0,t.Ov()}});var n=e.requestRedraw;e.requestRedraw=function(){n.apply(e),t.Ov()},this.Kr=z(this.Kr,this),this.Mn=z(this.Mn,this),this.qs=0,this.Rh={},this.Fd={}}function Bl(t){var e;for(e in t=t.m.sources){var i=t[e];if(i.hasPendingCommands&&i.hasPendingCommands())return!0}return globalThis.H.gl.Task.hasPendingTasks()}function Cl(t){t.Jr=!1,t.m.resetViewComplete()}function Dl(t){return t.m.view}function El(t,e){function i(){var i,n,o,s,a,l=e.Sa(),c={},h={},u=++t.qs;for(ki(h,Al),n=0;n<l.length;n++){var p=l[n];if(i=p.D){var d=i.lb();if(d.getState()===hi.READY){var m=d.Qd();if(!La(m)){for(o in delete m.cameras,delete m.camera,c[n]=m=wi(m,n),!B(p,$k)&&m.sources&&xi(m,i.uid),m.sources){var f=m.sources[o];f.max_zoom=xb(i.max,nl.lookAt.zoom.max),f.max_display_zoom=p.max,f.min_display_zoom=p.min,(a=i.tileSize)&&(2<=r&&256<a&&i instanceof ck&&(a/=2),f.tile_size=a)}(s=d.Kc())&&yi(m,s),ki(h,m)}}}}return ki(h.layers.skybox.draw.skybox.color,h.scene.sky),t.m.config=h,t.m.updateConfig().then(function(){var e,i,r={};if(u!==t.qs)return!1;for(i in t.qs=0,c){p=l[+i];var n=c[i].sources;for(e in n)(n=t.m.sources[e])&&(r[e]=n,n.initialize&&p.getProvider()&&n.initialize(p.getProvider(),t.Kr,t.m.getWorkers().length,n.tiled?A:t.m.tile_manager.getWorkerForTile(x,n)))}for(e in t.Rh)!r[e]&&t.Rh[e].dispose&&t.Rh[e].dispose();return t.Rh=r,!0})}var r=t.m.pixelRatio();t.m.initialized?i():t.m.load(x,{blocking:!1}).then(i)}function Fl(t,e){var i=t.m.tile_manager;i.removeTiles(t.Mn),i.updateTilesForView(),e&&i.removeCachedTiles(t.Mn),Cl(t),t.Fd={}}
2function Gl(t,e,i,r){t.m.getFeatureAt(e,i,r),t.m.update()}function Hl(t){return t.m.screenshot(void 0).then(function(t){return new Hc(function(e,i){new dh(URL.createObjectURL(t.blob),function(t,r){1===t?e(r.getData()):i()},!1)})})}rl.prototype.Mf=function(){var t;if(this.Km){var e=this.ei,i=e.length,r=0;for(t=new pl(0,0);--i&&r<this.Lx;)t=t.add(vl(e[i-1],e[i])),r++}else t=this.Ah();return t.normalize()},rl.prototype.getDirection=rl.prototype.Mf,rl.prototype.nc=function(t){var e,i;if(t=t||yj(),this.Km){var r=this.ei,n=this.ei.length,o=this.ei[n-1];for(i=e=0;--n&&e<this.Lx;)i+=ql(vl(r[n],r[n-1])),e++;r=i/e}else o=this.$e,r=ql(this.Ah());return r>=this.LB&&t-o.timestamp<=this.AD?r>this.vv?this.vv:r:0},rl.prototype.getSpeed=rl.prototype.nc,rl.prototype.jm=function(){return this.$e?wl(this.$e):A},rl.prototype.getBifocalCenter=rl.prototype.jm,rl.prototype.Ah=function(t){return(t=t?this.zj:this.Xn)?vl(t,this.$e):new pl(0,0)},rl.prototype.getMoveVector=rl.prototype.Ah,rl.prototype.km=function(t){var e=1;if(this.zm){var i=this.$e;(t=xl(t=t?this.zj:this.Xn))&&(i=xl(i))&&(e=i/t)}return e},rl.prototype.getBifocalScaling=rl.prototype.km,rl.prototype.Cp=function(t){if(this.zm){var e=t?this.zj:this.Xn,i=this.$e;t=e.qg;var r=i.qg,n=0;t&&r&&(e=e.ke,i=i.ke,n-=Mb(r.y-i.y,r.x-i.x)*Ub-Mb(t.y-e.y,t.x-e.x)*Ub),t=n}else t=0;return t},rl.prototype.getBifocalRotation=rl.prototype.Cp,sl.prototype.Qu=!1,u(zl,kd),m=zl.prototype,m.Jr=!1,m.L=function(){var t=globalThis.H.gl.Task;return this.m.immediateRedraw(),t.setState({user_moving_view:this.m.view.user_input_active}),t.processAll(),this.Jr&&!this.m.dirty&&!this.m.building&&!Bl(this)&&!Object.keys(this.Fd).length},m.Kr=function(t,e,i){var r=this,n=this.m.sources[t],o=i&&i.isReload;e?!0!==this.Fd[t]&&(this.Fd[t]||(this.Fd[t]={wx:{},gt:[]}),B(e,Qj)?this.Fd[t].wx[e.x+"/"+e.y+"/"+e.z]=!0:(e=e.boundingBox,this.Fd[t].gt.push(new J(e[0],e[1],e[2],e[3])))):this.Fd[t]=!0,n&&n.has_volatile_data?Fl(this,o):(globalThis.clearTimeout(this.Fw),this.Fw=globalThis.setTimeout(function(){return Fl(r,o)},100))},m.Mn=function(t){var e=!1,i=this.Fd[t.source.name],r=globalThis.H.gl;if(i)if(!0===i)e=!0;else{var n=r.Tile.coord(r.Geo.wrapTile(t.coords));if(!(e=!!i.wx[n.key])){var o=r.Geo.getTileBoundingBox(n,t.source.tile_size,P.MAX_LINE_WIDTH/2);o=of(o.getTopLeft(),o.getBottomRight()),e=i.gt.some(function(t){return t.Vf(o,!0)||o.Ff(t.vb(),!0)})}}return e},m.Qd=function(){return this.m.config},m.kb=function(){return this.m.pixelRatio()},m.disposeInternal=function(){var t=this.Rh;zl.g.disposeInternal.call(this),this.m.destroy(),this.Fd={},t&&Object.keys(t).forEach(function(e){t[e].dispose()}),globalThis.clearTimeout(this.Fw),delete this.Rh,delete this.m},zl.prototype.disposeInternal=zl.prototype.disposeInternal;var Al={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 Il(t){return t}function Jl(t){return-t*(t-2)}function Kl(t){return 1-Math.sqrt(1-t*t)}function Ll(t){return Eb(2*t-t*t)}function Ml(t){return 1-Math.cos(t*Math.PI/2)}function Nl(t){return Math.sin(t*Math.PI/2)}function Ol(t,e){this.bg={tilt:Pl(t.tilt,e.tilt),heading:Pl(t.heading,e.heading),zoom:e.zoom-t.zoom};var i=this.ep=$e(t.position),r=e.position;t=r.lat*Tb;var n=i.lat*Tb;i=r.lng*Tb-i.lng*Tb,t=Math.atan2(Hb(i)*Jb(t),Jb(n)*Hb(t)-Hb(n)*Jb(t)*Jb(i)),this.uy=(0<=t?t:Rb+t)*Ub,this.kh=this.ep.ib(e.position),e=this.bg.zoom,this.Cv=0===e?Ql:Object.assign({},Ql,{zoom:0>e?Ll:Kl,position:0>e?Ml:Nl}),this.ev=Object.assign({},{tilt:0,heading:0,zoom:0})}function Pl(t,e){return-180<(t=e-t)&&180>=t?t:180<t?t-360:t+360}t("H.util.animation.ease.LINEAR",Il),t("H.util.animation.ease.EASE_IN_QUAD",function(t){return t*t}),t("H.util.animation.ease.EASE_OUT_QUAD",Jl),t("H.util.animation.ease.EASE_IN_O
2UT_QUINT",function(t){return 1>(t*=2)?Fb(t,5)/2:Fb(t-=2,5)/2+1}),t("H.util.animation.ease.EASE_OUT_CIRC",Ll);var Ql={tilt:Il,heading:Il,zoom:Il,position:Il};function Rl(t,e,i,r,n){if(!Wa(t.Mr)||!Wa(t.Dr))throw new C(Rl,0,t);if(this.$s=t,!Wa(this.GD=e))throw new C(Rl,1,e);if(E(this.sj=+i))throw new C(Rl,2,i);if(!Wa(this.Fv=r)&&null!=r)throw new C(Rl,3,r);if(!Wa(this.Kt=n)&&null!=n)throw new C(Rl,4,n);this.id=(new qe).next(),this.R=!1}function Sl(t){this.xb=t}function Tl(t,e){Tl.g.constructor.call(this,t),this.Od=!(!e||!e.Od),this.Hq={}}t("H.util.animation.Animation",Rl),Rl.prototype.start=function(){var t=this;this.al=yj(),this.R=!0;var e=this.al;this.$s.Mr(function(){if(t.R){var i=yj(),r=i-t.al,n=r/t.sj,o=!1;1<=n&&(n=1,o=!0),t.GD(t.Kt?t.Kt(n):n,r,i-e,i),e=i,o&&t.stop()}else t.stop()})},Rl.prototype.start=Rl.prototype.start,Rl.prototype.stop=function(t){this.R=!1,this.$s.Dr(),t||this.Fv&&this.Fv(this)},Rl.prototype.stop=Rl.prototype.stop,Rl.prototype.Mm=function(){return this.R},Rl.prototype.isRunning=Rl.prototype.Mm,u(Sl,kd),Sl.prototype.Sb=function(){return this.xb},Sl.prototype.getLayer=Sl.prototype.Sb,Sl.prototype.IA=function(){return this.Ob},Sl.prototype.getSurface=Sl.prototype.IA,Sl.prototype.sf=function(t){var e=this.Ob;t!==e&&(this.Ob=t,t.Un(),e&&e.release())},Sl.prototype.setSurface=Sl.prototype.sf,Sl.prototype.disposeInternal=function(){this.Ob.release()},Sl.prototype.disposeInternal=Sl.prototype.disposeInternal,Sl.prototype.Eh=function(){},Sl.prototype.render=Sl.prototype.L,u(Tl,Sl),Tl.prototype.sf=function(t){Tl.g.sf.call(this,t),this.sC=t.ld.ownerDocument},Tl.prototype.setSurface=Tl.prototype.sf;var Ul=function(t,e){return B(e=e.V(),gg)?e.ha:(t[0]=e,t)}.bind(null,[]);function Vl(t,e){var i=t[1].Ve(),r=e[1].Ve();return Zg(i,r,!0)||t[5]-e[5]||Zg(i,r,!1)}function Wl(t,e){Wl.g.constructor.apply(this,arguments),this.Gq=0,this.Sh=[],this.tp=z(this.tp,this)}Tl.prototype.L=function(t,e,i,r,n,o,s){var a,l,c,h,u=this.xb;if(this.yC=e=this.Hq,this.Hq=i={},r>=u.min&&r<=u.max){var p=this.Vt(t,r,n,o),d=p.markers;if(t=d.length){for(r=[],n=this.Ob,o=0;o<t;o++){u=d[o];var m=Ul(u);for(a=m.length;a--;)(l=s(m[a]))&&((h=e[c=u.wb()+"_"+a])?delete e[c]:h={sv:u},i[c]=h,r.push([h,u,u.kc(),n,l.x,l.y]))}for(r.sort(Vl),t=r.length,o=0;o<t;o++)this.Iw.apply(this,r[o])}}return!p||p.requested&&p.requested===p.total||!p.requested&&d.length===p.total?Th.DONE:Th.PENDING},Tl.prototype.render=Tl.prototype.L,Tl.prototype.Ma=function(){},Tl.prototype.getObjectsAt=Tl.prototype.Ma,u(Wl,Tl),t("H.map.render.dom.MarkerRenderer",Wl),Wl.prototype.Vt=function(){return this.xb.oe.apply(this.xb,arguments)},Wl.prototype.L=function(t,e,i,r,n,o,s){this.tp(),this.QB=0;var a,l=Wl.g.L.apply(this,arguments),c=this.Ob,h=this.yC;for(a in h)Xl(this,c,h[a]);return 0===this.Sh.length&&l?Th.DONE:Th.PENDING},Wl.prototype.render=Wl.prototype.L,Wl.prototype.sf=function(t){Wl.g.sf.call(this,t),this.na=t.kb()},Wl.prototype.setSurface=Wl.prototype.sf,Wl.prototype.tp=function(){for(var t,e,i,r=this.Sh.length;r--;)(e=(t=(i=this.Sh[r]).wo).kc()).Oq(i,e,t);this.Sh.length=0},Wl.prototype.Iw=function(t,e,i,r,n,o){var s,a=r.kb(),l=e.Mc();n*=a,o*=a,this.Od||(n=zb(n),o=zb(o)),t.detail&&(l.Kh(t.eB)?Xl(this,r,t):s=t.detail),s||(t.detail=s=i.cu(this.sC),this.Gq++,Wa(i.Oq)&&this.Sh.push(s)),t.eB=l.Kd,s.style.zIndex=this.QB++,s.wo=e,r.Qe(s,n,o,0,0)};var Yl,Zl="pointer-events",$l,am;function Xl(t,e,i){e.clear(e=i.detail),delete e.wo,t.Gq--,(i=(t=i.sv).kc()).Sq&&i.Sq(e,i,t)}function bm(t,e,i,r,n,o){var s=n||"2d";bm.g.constructor.apply(this,arguments),this.$l=this.element.getContext(s,o),this.Au="2d"===s,this.jj=s,this.ij=o}function cm(t){var e="dom";cm.g.constructor.call(this,t),B(this.xb,oj)&&(e="2d"===t.uh()?"2d":"webgl"),this.vD=e}function dm(t,e,i,r){dm.g.constructor.apply(this,arguments)}function em(t,e){this.Gy=t,this.na=e}function fm(t,e,i){var r=[],n={ld:t.Gy,width:e.w,height:e.h,ja:t.na};for(t=0;t<i.length;t++){var o=(e=i[t]).Eh(),s={};Oa(s,n);var a=e.Ob;switch(o){case"2d":if(B(e.Sb(),oj)&&(s.Yo=e.Sb().getContextAttributes()),o=h&&"2d"===h.uh()){o=s.Yo;var l=h.ij;o=!(l!==o&&(l&&!o?l.alpha||l.willReadFrequently:o&&!l?o.alpha||o.willReadFrequently:!o.alpha!=!o.alpha||!l.willReadFrequently!=!o.willReadFrequently))}if(o)var c=!1;else if(a&&!c){var h=a;c=!1}else h=new bm(s.ld,s.width,s.height,s.ja,"2d",s.Yo),c=!0;break;case"dom":h=a||new dm(s.ld,s.width,s.height,s.ja),c=!a;break;default:h=a||new bm(s.ld,s.width,s.height,s.ja,e.Sb().uh(),s.Yo),c=!a}r[r.length-1]!==h&&(h.ui(r.length),r.push(h)),e.sf(h)}return r}function gm(){I.call(this),this.reset()}function im(t){im.g.constructor.call(this,gm.prototype.j.yo),this.kt=t}function jm(t){return globalThis.Object.create(t.To)}function hm(t,e,i,r,n,o){this.Kb=t,this.Lb=e,this.Mb=i,this.mi=r,this.ni=n,this.Kk=o}function T(t,e,i,r){var n;if(T.g.constructor.call(this,t,e,i,r),this.sp=new Lj(this.ey),this.Xb=new F(0,0),(n=r.renderBaseBackgroun
2d)&&(this.Hw=n.lower,this.Gw=n.higher),this.uj=!!r.enableSubpixelRendering,this.Kg=km,this.ma=new rl,this.T=r=new gm,this.fg=z(this.fg,this),r.addEventListener(r.j.yo,this.fg),r=t.element,this.qc=t=r.ownerDocument.createElement("div"),t.style.position="absolute",t.style.width=t.style.height="100%",t.style.zIndex=0,r.insertBefore(t,r.firstChild),this.dl=new em(this.qc,this.ja),this.Vm=e.Hb().position,!(e=globalThis.H.gl))throw new vb(T,'"H-webgl" module is missing');this.m=new zl({viewport:this.Ba,ld:this.qc,devicePixelRatio:this.ja,Ov:z(this.ba,this)}),e.WorkerBroker.addTarget("model",sk),this.fq(),this.Tq=z(this.Tq,this),this.vg=z(this.vg,this),this.La=z(this.La,this),i.addEventListener(fj.prototype.j.Li,this.Tq),this.o=lm,this.zoom=Dk(this,this.De.Tb()),this.zc(),this.mg()}ne&&(ne&&Nd!==x&&(Nd=(am=/(MSIE\s+|rv:)([^\);]+)(\)|;)/.exec(navigator.userAgent))?+am[2]:x),$l=Nd,9===$l?Zl="display":10===$l&&(Zl="visibility")),Yl=Zl,Wl.prototype.Ma=function(t,e,i){var r,n,o,s,a,l=this.na,c=we;if(this.Gq){t/=l,e/=l;var h=(l=this.Ob.ld.getRootNode()).documentElement,u=this.Ob.B(),p=u.getBoundingClientRect();for(t+=p.left,e+=p.top;(n=o=l.elementFromPoint(t,e))&&n!==u&&n!==h&&n!==l.host&&o!==d;){for(;(s=n.parentNode)&&(!Wa(s.contains)||!s.contains(u));)n=s;if(s===u&&(n!==o||"svg"!==n.nodeName)&&0>c.indexOf(a=n.wo)&&(c===we&&(c=[]),c.push(a),i))break;r||(r=[]);var d=n.style;r.push({ut:d.getPropertyValue(Yl),$A:d.getPropertyPriority(Yl),style:d}),d.setProperty(Yl,"visibility"===Yl?"hidden":"none","important"),d=o}if(r)for(e=r.length;e--;)(t=r[e]).style.removeProperty(Yl),eb(t.ut)&&t.style.setProperty(Yl,t.ut,t.$A)}return c},Wl.prototype.getObjectsAt=Wl.prototype.Ma,Wl.prototype.Eh=function(){return"dom"},Wl.prototype.disposeInternal=function(){this.Sh.length=0;var t,e=this.Ob,i=this.Hq;for(t in i)Xl(this,e,i[t]);this.Ob.l(),Wl.g.disposeInternal.call(this)},Wl.prototype.disposeInternal=Wl.prototype.disposeInternal,u(bm,nj),m=bm.prototype,m.createElement=function(t){var e=(t=t.createElement("canvas")).style;return e.position="absolute",e.top=e.left="0",t},m.bx=function(t,e,i,r,n){t.width=yb(i,1),t.height=yb(r,1),e.width=zb(i/n)+"px",e.height=zb(r/n)+"px"},m.Eg=function(t){this.$l.globalAlpha=t},m.Qe=function(t,e,i,r,n){this.Au&&this.$l.drawImage(t,e,i,r,n)},m.getContextAttributes=function(){return this.ij},m.uh=function(){return this.jj},m.clear=function(t){var e,i;this.Au&&(t?this.$l.clearRect(e=t.left,i=t.top,t.right-e,t.bottom-i):this.element.width=this.size.w)},m.disposeInternal=function(){var t=this.element;t.width=t.height=0,delete this.$l,bm.g.disposeInternal.call(this)},bm.prototype.disposeInternal=bm.prototype.disposeInternal,u(cm,Sl),cm.prototype.L=function(t,e,i,r,n,o,s,a){s=this.xb;var l=this.Ob,c=!(B(l,bm)&&"2d"===l.uh());return r>=s.min&&r<=s.max?(c&&l.Zb(!0),s.L(l.B(),{boundingBox:t,zoom:r,screenCenter:e,priorityCenter:o,projection:i,cacheOnly:n,size:l.mc(),pixelRatio:l.kb(),cameraMatrix:a})):(c&&l.Zb(!1),Th.DONE)},cm.prototype.Eh=function(){return this.vD},u(dm,nj),t("H.map.render.dom.Surface",dm),m=dm.prototype,m.uh=function(){return"dom"},m.createElement=function(t){return(t=t.createElement("DIV")).style.position="absolute",t.style.pointerEvents="none",t},m.bx=function(t,e,i,r){e.width=i+"px",e.height=r+"px"},m.Eg=function(t){this.element.style.opacity=t},m.Qe=function(t,e,i){var r=this.ja,n=t.style;n[gc("transform")]="matrix(1,0,0,1,"+e/r+","+i/r+")",t.parentNode!==this.element&&(n.position="absolute",this.element.appendChild(t),this.element.style.pointerEvents="auto","auto"===getComputedStyle(t).pointerEvents&&(t.style.pointerEvents="all"),this.element.style.pointerEvents="none")},m.clear=function(t){t?this.element.removeChild(t):this.element.innerHTML=""},u(gm,I),gm.prototype.start=function(t,e){this.R&&this.reset(),E(t-e)||(this.Ug=+t,this.Vg=+e),this.R=!0},gm.prototype.reset=function(){this.R=!1,this.Ug=this.Vg=A,this.To=new hm(0,0,0,0,0,0)},gm.prototype.Mm=function(){return this.R},gm.prototype.j={yo:"animationupdate"},u(im,nd),gm.prototype.set=function(t,e,i,r,n,o){var s=this.To;this.R&&(t=new hm(t/1e3,e/1e3,i/1e3,r/1e3,n/1e3,o/1e3),s.da(t)||(this.To=t,this.dispatchEvent(new im(jm(this)))))},gm.prototype.nc=function(){return jm(this).nc()},gm.prototype.Mf=function(){var t=jm(this),e=this.nc()||1;return new hm(t.Kb/e,t.Lb/e,t.Mb/e,t.mi,t.ni,t.Kk)},gm.prototype.disposeInternal=function(){this.reset(),gm.g.disposeInternal.call(this)},hm.prototype.nc=function(){return Eb(this.Kb*this.Kb+this.Lb*this.Lb+this.Mb*this.Mb)},hm.prototype.Mf=function(){var t=this.nc()||1;return new hm(this.Kb/t,this.Lb/t,this.Mb/t,this.mi,this.ni,this.Kk)},hm.prototype.da=function(t){var e=t===this;return!e&&(e=B(t,hm))&&(e=this.Kb===t.Kb&&this.Lb===t.Lb&&this.Mb===t.Mb&&this.mi===t.mi&&this.ni===t.ni&&this.Kk===t.Kk),e},u(T,yk),t("H.map.render.webgl.RenderEngine",T),T.prototype.ey=100,T.prototype.Hb=function(){var t=this.Vm;return Ek(this,{position:{sB:t.sB,zB:t.zB},zoom:this.zoom,tilt:this.yx,heading:this.heading})},T.prototype.Tq=function(t){((t=(t=t.target.D)&&t.lb())&&t.getState())===hi.INIT?t.load():(Cl(this.m),El(this.m,this.gb),this.ba())},T.prototype.type=Hk.WEBGL;var lm=2;function mm(t,e,i){function r(t){return n[t]+Pl(n[t],e[t])/2}if(!(i&Cj.POSITION||i&Cj.BOUNDS))return null;
2var n=Dl(t.m).getLookAtData();i=n.position;var o=e.position,s=e.bounds;return cg(n.bounds,o.lat,o.lng,!1)||s&&cg(s,i.lat,i.lng,!1)?null:((i=nm(t,{tilt:r("tilt"),heading:r("heading"),incline:0,bounds:pf([i,o])})).zoom=Dk(t,i.zoom-.5),delete i.bounds,i)}function om(t,e,i,r){return t=t.getCapabilities().lookAt[r],Cb("zoom"===r?i[r]-e[r]:Pl(e[r],i[r]))/(t.max-t.min)||0}function pm(t,e,i){return $b(3e3*(t=yb(8*om(t,e,i,"zoom"),om(t,e,i,"heading"),om(t,e,i,"tilt")/2)),300,4e3)}function nm(t,e,i){return rm(e),t=Dl(t.m).getBestLookAtData(e),i&&(t.zoom<<=0),t}function rm(t){var e=t.bounds;!e||e instanceof L||(t.bounds=$f(e.C()))}function tm(t,e,i){Dl(t.m).setLookAtData(e),Cl(t.m),sm(t),t.ba(),i&&setTimeout(i,0)}function qm(t,e,i,r){var n=Dl(t.m).getLookAtData(),o=new Ol(n,e);0!==o.bg.tilt+o.bg.heading+o.bg.zoom+o.kh?t.ad(function(e){for(var i in o.bg)if(0!==o.bg[i]){var r=o.Cv[i](e);n[i]+=o.bg[i]*(r-o.ev[i]),o.ev[i]=r}return 0!==o.kh&&(n.position=o.ep.oo(o.uy,o.kh*o.Cv.position(e),!0)),tm(t,n)},i,function(){return tm(t,e,r)}):tm(t,e,r)}function um(t,e){t.sp.ia(function(t,i){return i.Ib()===e})}function vm(t){return!(B(t,qj)||B(t,oj))}function sm(t){var e=Dl(t.m).getLookAtData();t.zoom=e.zoom,t.Vm=e.position}function wm(t,e){return new F((e=Dl(t.m).geoToMeters(e)).x/t.Ds+.5,1-(e.y/t.Ds+.5))}function xm(t,e){return e.sub(wm(t,t.Vm)).scale(Fb(2,8+t.zoom))}function ym(t,e,i,r,n,o,s,a){var l,c,h,u=0,p=function(){0===--u&&o(n)};if(a&&a.features)for(u=c=a.features.length,h=0;h<c;h++){var d=a.features[h],m=d.id;if(l=t.m.m.sources[d.source_name]){var f=l.provider,g=f.pu();if(g===Pi.SOURCE){var y=d.source_layer;if("overlays"===y)zm(t,e,i,r,n,l,d.properties.overlays_config);else if(l=l.getMapObjectById(m))if("markers"!==y)n.push(l);else if(Am(t,e,i,l))n.push(l);else if(r&&!s){var v=!0;Gl(t.m,{x:e,y:i},{radius:3.5,top_most_only:!1},function(s){ym(t,e,i,r,n,o,!0,s)})}u--}else g===Pi.FEATURE?(y=d.tile.coords,(v=f.getFeatureProxy(d.properties,y,function(t){t&&(t.ax(f),n.push(t)),p()}))||((l=t.sp.get(m))||((l=new Ug(d)).ea(f),t.sp.add(m,l,1)),n.push(l),u--)):g===Pi.PROVIDER&&(v=!0,f.Kw(d,!1).then(function(t){t&&(!(t instanceof Oh)||Am(this,e,i,t))&&n.push(t),p()},function(){p()},t))}}g&&(v||0!==u)||o(n)}function zm(t,e,i,r,n,o,s){var a;for(t=t.Va(e,i),e=s.length;e--&&(!(a=o.getMapObjectById(s[e].id))||0<=n.indexOf(a)||!a.V().Ff(t)||(n.push(a),!r)););}function Am(t,e,i,r){var n,o=r.kc(),s=o.Bm,a=!s;if(s)if(e+=(o=o.Cb).x,i+=o.y,B(o=r.V(),jg))for(n=(r=o.ha).length;n--&&!a;)o=t.La(r[n]),a=s.Cm(e-o.x,i-o.y,0)!==bc.NONE;else o=t.La(o),a=s.Cm(e-o.x,i-o.y,0)!==bc.NONE;return a}T.prototype.getState=function(){return this.o},T.prototype.getState=T.prototype.getState,T.prototype.Fj=function(t,e){t=e-t;var i=Fb(2,8+this.zoom);return t<i/2?t:t-i*e/Cb(e)},T.prototype.mr=!1,T.prototype.ar=function(t){var e=this,i=t.newValue,r=t.modifiers,n=Dl(this.m);this.Jg(),this.Xb.set(0,0);var o=this.Fo(i);
2if(mk.forEach(function(e){r&t[e.toUpperCase()]||delete o[e]}),t.animate){i=Dl(this.m).getLookAtData();var s=nm(this,o,t.Mu);n=mm(this,s,r);var a=1;hb(t.animate)&&(a=1/t.animate);var l=function(){return e.mr=!1};if(delete s.bounds,this.mr=!0,n){i=pm(this,i,n);var c=pm(this,n,s);qm(this,n,i*a,function(){return qm(e,s,c*a,l)})}else n=pm(this,i,s),qm(this,s,n*a,l)}else(i=t.Mu)?o=nm(this,o,i):rm(o),n.setLookAtData(o);sm(this),Cl(this.m),this.ba()},T.prototype.Yn=function(){},T.prototype.setAnimationDuration=T.prototype.Yn,T.prototype.Ap=function(){},T.prototype.getAnimationDuration=T.prototype.Ap,T.prototype.Zn=function(){},T.prototype.setAnimationEase=T.prototype.Zn,T.prototype.Bp=function(){},T.prototype.getAnimationEase=T.prototype.Bp,T.prototype.Sn=function(){},T.prototype.resetAnimationDefaults=T.prototype.Sn,m=T.prototype,m.Mv=function(t){um(this,t.target.D),Cl(this.m),this.ba()},m.qk=function(t,e){T.g.qk.call(this,t,e),vm(e)&&(Cl(this.m),(t=(t=e.D)&&t.lb())&&t.getState()===hi.INIT&&t.load())},m.Uq=function(t,e,i){var r;if(this.ak=yj(),um(this,e.D),e.requestDomMarkers||B(e,oj)||B(e,qj)){var n=this.qe.ka;for(r=n.length;r--;){var o=n[r];if(o.Sb()===e){n.splice(r,1),o.l();break}}}vm(e)&&El(this.m,this.gb),this.af=this.gb.Sa(),0===t&&(Ck(this,e,!1),this.zc()),fm(this.dl,this.Sf(),this.Pf()),this.li(),i||this.ba()},m.fq=function(){var t=this.gb.Sa(),e=0,i=t.length;for(this.qe={Pe:[],ka:[]},this.af=t;e<i;e++){var r=t[e];this.qk(e,r),Ck(this,r,!0)}this.zc()},m.Vq=function(){this.zc()},m.zc=function(){T.g.zc.call(this);var t=this.getCapabilities().lookAt.zoom;Dl(this.m).setZoomConstraints(yb(t.min,this.zq),xb(t.max,this.yq))},m.gq=function(t,e){var i;if(e){if(t={Od:this.uj,zb:this.zb},e.L?(B(e,oj)||B(e,qj))&&(i=new cm(e)):e.requestDomMarkers&&(i=new Wl(e,t)),i){this.qe.ka.push(i);var r=this.gb.Sa();this.qe.ka.sort(function(t,e){return r.indexOf(t.xb)-r.indexOf(e.xb)}),fm(this.dl,this.Sf(),this.Pf())}vm(e)&&El(this.m,this.gb)}this.af=this.gb.Sa()},m.Pf=function(){return this.qe.ka.filter(Ya)},m.Ro=function(){return this.o===lm},m.Fo=function(t){var e=t.position;return Ek(this,{zoom:Dk(this,t.zoom),position:new Ye(e.lat,e.lng),tilt:t.tilt,heading:t.heading,bounds:t.bounds})},m.Ds=40075016.68557849,m.La=function(t){return Dl(this.m).geoToPixel(t)},T.prototype.geoToScreen=T.prototype.La,T.prototype.Va=function(t,e){return Dl(this.m).xyToGeo(t,e)},T.prototype.screenToGeo=T.prototype.Va,T.prototype.Wn=function(t,e){return t=this.Va(t,e),(e=this.De.Hb()).position=t,e},T.prototype.Ma=function(t,e,i,r){var n=this,o=[];o=this.Np(o,this.qe.ka,t*this.ja,e*this.ja,i),i&&o.length?r(o):this.m.m.initialized?Gl(this.m,{x:t,y:e},{radius:3.5,top_most_only:i},function(s){ym(n,t,e,i,o,r,!1,s)}):r(o)},T.prototype.getObjectsAt=T.prototype.Ma,m=T.prototype,m.Np=function(t,e,i,r,n){for(var o,s=e.length;s--&&!((o=e[s])&&o.Ma&&(t=t.concat(o.Ma(i,r,n)),t.length&&n)););return t},m.xe=x,m.Sf=function(){var t=this.sl[2];return{w:t.right-t.left,h:t.bottom-t.top}},m.mg=function(){var t=this.qe.ka.length;zk(this,this.ja),this.Xb.set(0,0);var e=this.Sf(),i=e.w,r=e.h;for(this.m.m.handleViewportUpdate();t--;){var n=(e=this.qe.ka[t].Ob).mc();n.w===i&&n.h===r||e.Vk(i,r)}this.xe=new ch(i,r),Cl(this.m),this.ba()},m.getCapabilities=function(){return nl},T.prototype.getCapabilities=T.prototype.getCapabilities,m=T.prototype,m.wq=function(){this.F(1),this.ne=!1,this.o=1,this.Mk()},m.Mk=function(){this.ta&&this.ta.R||(Bl(this.m)||yj()-this.ak<this.Kg)&&!this.ne?this.rh||(this.rh=wj(this.vg)):(this.ne&&(this.li(),this.qj(),this.F(0)),this.o=lm)},m.rh=0,m.li=function(){this.qe.Pe.length=0},m.vg=function(){this.rh=0,this.ef&&this.ef.before();var t=Dl(this.m),e=t.getLookAtData(!1),i=t.getLookAtData(!0);t=this.Ba.center.clone(),i=i.bounds.C();var r=this.zoom,n=this.Xb,o=this.af,s=o.length;for(this.Kg=km;s--;){var a=o[s];B(a,fj)&&a.D&&a.D.yk(i,r)}this.ne=this.m.L(),this.De.qb(e),this.ne=this.Nn(i,t,r,!1,n,this.qe)&&this.ne,this.xe&&(this.Ba.qb(this.xe),this.xe=x),this.ta&&this.ta.R&&this.Ho(),this.ef&&this.ef.after(),this.Mk()},m.Nn=function(t,e,i,r,n,o){var s,a=o.ka.length,l=!0;for(s=0;s<a;s++){var c=o.ka[s],h=o.Pe;if(c){var u=c.L(t,e,void 0,i,r,n,this.La,this.m.m.getCameraMatrix());u===Th.ACTIVE&&(this.Kg=1/0),u!==Th.DONE||h[s]||(this.qj(c.Sb()),h[s]=!0),h[s]||(l=!1)}}return l},m.qj=function(t){this.mr||setTimeout(z(this.dispatchEvent,this,{type:this.j.Ss,target:t||this}),1)},m.disposeInternal=function(){var t=this.gb.Sa()[0],e=this.Ba;
2xj(this.rh),this.bd(!0),t&&Ck(this,t,!1),this.Pf().forEach(function(t){t.l()}),e.element&&e.element.removeChild(this.qc),delete this.qc,this.o=3,this.m.l(),T.g.disposeInternal.call(this)},m.ba=function(){this.ak=yj(),this.Ro()&&this.wq()},m.Ac=function(t,e){this.Sg(t,e),this.Xb.set(0,0),Cl(this.m),this.ba()},m.Sg=function(t,e){Dl(this.m).applyPxOffset([t,e]),sm(this)},m.Ng=function(t,e,i){t=Dk(this,Dk(this,t)),this.sb(t,e,i)},T.prototype.zoomAt=T.prototype.Ng,T.prototype.sb=function(t,e,i){Dl(this.m).setLookAtData({zoom:t},hb(e)&&hb(e)?[e,i]:A),sm(this),Cl(this.m),this.ba()},T.prototype.Jg=function(){this.bd(!0),this.T.R&&this.hc(!0),this.ma.R&&this.ic(!0)},T.prototype.Sk=function(t){if(t){var e={};e.xk=t.power,e.tj=t.ease,e.duration=t.duration,this.ua=e}},T.prototype.Hd=function(t,e){var i=!!(e||t&(Bk.HEADING|Bk.TILT));this.Jg(),this.Sk(e),this.ma.start(t,i),Dl(this.m).setPanning(!0)},T.prototype.startInteraction=T.prototype.Hd,T.prototype.ud=function(t,e,i,r,n){var o=this.ma,s=!1;if(o.R){var a=Dl(this.m),l=a.getLookAtData(),c=this.Ba.center;c=[c.x,c.y],e=o.store(t,e,i,r,n),i=o.jm(),t=o.Ah(),r=this.ma.km(),n=this.ma.Cp(),o.Jh&&(o.$d(Bk.TILT)&&(a.setLookAtData({tilt:Fk(this,l.tilt+t.y/this.Ba.height*-180)},c),s=!0),e&&1!==r&&o.$d(Bk.ZOOM)&&(s=o.jm(),this.sb(Dk(this,Db(Fb(2,this.zoom)*r)/Nb),s.x,s.y),s=!0),o.$d(Bk.COORD)&&0<ql(t)&&(this.Ac(-t.x,-t.y),s=!0),o.$d(Bk.HEADING)&&(e?a.setLookAtData({heading:l.heading+Gk(this,n)},[i.x,i.y]):t.x&&a.setLookAtData({heading:Gk(this,l.heading+t.x/this.Ba.width*360)},c),s=!0),s&&(Cl(this.m),this.ba()))}},T.prototype.interaction=T.prototype.ud,T.prototype.ic=function(t){var e=this;if(this.ma.R&&!t){if(this.ua){t=this.ma.nc();var i=this.ma.Mf(),r=this.ua.duration,n=(this.ua.xk||1)*t,o=new ol(-n/(0<r?r:1),n);!E(i.x)&&!E(i.y)&&0<n&&e.ma.$d(Bk.COORD)&&this.ad(function(t){n=o.Ij(t*r),E(n)||e.Ac(zb(-i.x*n),zb(-i.y*n))},r,void 0,this.ua.tj)}delete this.ua,this.ma.clear()}Dl(this.m).setPanning(!1),this.ba()},T.prototype.endInteraction=T.prototype.ic,T.prototype.Gd=function(t,e,i){this.Jg(),this.T.start(e,i),this.Sk(t),Dl(this.m).setPanning(!0)},T.prototype.startControl=T.prototype.Gd,T.prototype.control=function(t,e,i,r,n,o){for(var s,a=0;a<arguments.length;a++)if((s=+arguments[a])!=s)throw new C(this.control,a,s);this.T.R&&this.T.set(t,e,i,r,n,o)},T.prototype.control=T.prototype.control,T.prototype.hc=function(t,e){var i,r=this;if(this.T.R){this.bd(!0);var n=yj(),o=n-this.kj;if(1<=o){var s=jm(this.T);this.Ri(s,o)}if(!this.ua||t||e)"function"==typeof e&&(e(t=(t=Dl(this.m)).getLookAtData()),this.Io(t));else{e=this.T.nc();var a=this.T.Mf(),l=this.ua.duration,c=(this.ua.xk||1)*e,h=new ol(-c/(0<l?l:1),c);!E(a.Kb)&&!E(a.Lb)&&0<c&&this.ad(function(t,e,o,s){n&&(o=s-n,n=0),c=h.Ij(t*l)*o,E(c)||((i=a.Mb*c)&&r.sb(Dk(r,r.zoom+i),r.T.Ug,r.T.Vg),r.Ac(zb(a.Kb*c),zb(a.Lb*c)))},l,void 0,this.ua.tj)}this.T.reset(),Dl(this.m).setPanning(!1),this.ba()}},T.prototype.endControl=T.prototype.hc,m=T.prototype,m.Io=function(t){var e=this,i=xm(this,wm(this,t.position)),r=i.y;i=i.x;var n=t.zoom,o=xm(this,wm(this,this.Vm));t=o.y;var s=o.x;o=this.zoom;var a=this.T.nc(),l=this.T.Ug,c=this.T.Vg,h=0;if(i=this.Fj(s,i),t=Eb((i-=s)*i+(r-=t)*r+(o=n-o)*o),0!==a&&0!==t){var u=i/t,p=r/t,d=o/t,m=a*a/(2*t);this.ad(function(t,i){var r;
21!==t?((r=d*(i=(t=a*i-m*i*i/2)-h))&&(r=Dk(e,e.zoom+r),e.sb(r,l,c)),e.Ac(zb(u*i),zb(p*i)),h=t):(e.sb(Dk(e,n),l,c),e.ba())},2*t/a)}},m.fg=function(t){var e=this,i=t.kt;this.Xb.set(0,0),i.Kb||i.Lb||i.Mb||i.mi||i.ni||i.Kk?(this.kj=yj(),this.ad(function(t,r,n,o){e.kj=o,e.Ri(i,n)},Vb),this.ba()):this.bd(!0)},m.Ri=function(t,e){e=e||0;var i=this.T,r=Dl(this.m),n=r.getLookAtData();t.Mb&&this.sb(Dk(this,n.zoom+t.Mb*e),i.Ug,i.Vg),r.setLookAtData({heading:Gk(this,n.heading+t.ni*e),tilt:Fk(this,n.tilt+t.mi*e)}),sm(this),this.Ac(t.Kb*e,t.Lb*e)},m.ad=function(t,e,i,r){this.ta&&this.ta.R&&this.ta.stop(!0),this.ta=new Rl(this,t,e,i,r),this.ta.start()},m.bd=function(t){this.ta&&this.ta.R&&this.ta.stop(t)},m.mp=function(){},T.prototype.enter=T.prototype.mp,T.prototype.rp=function(t){Ak(this.qc,t)},T.prototype.exit=T.prototype.rp,T.prototype.capture=function(t,e,i,r){var n=this;return Hl(n.m).then(function(o){var s=n.qc.ownerDocument.createElement("canvas"),a=n.ja,l=s.getContext("2d"),c=n.m.kb()/a,h=(i-t)*a;return a*=r-e,s.width=h,s.height=a,l.drawImage(o,t*c,e*c,h*c,a*c,0,0,h,a),s})},T.prototype.rz=function(t){return Dl(this.m).geoToMeters(t)},T.prototype.geoToMeters=T.prototype.rz,T.prototype.IB=function(t){return Dl(this.m).metersToGeo(t)},T.prototype.metersToGeo=T.prototype.IB;var km=5e3,Vm;function U(t){var e={};this.Du=e.previousSibling=e.nextSibling=e,this.lD=new qe,U.g.constructor.call(this,t),t&&"objects"in t&&this.hd(t.objects)}function Bm(t,e,i){t.ti(i.D)}function Cm(t){t.Ik()}function Dm(t,e,i){t.qa(i.Xt)}function Em(t){this.push(t)}function Fm(t,e){for(var i,r=0,n=e.length,o=[];r<n;r++)i=(i=e[r])instanceof U?{type:"GeometryCollection",geometries:Fm(t,i.ab())}:i instanceof Oh||i instanceof ih||i instanceof ai||i instanceof Eh?i.V().ye():{type:"FeatureCollection",features:we},o.push(i);return o}function Gm(t){var e;for(e in Za(this,Gm),Gm.g.constructor.call(this,t),this.Wf=t=[],Yg)t[Yg[e]]=new Vg}function Hm(t,e,i,r,n,o){Hm.g.constructor.call(this,isNaN(t)?15:t,e,i,r,n,o)}function Im(t,e){this.id=yf++,this[0]=e,this[1]=t}function Jm(){this.Ae=new Hm(10,180,90,0,0,!0)}function N(t){t=t||{},N.g.constructor.call(this,t),this.Ag=t=new U({min:t.min,max:t.max}),t.D=this,t.ea(this),t.qa(Wg.ADD),this.sk=new Df,this.xi=new Df,this.fk=new Jm,this.kk=new Df,this.cm=new Jm,this.$m=new Df}function Km(t,e,i,r,n,o,s){if(s=s||[],e.jc)for(t=e!==t.fk&&e!==t.kk,n=!n,i=(e=e.Gm(i,o,o)).length,o=0;o<i;o++){var a,l=e[o].As;if(a=void 0!==r){for(var c=Ab(r),h=l;(a=h.yb<=c&&h.Pc>=c)&&(h=h.Na););a=!a}a||!n&&!l.Vd(!0)||(t||1===l.kc().getState())&&s.push(l)}return s}function Lm(t,e,i,r,n){var o=Km(t,t.fk,e,i,r,n);return Km(t,t.kk,e,i,r,n,o),o}function Mm(t,e,i,r,n){var o=Km(t,t.cm,e,i,r,n);return Km(t,t.$m,e,i,r,n,o),o}function Nm(t,e,i){var r,n=i.V(),o=Om.bind(null,t);t=Pm.bind(null,t),B(i,ai)?r=B(n,K)?o(n):n.ha.some(o):B(i,Eh)?r=B(n,L)?t(n):n.ha.some(t):B(i,ih)&&(r=t($f(n))),r&&e.push(i)}function Om(t,e){t:{var i=e.S,r=eg(t,e);if(!r){e=e.S.length;for(var n=0;n<e;n+=3)if(cg(t,i[n],i[n+1])){t=!0;break t}}t=r}return t}function Pm(t,e){return fg(t,e)}function Qm(t,e,i){for(var r=t.length;r--;){var n=t[r],o=n.V();if(B(o,jg)){for(var s,a=(o=o.ha).length;a--;)if(cg(e,(s=o[a]).lat,s.lng)){i.push(n);break}}else cg(e,o.lat,o.lng)&&i.push(n)}}function Rm(){}function Sm(t,e){var i=t.B(),r=i.ownerDocument;Sm.g.constructor.call(this),this.s=t,this.G=i=i.appendChild(Tm(r,"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.Hl=Tm(r,"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-.
20296808.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>',"H_logo"),i.appendChild(this.Hl),i=i.appendChild(Tm(r,"DIV","right:0;bottom:0;position:absolute;background-color:rgba(255,255,255,.8);color:#0F1621;padding:2px 16px",null,"H_copyright")),this.jo=i.appendChild(Tm(r,"A","color:inherit; margin:0px 8px; text-decoration:none; pointer-events:all;","Terms of use")),this.jo.target="_blank",this.jo.tabIndex=1,this.Vl=i.appendChild(Tm(r,"SPAN","margin:0px 8px")),this.cg=i.appendChild(Tm(r,"SPAN")),this.av=Ma(Um),this.Ur(e),this.Di=z(this.Di,this),this.fe=z(this.fe,this),this.s.addEventListener(this.s.j.Ms,this.Di),this.s.O.addEventListener("add",this.fe),this.s.O.addEventListener("remove",this.fe),this.s.O.addEventListener("set",this.fe),this.fe()}u(U,M),t("H.map.Group",U),U.prototype.type=Yg.GROUP,U.prototype.ti=function(t,e){return this.lr=!0,t=U.g.ti.call(this,t,e),this.lr=!1,t&&this.forEach(Bm,!0),t},U.prototype.setProvider=U.prototype.ti,U.prototype.contains=function(t){var e=this===t;if(!e&&this.ah&&B(t,M))for(;!e&&t;)t===this?e=!0:t=t.Na;return e},U.prototype.contains=U.prototype.contains,U.prototype.Ik=function(){this.so=A,this.forEach(Cm,!0)},U.prototype.resetZInfo=U.prototype.Ik,U.prototype.lr=!1,U.prototype.qa=function(t){var e=U.g.qa.call(this,t);return e&&!this.lr&&(this.Xt=t,this.forEach(Dm,!0),delete this.Xt),e},U.prototype.invalidate=U.prototype.qa,U.prototype.forEach=function(t,e,
2i){var r;if(this.ah){var n=this.Du,o=n.nextSibling;for(r=0;o!==n;){var s=o.nextSibling;t.call(i,o,r++,this),e&&B(o,U)&&o.forEach(t,e,i),o=s}}},U.prototype.forEach=U.prototype.forEach,U.prototype.ab=function(t){var e=[];return this.forEach(Em,t,e),e},U.prototype.getObjects=U.prototype.ab,U.prototype.C=function(){var t=null;return this.ah&&this.forEach(function(e){e.C&&(e=e.C())&&(t=t?t.xd(e):e)}),t},U.prototype.getBoundingBox=U.prototype.C,U.prototype.ah=0,U.prototype.Cz=function(){return this.ah},U.prototype.getChildCount=U.prototype.Cz,U.prototype.Y=function(t){var e=this.Du,i=e.previousSibling;if(B(t,M,this.Y,0),t.contains(this))throw new vb(this.Y,"The new object contains the parent group");var r=t.tm(!0),n=t.Na;if(n!==this){if(n){n=t.previousSibling;var o=t.nextSibling;n.nextSibling=o,o.previousSibling=n}t.Na=this,M.g.ea.call(t,this),i.nextSibling=t,t.previousSibling=i,t.nextSibling=e,e.previousSibling=t,this.ah++}return t.cs=this.lD.next(),t.Ik(),e=t.ti(this.D,this.Y),t.tm(!0)!==r&&t.qa(Wg.VOLATILITY),e||t.qa(Wg.Z_ORDER),t},U.prototype.addObject=U.prototype.Y,U.prototype.hd=function(t){var e;db(t,this.hd,0);var i=t.length;for(e=0;e<i;e++)this.Y(t[e])},U.prototype.addObjects=U.prototype.hd,U.prototype.Oa=function(t){if(!t||t.Na!==this)throw new vb(this.Oa,"object not found");var e=t.previousSibling,i=t.nextSibling;return e.nextSibling=i,i.previousSibling=e,t.Na=null,M.g.ea.call(t,null),delete t.previousSibling,delete t.nextSibling,B(t.D,N)&&t.ti(null,this.Oa),this.ah--,t},U.prototype.removeObject=U.prototype.Oa,U.prototype.ug=function(t){var e;db(t,this.ug,0);var i=t.length;for(e=0;e<i;e++)this.Oa(t[e])},U.prototype.removeObjects=U.prototype.ug,U.prototype.ia=function(){var t=this.ab();this.ug(t)},U.prototype.removeAll=U.prototype.ia,U.prototype.ye=function(t){for(var e,i,r,n=this.ab(),o=0,s=n.length,a=[];o<s;o++)(r=n[o])instanceof U?(i=ah(this,e=t?t(r.getData()):r.getData(),!!t),(e={type:"Feature"}).properties=i,r.gi&&(e.id=r.gi),e.geometry={},e.geometry.type="GeometryCollection",e.geometry.geometries=Fm(this,r.ab()),a.push(e)):a.push(r.ye(t));return{type:"FeatureCollection",features:a}},U.prototype.toGeoJSON=U.prototype.ye,U.prototype.P=function(){var t=U.g.P.call(this);return t.type="Group",t},U.prototype.forWorkerMessage=U.prototype.P,u(Gm,R),t("H.map.provider.ObjectProvider",Gm),Gm.prototype.qr=te,Gm.prototype.providesByViewport=Gm.prototype.qr,Gm.prototype.Mc=function(t){return this.Wf[t||Yg.ANY]},Gm.prototype.getInvalidations=Gm.prototype.Mc,Gm.prototype.Hh=function(t,e){if(e!==Wg.NONE){var i=this.Wf[Yg.ANY],r=i.Kd+1;i.update(r,e),(i=this.Wf[t.type]).update(r,e),t.Mc().update(r,e),this.hb(t)}},Gm.prototype.invalidateObject=Gm.prototype.Hh,Gm.prototype.requestOverlays=Gm.prototype.wg,Gm.prototype.requestSpatials=Gm.prototype.Pn,Gm.prototype.requestSpatialsByTile=Gm.prototype.Qn,Gm.prototype.yw=!1,Gm.prototype.requestMarkers=Gm.prototype.pe,Gm.prototype.requestDomMarkers=Gm.prototype.oe,u(Hm,sf),Hm.prototype.Ml=function(t){for(var e,i,r=this.head,n=t;n;){if(t=n.entries)if(e=t.length){if(2>e&&(i=n.parent)&&1===i.fb){i.removeChild(n),r===n&&(r=i),i.entries=t,n=t[0].node=i;continue}}else if(delete n.entries,(i=n.parent)&&(i.removeChild(n),r===n&&(r=i),1===i.fb)){n=i.fb?i[0]||i[1]||i[2]||i[3]:null;continue}break}this.head!==r&&(this.head=r,this.jd())},Hm.prototype.Yd=function(t,e){if(zf(this.root,t,e,t,e))return this.Vb(this.root,t,e,this.Ph);throw Error("Coordinates out of bounds")},Hm.prototype.Vb=function(t,e,i,r){var n=t.entries;if(r)if(t.fb)n=this.Tj(t,e,i,r);else if(n){n=n[0];var o=t.th(+(n[1]>=t[8])|+(n[0]>=t[9])<<1);o.entries=t.entries,delete t.entries,n.node=o,this.jd(o),n=this.Tj(t,e,i,r)}else t.Qg(n=new Im(e,i)),this.jd(t),vf(this,n,!0);else n||this.jd(t),t.Qg(n=new Im(e,i)),vf(this,n,!0);return n},Hm.prototype.Tj=function(t,e,i,r){return this.Vb(t.th(+(e>=t[8])|+(i>=t[9])<<1),e,i,r-1)},Im.prototype.Nf=function(t){return this[t%2]},m=Jm.prototype,m.jc=0,m.J=null,m.C=function(){var t,e=this.J;return!e&&(t=tf(this.Ae))&&(this.J=e=new J(-t[0],t[3],-t[2],t[1])),e},m.Yd=function(t){return++this.jc,this.J=null,this.Ae.Yd(t.lng,-t.lat)},m.remove=function(t){return(t=this.Ae.remove(t))&&(--this.jc,this.J=null),t}
2,m.Gm=function(t,e,i){var r=this.Ae,n=t.Nc(),o=t.Lc(),s=-n.lat;n=n.lng;var a=-o.lat;return o=o.lng,t.pc()?r.nb(-180,s,o,a,i,e).concat(r.nb(n,s,180,a,i,e)):r.nb(n,s,o,a,i,e)},u(N,Gm),t("H.map.provider.LocalObjectProvider",N),N.prototype.getCapabilities=function(){return Qi.PROVIDES_BY_VIEWPORT|Qi.PROVIDES_WEBGL_RENDERABLE_OBJECTS|Qi.PROVIDES_DOM_MARKERS|Qi.CROP_LINES_BY_TILE},N.prototype.lb=function(){if(!this.Vi&&(this.Vi=N.g.lb.call(this),this.Vi instanceof Ei)){var t=new Vi(this.getCapabilities()|Qi.HAS_VOLATILE_DATA,this.uid+"_vol",this.min,this.max,this.Rc,this.tileSize);this.Vi.gk(t.Je())}return this.Vi},N.prototype.getStyleInternal=N.prototype.lb,N.prototype.Wa=function(t,e){N.g.Wa.call(this,t,e),this.Vi=null},N.prototype.setStyleInternal=N.prototype.Wa,N.prototype.qd=function(){return this.Ag},N.prototype.getRootGroup=N.prototype.qd,N.prototype.Hh=function(t,e){e&Wg.SPATIAL&&this.Y(t),N.g.Hh.call(this,t,e)},N.prototype.invalidateObject=N.prototype.Hh,N.prototype.Y=function(t){var e;if(B(t,M,this.Y,0),t.D!==this)throw new vb(this.Y,"foreign object");this.Oa(t);var i=t.type;if(i===Yg.MARKER)if((e=t.V())instanceof Ye){var r=!0;i=this.fk}else i=this.kk;else i===Yg.DOM_MARKER?(e=t.V())instanceof Ye?(r=!0,i=this.cm):i=this.$m:i=i===Yg.OVERLAY?this.sk:this.xi;(r=r?i.Yd(e):i.Ju(t.C())).As=t,t.ys=r},N.prototype.Oa=function(t){var e;if(t)if(t.D!==this){if(B(t,M))throw new vb(this.Oa,"foreign object")}else if(e=t.ys){var i=t.type;i===Yg.MARKER?this.fk.remove(e)||this.kk.remove(e):i===Yg.DOM_MARKER?this.cm.remove(e)||this.$m.remove(e):i===Yg.OVERLAY?this.sk.remove(e):this.xi.remove(e),delete e.As,delete t.ys}},N.prototype.removeObject=N.prototype.Oa,N.prototype.sr=function(){return 0<this.sk.jc},N.prototype.providesOverlays=N.prototype.sr,N.prototype.wg=function(t,e,i){return Km(this,this.sk,t,e,i,!1).filter(function(t){return t.Se()})},N.prototype.requestOverlays=N.prototype.wg,N.prototype.me=function(){return 0<this.xi.jc},N.prototype.providesSpatials=N.prototype.me,N.prototype.Pn=function(t,e,i){return Km(this,this.xi,t,e,i,!1)},N.prototype.requestSpatials=N.prototype.Pn,N.prototype.Qn=function(t,e){return Km(this,this.xi,t.om(),t.zL,e,!1)},N.prototype.requestSpatialsByTile=N.prototype.Qn,N.prototype.Vc=function(){return 0<this.fk.jc+this.kk.jc},N.prototype.providesMarkers=N.prototype.Vc,N.prototype.pe=function(t,e,i){return Lm(this,t,e,i,!1)},N.prototype.requestMarkers=N.prototype.pe,N.prototype.Uc=function(){return 0<this.cm.jc+this.$m.jc},N.prototype.providesDomMarkers=N.prototype.Uc,N.prototype.oe=function(t,e,i){return Mm(this,t,e,i,!1)},N.prototype.requestDomMarkers=N.prototype.oe,N.prototype.ab=function(t,e,i,r,n){var o=this,s=t.C(),a=[],l=Pc(),c=1;if(s)for(;c&Yg.ANY;){if(c&r)switch(c){case Yg.MARKER:l=l.then(function(){return Lm(o,s,i,e,!0)}).then(function(e){return Qm(e,t,a)});break;case Yg.DOM_MARKER:l=l.then(function(){return Mm(o,s,i,e,!0)}).then(function(e){return Qm(e,t,a)});break;case Yg.SPATIAL:l=l.then(function(){return Km(o,o.xi,s,i,e,!0)}).then(function(e){e.forEach(Nm.bind(null,t,a))});break;case Yg.OVERLAY:l=l.then(function(){return Km(o,o.sk,s,i,e,!0)}).then(function(e){e.forEach(Nm.bind(null,t,a))})}c<<=1}l.then(function(){return n(a)})},N.prototype.Of=function(t,e,i){var r=(i=i||xe).zoom,n=i.visiblesOnly;i=i.types;var o=Yg.ANY;B(t,L,this.Of,0,"area"),ab(e,"Function",this.Of,1,"callback"),ab(r,"Number",this.Of,2,"options"),this.ab(t,!Ya(n)||!!n,r,Ya(i)?i&o:o,e)},N.prototype.getObjectsWithin=N.prototype.Of,N.prototype.disposeInternal=function(){N.g.disposeInternal.call(this),this.Ag.ia()},t("H.util.ICapturable",Rm),Rm.prototype.capture=function(){},Rm.prototype.capture=Rm.prototype.capture,u(Sm,kd),t("H.map.Imprint",Sm);var Um={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:""};function Tm(t,e,i,r,n){return t=t.createElement(e),i&&(t.style.cssText=i),r&&(t.innerHTML=r),n&&(t.className=n),t}Sm.prototype.Ur=function(t){var e,i=this.Hl.firstElementChild.firstElementChild.children;t||(this.av=Ma(Um));var r=this.av;for(e in r)t&&e in t&&(r[e]=t[e]);t=(this.nq=t=r.invert)?Wm:Xm,i[0].style.fill=t.fx,i[0].style.fillOpacity=""+t.gx,i[1].style.fill=t.tx,i[1].style.fillOpacity=""+t.ux,t=r.locale,Ym[t]||(t="en-US",r.locale=t),this.jo.innerHTML=Ym[t],t=t.split("-"),this.jo.href=r.href.replace("{LN}",t[0]).replace("{CN}",t[1].toLowerCase()),r.mark?(this.cg.innerHTML=r.mark,this.cg.style.margin="0px 8px"):(this.cg.innerHTML="",this.cg.style.margin="0px"),this.G.style.font=r.font},Sm.prototype.setOptions=Sm.prototype.Ur,Sm.prototype.B=function(){return this.G},Sm.prototype.Di=function(){this.Vl.innerHTML=this.Es+" "+this.U()},Sm.prototype.fe=function(){this.Di(),setTimeout(this.Di,5e3)};var Xm={tx:"#0F1621",ux:.3,fx:"#fff",gx:.6},Wm={tx:"#fff",ux:1,fx:"#0F1621",gx:.7},Zm="1987–"+yb(2015,(new Date).getFullYear())+" HERE";function $m(t,e,i,r){an(z(function(t){t?this.nq?i("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
2sJ7jKR2M77bG4kV7Wt9TZfBLgYEC7PSpcIAAAAAElFTkSuQmCC"):i("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=="):((t=this.Hl.cloneNode(!0)).firstChild.setAttribute("style","font:"+e),i(pe(t.innerHTML)))},t),r)}function an(t,e){var i="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>'),r=Vm;Ya(r)?t(r):new Me("image",i).then(function(e){le.drawImage(e,0,0);try{le.getImageData(0,0,1,1),r=!1}catch(t){r=18===t.code}finally{Vm=r,t(r)}},e)}Sm.prototype.U=function(){var t,e,i,r=this.s,n=r.Tb(),o=r.va.Hb().bounds,s=(r=r.O).aa.length,a={},l=0,c=[Zm];if(o)for(;l<s;
2l++)if(e=r.get(l).getCopyrights(o.C(),n))for(t=0;t<e.length;t++)a[i=e[t].label]||(c.push(i),a[i]=1);return c.join(", ")},Sm.prototype.getCopyrights=Sm.prototype.U,Sm.prototype.K=function(){return this.G.style},Sm.prototype.Es=String.fromCharCode(169),Sm.prototype.disposeInternal=function(){if(this.s.removeEventListener(this.s.j.Ms,this.Di),this.s.O.removeEventListener("add",this.fe),this.s.O.removeEventListener("remove",this.fe),this.s.O.removeEventListener("set",this.fe),this.G.parentNode){var t=this.G;t.parentNode.removeChild(t)}},Sm.prototype.disposeInternal=Sm.prototype.disposeInternal,Sm.prototype.capture=function(t,e,i,r){var n,o=t.getContext("2d"),s=window.getComputedStyle(this.Vl.parentElement),a=2*fb(s.paddingLeft,10),l=(this.Vl.offsetWidth+2*a)*e,c=this.Vl.offsetHeight*e,h=0!==this.cg.innerHTML.length?this.cg.offsetWidth*e:0,u=gb(s.getPropertyValue("font-size")),p=this.G.ownerDocument,d=+t.width,m=+t.height,f=16*e,g=this.Hl.childNodes[0].getBoundingClientRect(),y=g.width*e,v=g.height*e,_=ve;Wa(r)&&(_=function(){r("capture_error")}),o.fillStyle=s.backgroundColor,o.fillRect(d-l-h,m-c,l+h,c),l=this.cg.innerHTML,l=this.Es+" "+((n=Tm(p,"div",null,n=this.U())
2).textContent||n.innerText||"")+(l?" "+l:""),o.font=u*e+"px "+s.getPropertyValue("font-family"),o.fillStyle=s.getPropertyValue("color"),o.textBaseline="bottom",o.textAlign="right",o.fillText(l,d-a*e,m),$m(this,o.font,function(e){new Me("image",e).then(function(e){o.drawImage(e,f,m-(v+f),y,v),i(t)},_)},_)},Sm.prototype.capture=Sm.prototype.capture,Sm.prototype.nq=!1,Sm.prototype.ly=function(t,e){Ym[t]=e},Sm.prototype.addL11NString=Sm.prototype.ly;var Ym={"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 Åwiadczenia usÅugi","pt-BR":"Termos de serviço","pt-PT":"Termos do serviço","ru-RU":"УÑÐ»Ð¾Ð²Ð¸Ñ Ð¸ÑполÑзованиÑ","tr-TR":"Servis KoÅulları","zh-CN":"ä½¿ç¨æ¡æ¬¾"};function V(t,e,i){var r={};if(!(t instanceof HTMLElement))throw new C(V,0);if(V.g.constructor.call(this),this.Fa=bn(i,V),this.va=i=new ek,this.Fq=!1,i.addEventListener(i.j.Pi,this.Pv,!1,this),!B(t,Element))throw new C(V,0,t);var n=(i=this.G=t.ownerDocument.createElement("div")).style;if(n.position="relative",n.height=i.style.width="100%",n.overflow="hidden",n.webkitTapHighlightColor="transparent","transparent"!==n.webkitTapHighlightColor&&(n.webkitTapHighlightColor="rgba(0,0,0,0)"),t.appendChild(i),this.ra=new xk(this.G,this.Fa),this.ra.addEventListener(this.ra.j.Pi,this.Pv,!1,this),(t=this.O=new sk(this.Fa.layers)).addEventListener(t.j.Ni,this.Rq,!1,this),t.addEventListener(t.j.Ki,this.Rq,!1,this),t.addEventListener(t.j.Mi,this.Rq,!1,this),!this.pb&&cn(this),this.oa=null,this.O.add(e,0),this.wa=this.$o(null!=this.Fa.engineType?this.Fa.engineType:Wi,this.Fa),this.nn=z(this.nn,this),this.wa.addEventListener(yk.prototype.j.Oi,this.nn),this.lp=z(this.lp,this),(e=this.Fa.imprint)!==A&&"object"!=typeof e)throw new C(V,1,"imprint");this.Xd=null===e?e:new Sm(this,e),e=this.Fa.autoColor,this.ft=e===A||!!e,dn(this),(e=this.Fa.zoom)&&(r.zoom=e),(e=this.Fa.bounds)&&(r.bounds=e),(e=this.Fa.center)&&(r.position=e),this.va.$c(r)}function bn(t,e){if(t){var i=t.pixelRatio;if(i===A)t.pixelRatio=he();else if(!(0<i))throw new C(e,0,"pixelRatio: "+i)}else(t={}).pixelRatio=he();return t.renderBaseBackground||(t.renderBaseBackground={lower:3,higher:2}),t}function dn(t){t.Xd&&t.ft&&t.Xd.Ur({invert:t.oa&&t.oa.Py})}function en(t,e,i){t.dispatchEvent(i?new Bj(t.j.Ls,i.newValue,i.oldValue,i.modifiers):t.j.Ls+e)}function fn(t){Dj.call(this,t)}function cn(t){t.rc=new N({max:24,engineType:t.Fa.engineType}),t.pb=new $k(t.rc,t.Fa),t.O.add(t.pb)}u(V,I),t("H.Map",V),m=V.prototype,m.draggable=V.prototype.draggable=!1,m.gy=333,m.disposeInternal=function(){this.ft=!1,this.Xd&&this.Xd.l(),this.wa.dispose(),this.va.l(),this.ra.l(),this.pb.l(),this.rc.l(),this.O.l();var t=this.G;t.parentNode.removeChild(t),delete this.G,this.wa.removeEventListener(yk.prototype.j.Oi,this.nn),I.prototype.disposeInternal.call(this)},m.nn=function(t){this.dispatchEvent(new Oi(V.prototype.j.dy,t.oldValue,t.newValue))},m.B=function(){return this.G},V.prototype.getElement=V.prototype.B,V.prototype.kb=function(){return this.Fa.pixelRatio},V.prototype.getPixelRatio=V.prototype.kb,V.prototype.Rq=function(t){var e=t.added,i=t.removed;e&&e.D&&e.D.ea(this),i&&i.D&&i.D.ea(null),i===this.pb&&(delete this.pb,delete this.rc),i===this.oa&&(this.oa=null),0===t.idx&&(this.dispatchEvent(new Oi(this.j.yl,this.oa=t.type!==this.O.j.Mi?e:0<this.O.aa.length?this.O.get(0):x,t.type!==this.O.j.Ki?i:1<this.O.aa.length?this.O.get(1):x)),dn(this))},V.prototype.Pv=function(t){t.modifiers&&(this.Fq||(en(this,"start"),this.Fq=!0),en(this,"",t),this.rv&&globalThis.clearTimeout(this.rv),this.rv=globalThis.setTimeout(this.lp,this.gy))},V.prototype.lp=function(){en(this,"end"),this.Fq=!1},V.prototype.ao=function(t,e){return this.wa.getCapabilities().lookAt&&this.va.$c({position:t},!!e),this},V.prototype.setCenter=V.prototype.ao,V.prototype.vb=function(){var t=this.va.Hb();return t?t.position:x},V.prototype.getCenter=V.prototype.vb,V.prototype.Wk=function(t,e){return this.va.Wk(t,!!e),this},V.prototype.setZoom=V.prototype.Wk,V.prototype.Tb=function(){return this.va.Tb()},V.prototype.getZoom=V.prototype.Tb,V.prototype.Ng=function(t,e,
2i){this.wa.zoomAt(t,e,i)},V.prototype.zoomAt=V.prototype.Ng,V.prototype.SA=function(){return this.ra},V.prototype.getViewPort=V.prototype.SA,V.prototype.RA=function(){return this.va},V.prototype.getViewModel=V.prototype.RA,V.prototype.fA=function(){return this.O},V.prototype.getLayers=V.prototype.fA,V.prototype.$z=function(){return this.Xd},V.prototype.getImprint=V.prototype.$z,V.prototype.capture=function(t,e,i,r,n,o){function s(t,e){m?t.cancel():(c.save(),e.capture(l,p,function(e){c.restore(),t.done(e)},function(e){t.done(null,e),a(null)}))}function a(e){m||(m=!0,t(e))}var l,c,h=this.wa,u=h.getCapabilities(),p=this.Fa.pixelRatio,d=this.ra,m=!1,f=this;if(!Wa(t))throw new C(this.capture,0,t);i=i||0,r=r||0,n=n||d.width,o=o||d.height;var g=yb(0,xb(i,n)),y=yb(0,xb(r,o));i=xb(d.width,yb(i,n)),r=xb(d.height,yb(r,o)),u.capture?h.capture(g,y,i,r).then(function(t){var i=f.Xd,r=e||[];c=(l=t).getContext("2d"),l.style.width=l.width/p+"px",l.style.height=l.height/p+"px";var n=new zj(10,s);(r=r.concat(i).filter(function(t){return Wa(t&&t.capture)})).length?(t=r.pop(),r.forEach(function(t){n.push(t,ve)}),n.push(t,z(a,f,l)),n.Cn()):a(l)},function(){a(x)}):t(null)},V.prototype.capture=V.prototype.capture,V.prototype.Nz=function(){return this.wa},V.prototype.getEngine=V.prototype.Nz,V.prototype.$o=function(t,e){if(e=e?bn(e,this.$o):this.Fa,dn(this),t===Xi.P2D)return new globalThis.H.map.render.p2d.RenderEngine(this.ra,this.va,this.O,e);if(t===Xi.WEBGL)return new T(this.ra,this.va,this.O,e);if(t===Xi.HARP)return new globalThis.H.map.render.harp.RenderEngine(this.ra,this.va,this.O,e);throw new C(this.$o,0,t)},V.prototype.bl=function(t,e,i,r,n){if(e=Ya(e)?B(e,J,this.bl,1,e)&&e:this.va.Hb().bounds.C(),!B(n=n||this.oa,hj))throw new C(this.bl,4);var o=n.D,s=this.kb(),a=n.tileSize;if(2<=s&&256<a&&o instanceof ck&&(a/=2),s=this.Tb(),a=Math.log2(a)-8,!((i=Ya(i)?+i:s)<=(r=Ya(r)?+r:s)))throw new C(this.bl,A,"!(min <= max)");s=o.min;var l=o.max,c=this.wa.type===Xi.WEBGL?Ab:zb;if(i=$b(c(i)-a,s,l),r=$b(c(r)-a,s,l),!(o&&B(o,S)&&ml()&&o.Wi()))throw new vb(this.bl,"Storing is not supported");return new Gj(n,o,e,i,r,t)},V.prototype.storeContent=V.prototype.bl,u(fn,Dj),fn.prototype.oC=function(){Fj(this,2)},fn.prototype.nC=function(){Fj(this,4)},V.prototype.Dy=function(t){return t=new fn(t),ll().clear(z(t.oC,t),z(t.nC,t)),t},V.prototype.clearContent=V.prototype.Dy,V.prototype.Cl=function(t,e){var i=this.O,r=i.indexOf(t),n=e!==+e;return e=n?i.aa.length-1:e,0>r?i.add(t,e):r-e&&(i.Cd(r),i.add(t,n?e-1:e)),this},V.prototype.addLayer=V.prototype.Cl,V.prototype.hi=function(t){var e=this.O.indexOf(t);return t!==this.oa&&t!==this.pb&&-1!==e&&this.O.Cd(e),this},V.prototype.removeLayer=V.prototype.hi,V.prototype.Cg=function(t){return this.oa!==t&&(this.O.aa.length&&this.O.get(0)!==this.pb?this.O.set(0,t):this.O.add(t,0),this.oa=t),this},V.prototype.setBaseLayer=V.prototype.Cg,V.prototype.zz=function(){return this.oa},V.prototype.getBaseLayer=V.prototype.zz,V.prototype.La=function(t){if(!Ze(t))throw new C(this.La,0,t);return(t=this.wa.geoToScreen(t))?fc(t):x},V.prototype.geoToScreen=V.prototype.La,V.prototype.Va=function(t,e){var i;if(i=+E(t)||2*+E(e))throw new C(this.Va,i-1,arguments[i-1]);return(i=this.wa.screenToGeo(t,e))?$e(i):x},V.prototype.screenToGeo=V.prototype.Va,V.prototype.Wn=function(t,e){return this.wa.screenToLookAtData(t,e)},V.prototype.screenToLookAtData=V.prototype.Wn,V.prototype.Y=function(t){if(!B(t,M))throw new C(this.Y,0,t);return!this.pb&&cn(this),this.rc.qd().Y(t),t},V.prototype.addObject=V.prototype.Y,V.prototype.Oa=function(t){if(!B(t,M))throw new C(this.Oa,0,t);return!this.pb&&cn(this),this.rc.qd().Oa(t),t},V.prototype.removeObject=V.prototype.Oa,V.prototype.ab=function(t){return!this.pb&&cn(this),this.rc.qd().ab(t)},V.prototype.getObjects=V.prototype.ab,V.prototype.hd=function(t){var e;db(t,this.hd,0,t),!this.pb&&cn(this);var i=t.length;for(e=0;e<i;e++)this.Y(t[e]);return this},V.prototype.addObjects=V.prototype.hd,V.prototype.ug=function(t){var e;db(t,this.ug,0,t),!this.pb&&cn(this);var i=t.length;for(e=0;e<i;e++)this.Oa(t[e]);return this},V.prototype.removeObjects=V.prototype.ug,V.prototype.Bh=function(t,e,
2i){var r;if(r=+E(t)||2*+E(e))throw new C(this.Bh,r-1,arguments[r-1]);this.wa.getObjectsAt(t,e,!0,function(t){i(t[0])})},V.prototype.getObjectAt=V.prototype.Bh,V.prototype.Ma=function(t,e,i,r){var n;if(n=+E(t)||2*+E(e))throw new C(this.Bh,n-1,arguments[n-1]);this.wa.getObjectsAt(t,e,!1,i,!!r)},V.prototype.getObjectsAt=V.prototype.Ma,V.prototype.Of=function(t,e,i){var r=(i=i||{}).zoom;i.zoom=Ya(r)?r:this.va.Tb(),this.rc.Of(t,e,i)},V.prototype.getObjectsWithin=V.prototype.Of;var gn=Hk.HARP,Xi={P2D:Hk.P2D,WEBGL:Hk.WEBGL,HARP:gn};V.EngineType=Xi,V.EngineState={IDLE:0,BUSY:1},V.prototype.j={dy:"enginestatechange",TD:"mapviewchangestart",Ls:"mapviewchange",Ms:"mapviewchangeend",yl:"baselayerchange"},t("H.buildInfo",function(){return Ig("H-core","1.64.3","4cd9a8f",{region:"row"})});var Wi=Xi.WEBGL,hn,jn="maps".concat("js-"),kn,ln,mn,nn,on;if(kn=globalThis.document.querySelector('script[src*="'+jn+'"]'),!kn)for(ln=globalThis.document.getElementsByTagName("script"),nn=new RegExp("^.*"+jn),on=0,mn=ln.length;on<mn;on++)if(nn.test(ln[on].src)){kn=ln[on];break}function pn(){var t=decodeURIComponent(hn);if(t){t="/"===t[t.length-1]?t.substring(0,t.length-1):t;var e=globalThis.document,i="";e?((e=e.createElement("a")).href=t,i=e.href):/[\w]+:\/\//.test(t)&&(i=t),(t=new URL(i)).pathname+="/"===t.pathname[t.pathname.length-1]?"styles":"/styles",t=t.toString()}else t="https://js.api.here.com/v3/3.1.64.3/styles";return t}function qn(t,e,i,r,n,o,s){qn.g.constructor.call(this,t),this.pointers=e,this.changedPointers=i,this.targetPointers=r,this.currentPointer=n,this.originalEvent=s,this.target=o}function rn(t,e){var i;if(e=void 0===e?{}:e,rn.g.constructor.call(this),-1!==sn.indexOf(t))throw new C(rn,0,"events are already used");this.s=i=t.s,this.pv=t,sn.push(t),i.draggable=!0,this.ua=e.kinetics||{duration:600,ease:Jl},this.OB=e.modifierKey||"Alt",this.enable(e.enabled),this.Fi=i.ra,this.tl=this.Fi.element,this.Sm=0,i.addEventListener("dragstart",this.Ad,!1,this),i.addEventListener("drag",this.hg,!1,this),i.addEventListener("dragend",this.df,!0,this),i.addEventListener("wheel",this.Wv,!1,this),i.addEventListener("dbltap",this.Jv,!1,this),i.addEventListener("pointermove",this.he,!1,this),Ad(this.tl,"contextmenu",this.cn,!1,this),t.bc(this.l,this)}hn=kn?kn.src.replace(/\/[^\/]*$/,"/"):"",t("H.getScriptPath",function(){return hn}),t("H.getStylePath",pn),u(qn,nd),t("H.mapevents.Event",qn),u(rn,kd),t("H.mapevents.Behavior",rn);var sn=[];kb(sn),rn.prototype.Qb=0;var tn={PANNING:1,PINCH_ZOOM:2,WHEEL_ZOOM:4,DBL_TAP_ZOOM:8,FRACTIONAL_ZOOM:16,TILT:32,HEADING:64};rn.Feature=tn;var un=tn.PANNING,vn=tn.PINCH_ZOOM,wn=tn.WHEEL_ZOOM,xn=tn.DBL_TAP_ZOOM,yn=tn.FRACTIONAL_ZOOM,zn=tn.TILT,An=tn.HEADING,Bn=un|vn|wn|xn|yn|zn|An;function Cn(t,e){if(t!==+t||t%1||0>t||2147483647<t)throw new C(e,0,"integer in range [0...0x7FFFFFFF] required")}function Dn(t,e,i){var r,n="touch"===e.currentPointer.type,o=0;if(r=!n){r=t.OB;var s=e.originalEvent;r=s.getModifierState?s.getModifierState(r):!!s[r.replace(/^Control$/,"ctrl").toLowerCase()+"Key"]}return r?o|=zn|An:(o|=un,n&&2===(e=e.pointers).length&&(o|=vn|An,i?55>Cb(e[0].viewportY-e[1].viewportY)&&(o|=zn):t.hq&Bk.TILT&&(o|=zn))),((o&=t.Qb)&zn?Bk.TILT:0)|(o&An?Bk.HEADING:0)|(o&vn?Bk.ZOOM:0)|(o&un?Bk.COORD:0)}function En(t){var e=t.pointers;return t=e[0],e=e[1],t=[t.viewportX,t.viewportY],e&&t.push(e.viewportX,e.viewportY),t}function Fn(t){var e=t.ownerDocument;e=e.documentElement||e.body.parentNode||e.body;try{var i=t.getBoundingClientRect()}catch(t){i={top:0,right:0,bottom:0,left:0,height:0,width:0}}return{x:i.left+("number"==typeof window.pageXOffset?window.pageXOffset:e.scrollLeft),y:i.top+("number"==typeof window.pageYOffset?window.pageYOffset:e.scrollTop)}}function Gn(t,e,i,r,n,o){if(isNaN(t))throw Error("x needs to be a number");if(isNaN(e))throw Error("y needs to be a number");if(isNaN(i))throw Error("pointer must have an id");this.viewportX=t,this.viewportY=e,this.target=null,this.id=i,this.type=r,this.dragTarget=null,this.button=Ya(n)?n:-1,this.buttons=Ya(o)?o:0,this.Qm=this.button}function Hn(t,e,i){if(isNaN(e))throw Error("x needs to be a number");if(isNaN(i))throw Error("y needs to be a number");t.viewportX=e,t.viewportY=i}function In(t,e){t.Qm=e,t.buttons|=Jn[+e]||0}function Kn(t,e){t.Qm=e,t.buttons&=~(Jn[+e]||0)}rn.DRAGGING=un,rn.WHEELZOOM=wn,rn.DBLTAPZOOM=xn,rn.FRACTIONALZOOM=yn,rn.prototype.disable=function(t){var e=this.Qb;t!==A?(Cn(t,this.disable),e^=e&t):e=0,this.Fi.endInteraction(!0),this.Qb=e,this.s.draggable=0<(e&(un|zn|An|vn))},rn.prototype.disable=rn.prototype.disable,rn.prototype.enable=function(t){var e=this.Qb;t!==A?(Cn(t,this.enable),e|=t&Bn):e=Bn,this.Qb=e,this.s.draggable=0<(e&(un|zn|An|vn))},rn.prototype.enable=rn.prototype.enable,rn.prototype.isEnabled=function(t){return Cn(t,this.isEnabled),t===(this.Qb&t)},rn.prototype.isEnabled=rn.prototype.isEnabled,m=rn.prototype,m.hq=0,m.Ad=function(t){var e=Dn(this,t,!0);if(this.hq=e){var i=this.Fi;if(t=En(t),i.startInteraction(e,this.ua),i.interaction.apply(i,t),this.Qb&wn&&!(this.Qb&yn)&&(e=t[0],i=t[1],this.Sm)){t=this.s.Tb();var r=(0>this.Sm?Bb:Ab)(t);t!==r&&(this.Sm=0,this.Ii(t,r,e,i))}}},m.hg=function(t){var e=Dn(this,t,!1);if(e!==this.hq)"pointerout"!==t.originalEvent.type&&"pointerover"!==t.originalEvent.type&&(this.df(t),this.Ad(t));else if(e){e=this.Fi;var i=En(t);e.interaction.apply(e,i),t.originalEvent.preventDefault()}},m.df=function(t){Dn(this,t,!1)&&this.Fi.endInteraction(!this.ua)}
2,m.Ii=function(t,e,i,r){var n=this.s.va;if(isNaN(+t))throw Error("start zoom needs to be a number");if(isNaN(+e))throw Error("to zoom needs to be a number");0!==+e-+t&&(n.startControl(null,i,r),n.control(0,0,6,0,0,0),n.endControl(!0,function(t){t.zoom=e}))},m.Vv=function(t){return t},m.Uv=-1/0,m.Rv=0,m.Tv=[],m.Sv=0,m.Wv=function(t){var e=this;if(!t.defaultPrevented&&this.Qb&wn){var i=t.originalEvent,r=i.deltaY,n=Math.abs(r),o=this.Sv,s=!!(this.Qb&yn),a=this.Tv,l=i.timeStamp,c=$b(l-this.Uv,5,150);if(this.Uv=l,l=window.devicePixelRatio,this.s.wa.type===Xi.P2D)r=this.s.Tb(),o=t.delta,i=s?r-o:(0>-o?Bb:Ab)(r)-o,this.Ii(r,i,t.viewportX,t.viewportY),this.Sm=o;else{if(150<=c){o=0;var h=function(t){return t},u=!(r%1);i.ctrlKey&&!u?(o=1,h=function(t){return t*(Vd?40:20)}):Td&&u&&(!Pd||n%16)?(o=2,h=function(t){return Math.pow(t,1.5)}):Ud&&100>n?(o=3,h=function(t){return s?Math.pow(t+1,2):.4*(t+1)}):Vd&&(Pd&&n%138||Qd&&n*l%120)?o=4:Td?Pd&&16<=n&&!(n%16)?(o=6,h=function(t){return 1.5*Math.pow(t/16,1.937)}):(Qd||Rd||Od)&&4.000244140625===n&&(o=7,h=function(t){return t/n}):(Ud&&!(n%100&&(!Pd||n%102))||Vd&&(Qd&&!(n*l%120)||Pd&&!(n%138)))&&(o=8,a.length=0,h=function(t){var i=e.Tv,r=i.length;return r=1<r?i.reduce(function(t,e,i){return i?t+e:0},0)/(r-1):i[0],t/n*5*Math.pow(150/r,1+xb(7,i.length)/(150/r))}),this.Sv=o,this.Vv=h}8===o&&a.push(c),i=1===o,a=xb((o=2===o||3===o||4===o)?100:200,this.Vv(n));var p=this.s.va;p.startControl(null,t.viewportX,t.viewportY);var d=0>r?-1:1;p.control(0,0,.1*-d*(s?a:5*$b(a,5,33)),0,0,0);var m=i||o&&!Vd;clearTimeout(this.Rv),this.Rv=setTimeout(function(){p.endControl(m,function(t){s||(t.zoom=(0>d?Bb:Ab)(t.zoom))})},150)}t.preventDefault()}},m.he=function(){},m.Jv=function(t){var e=t.currentPointer,i=this.s.Tb(),r=t.currentPointer.type,n=this.s.wa.type;(n===Xi.P2D||n===Xi.WEBGL||n===Xi.HARP)&&this.Qb&xn&&(t="mouse"===r?0===t.originalEvent.button?-1:1:0<t.pointers.length?1:-1,t=this.Qb&yn?i-t:(0>-t?Bb:Ab)(i)-t,this.Ii(i,t,e.viewportX,e.viewportY))},m.cn=function(t){return!(this.Qb&xn&&(t.preventDefault(),1))},m.l=function(){var t=this.s;t&&(t.draggable=!1,t.removeEventListener("dragstart",this.Ad,!1,this),t.removeEventListener("drag",this.hg,!1,this),t.removeEventListener("dragend",this.df,!0,this),t.removeEventListener("wheel",this.Wv,!1,this),t.removeEventListener("dbltap",this.Jv,!1,this),t.removeEventListener("pointermove",this.he,!1,this),delete this.s),this.tl&&(this.tl.style.msTouchAction="",Jd(this.tl,"contextmenu",this.cn,!1,this),delete this.tl),delete this.Fi,delete this.ua,sn.splice(sn.indexOf(this.pv),1),delete this.pv,kd.prototype.l.call(this)},rn.prototype.dispose=rn.prototype.l,t("H.mapevents.Pointer",Gn),Gn.prototype.cA=function(){return this.Qm},Gn.prototype.getLastChangedButton=Gn.prototype.cA;var Jn=[1,4,2],Ln={NONE:-1,LEFT:0,MIDDLE:1,RIGHT:2};function Mn(t){this.Ea=t instanceof Array?t.slice(0):[]}function Nn(t,e){return-1!==(e=t.indexOf(e))?t.Ea[e]:null}function On(t,e){for(var i=t.Ea.length,r=[];i--;)t.Ea[i].type!==e&&r.push(t.Ea[i]);t.Ea=r}function Pn(t,e){for(var i=t.Ea.length;i--;)if(t.Ea[i].dragTarget===e)return!0;return!1}function Qn(t,e,i){if(i=i||{},!(t instanceof V))throw Error("events: map instance required");if(!(e instanceof Array))throw Error("events: map array required");kd.call(this),this.hp=i.hp||300,this.xt=i.xt||50,this.rx=i.rx||50,this.sx=i.sx||500,this.Dq=i.Dq||900,this.Cq=i.Cq||8,this.map=t,this.Ba=this.map.ra,this.element=this.Ba.element,this.pp=e,this.pointers=new Mn,this.changedPointers=new Mn,this.Zf={},this.Ka=null,this.fm=!0,this.Ok={},this.rf={},this.ck=null,this.nj=z(this.nj,this),this.Ot={pointerdown:this.Xy,pointermove:this.Yy,pointerup:this.Zy,pointercancel:this.Wy},Rn(this)}function Rn(t,e){var i,r=t.pp.length;for(i=0;i<r;i++){var n=t.pp[i],o=n.listener;"function"==typeof o&&(e?(n.target||t.element).removeEventListener(n.Za,o):(n.target||t.element).addEventListener(n.Za,o))}}function Sn(t,e,i){var r;if("function"==typeof t.Ot[e]){"pointermove"!==e&&(t.fm=!0);var n=0;for(r=t.changedPointers.length();n<r;n++){var o=t.changedPointers.item(n);
2t.element.contains(i.composedPath()[0])?Tn(t,o,t.Gt.bind(t,i,e,o)):t.Gt(i,e,o,null)}}t.changedPointers.clear()}function Tn(t,e,i){if(t.Ka===e)i(e.target);else{var r=t.Ba,n=e.viewportX;if(e=e.viewportY,0>n||0>e||n>=r.width||e>=r.height)i(x);else{var o=t.map;o.Bh(n,e,function(t){i(t||o)})}}}function Vn(t,e,i){e===t.Ka&&(Wn(t,e.dragTarget,"dragend",i,e),t.Ka=null,Un(e.id,t.Ok)),e.dragTarget=null}function Un(t,e){e[t]&&(e[t].timeout?clearTimeout(e[t].timeout):clearTimeout(e[t]),delete e[t])}function Xn(t,e,i){var r=e.target,n=new F(e.viewportX,e.viewportY),o=e.id;Un(o,t.rf);var s=setTimeout(function(){r&&r===e.target&&n.ib({x:e.viewportX,y:e.viewportY})<t.Cq&&(Wn(t,r,"longpress",i,e),delete t.Zf[e.id])},t.Dq);t.rf[o]={timeout:s,wk:n}}function Wn(t,e,i,r,n){if(e&&"function"==typeof e.dispatchEvent){var o,s=qn,a=t.pointers.Sa(),l=t.changedPointers.Sa(),c=(t=t.pointers).Ea.length,h=[];for(o=0;o<c;o++)t.Ea[o].target===e&&h.push(t.Ea[o]);s=new s(i,a,l,h,n,e,r),n.button=/^(?:longpress|(?:dbl)?tap|pointer(?:down|up))$/.test(i)?n.Qm:Ln.NONE,e.dispatchEvent(s)}return s}function Yn(t){this.Gh=z(this.Gh,this),Qn.call(this,t,[{Za:"touchstart",listener:this.Gh},{Za:"touchmove",listener:this.Gh},{Za:"touchend",listener:this.Gh},{Za:"touchcancel",listener:this.Gh}]),this.Fx={touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",touchcancel:"pointercancel"},this.Gu=(t=(t=t.Xd)?t.B():null)?Array.prototype.slice.call(t.querySelectorAll("a"),0):[]}function Zn(t){this.Tf=z(this.Tf,this),Qn.call(this,t,[{Za:"mousedown",listener:this.Tf},{Za:"mousemove",listener:this.Tf,target:window},{Za:"mouseup",listener:this.Tf,target:window},{Za:"mouseover",listener:this.Tf},{Za:"mouseout",listener:this.Tf},{Za:"dragstart",listener:this.mC}])}function $n(t,e,i,r,n){$n.g.constructor.call(this,"wheel"),this.delta=t,this.viewportX=e,this.viewportY=i,this.target=r,this.originalEvent=n}function ao(t){var e="onwheel"in document;this.fy=e,this.cy=(e?"d":"wheelD")+"elta",this.aq=z(this.aq,this),ao.g.constructor.call(this,t,[{Za:(e?"":"mouse")+"wheel",listener:this.aq}]),this.ra=this.map.ra}function bo(t,e,i,r){bo.g.constructor.call(this,"contextmenu"),this.items=[],this.viewportX=t,this.viewportY=e,this.target=i,this.originalEvent=r}function co(t){this.Xp=z(this.Xp,this),this.Zp=z(this.Zp,this),this.Yp=z(this.Yp,this),this.sn=!1,this.ih=-1,this.fv=0,co.g.constructor.call(this,t,[{Za:"contextmenu",listener:this.Xp},{target:t,Za:"longpress",listener:this.Zp},{target:t,Za:"dbltap",listener:this.Yp}])}function eo(t,e,i,r,n){var o=t.map,s=Date.now()-t.fv;n?!t.sn&&s>t.Dq&&(t.sn=!0,n.dispatchEvent(new bo(e,i,n,r)),Cd(o.B(),fo,t.Ft,!1,t)):o.Bh(e,i,t.Mp.bind(t,e,i,r))}Gn.Button=Ln,m=Mn.prototype,m.clear=function(){this.Ea.splice(0,this.Ea.length)},m.length=function(){return this.Ea.length},m.item=function(t){return this.Ea[t]||null},m.indexOf=function(t){for(var e=this.Ea.length;e--;)if(this.Ea[e].id===t)return e;return-1},m.remove=function(t){return-1!==(t=this.indexOf(t))?this.Ea.splice(t,1)[0]:null},m.push=function(t){if(t instanceof Gn)return this.Ea.push(t);throw Error("list needs a pointer")},m.Sa=function(){return this.Ea},m.clone=function(){return new Mn(this.Ea)},u(Qn,kd),m=Qn.prototype,m.Gt=function(t,e,i,r){Un(i.id,this.Ok),this.Ot[e].call(this,i,r,t)},m.Zy=function(t,e,i){var r=t.id;t.target=e,Vn(this,t,i),Wn(this,e,"pointerup",i,t),"mouse"!==t.type&&Wn(this,e,"pointerleave",i,t),e=this.Zf[t.id];var n={x:t.viewportX,y:t.viewportY},o=i.timeStamp,s=t.target,a=this.ck;e&&e.target===s&&e.wk.ib(n)<this.rx&&o-e.os<this.sx?(Wn(this,s,"tap",i,t),a&&a.target===s&&o-a.os<this.hp?a.wk.ib({x:t.viewportX,y:t.viewportY})<this.xt&&(Wn(this,s,"dbltap",i,t),this.ck=null):this.ck={target:s,wk:new F(t.viewportX,t.viewportY),os:i.timeStamp}):this.ck=null,this.Zf={},Un(r,this.rf)},m.nj=function(t,e){var i=this;Wn(this,t.dragTarget,"drag",e,t),Un(t.id,this.Ok),this.Ok[t.id]=setTimeout(function(){i.nj(t,e)},150)},m.Yy=function(t,e,i){var r=t.dragTarget,n=t.id,o=t.target;t.target=e,o!==e&&(Wn(this,o,"pointerleave",i,t),Wn(this,e,"pointerenter",i,t)),r?this.Ka?(this.nj(t,i),this.rf[n]&&this.rf[n].wk.ib({x:t.viewportX,y:t.viewportY})>this.Cq&&Un(n,this.rf)):this.fm?this.fm=!1:(this.Ka=t,Wn(this,r,"dragstart",i,t),this.nj(t,i),delete this.Zf[n],this.fm=!0):(!this.Ka||this.Ka&&this.Ka.dragTarget!==e&&this.Ka.dragTarget!==this.map)&&Wn(this,e,"pointermove",i,t)}
2,m.Xy=function(t,e,i){var r=!(/^(?:mouse|pen)$/.test(t.type)&&0!==i.button);if(e){t.target=e,this.Zf[t.id]={wk:new F(t.viewportX,t.viewportY),target:t.target,os:i.timeStamp},"mouse"!==t.type&&Wn(this,e,"pointerenter",i,t);var n=Wn(this,e,"pointerdown",i,t);!this.Ka&&r&&(e.draggable&&!Pn(this.pointers,e)?t.dragTarget=e:!this.map.draggable||n.defaultPrevented||Pn(this.pointers,this.map)||(t.dragTarget=this.map)),Xn(this,t,i)}},m.Wy=function(t,e,i){var r=t.id;t.target=null,e?(Wn(this,e,"pointerleave",i,t),Wn(this,e,"pointercancel",i,t)):Wn(this,this.map,"pointercancel",i,t),Vn(this,t,i),this.Zf={},Un(r,this.rf)},m.disposeInternal=function(){Rn(this,!0),this.pointers.clear(),this.changedPointers.clear();var t,e=this.Ok;for(t in e)Un(t,e);for(var i in e=this.rf)Un(i,e);delete this.element,delete this.pp,delete this.pointers,delete this.changedPointers,delete this.map,this.ck=null,delete this.Zf,this.Ka=null,kd.prototype.disposeInternal.call(this)},u(Yn,Qn),Yn.prototype.Gh=function(t){var e,i=t.touches,r=this.pointers.length();if("touchstart"===t.type&&r>=i.length){for(r=this.pointers.clone(),e=i.length;e--;)r.remove(i[e].identifier);for(e=r.length();e--;)this.pointers.remove(r.item(e).id);this.changedPointers=r,Sn(this,"pointercancel",t),this.changedPointers.clear()}if(this.Fx[t.type]){i=Fn(this.Ba.element),r=t.type;var n,o=(e=t.changedTouches).length;for(this.changedPointers.clear(),n=0;n<o;n++){var s=e[n],a=Nn(this.pointers,s.identifier),l=s.pageX-i.x,c=s.pageY-i.y;if(a)if("touchmove"===r){s=Math.abs(a.viewportX-l);var h=Math.abs(a.viewportY-c);(1<s||1<h||1===s&&1===h)&&(Hn(a,l,c),this.changedPointers.push(a))}else"touchend"===r&&(this.pointers.remove(a.id),this.changedPointers.push(a),Kn(a,Ln.LEFT));else a=new Gn(l,c,s.identifier,"touch",Ln.LEFT,1),this.pointers.push(a),this.changedPointers.push(a)}Sn(this,this.Fx[t.type],t),-1===this.Gu.indexOf(t.target)&&t.preventDefault()}},Yn.prototype.disposeInternal=function(){this.Gu=null,Qn.prototype.disposeInternal.call(this)},u(Zn,Qn),Zn.prototype.bp=function(t){return t=new Gn(t.x,t.y,1,"mouse"),this.pointers.push(t),t},Zn.prototype.Tf=function(t){var e=t.type,i=Fn(this.element),r={x:t.pageX-i.x,y:t.pageY-i.y};i=this.pointers.item(0)||this.bp(r),this.changedPointers.push(i),Hn(i,r.x,r.y),/^mouse(?:move|over|out)$/.test(e)?Sn(this,"pointermove",t):(/^mouse(down|up)$/.test(e)&&(r=t.which-1,"up"===globalThis.RegExp.$1?Kn(i,r):In(i,r)),Sn(this,e.replace("mouse","pointer"),t)),this.changedPointers.clear()},Zn.prototype.mC=function(t){t.preventDefault()},u($n,nd),t("H.mapevents.WheelEvent",$n),u(ao,Qn),ao.prototype.normalize=function(t,e,i){var r,n=this.cy,o=t[n+(n+"Y"in t?"Y":"")];if(Od&&"rtl"===globalThis.getComputedStyle(this.ra.element).direction&&(e-=(globalThis.devicePixelRatio-1)*this.ra.width),o){var s=Math.abs,a=s(o);o=(!(r=t[n+"X"])||3<=a/s(r))&&(!(r=t[n+"Z"])||3<=a/s(r))?(+(0<o)-+(0>o))*(this.fy?1:-1):0}return new $n(o,e,i,null,t)},ao.prototype.aq=function(t){if(!t.Tx){var e=Fn(this.element);(e=this.normalize(t,t.pageX-e.x,t.pageY-e.y)).delta&&(t.stopImmediatePropagation(),t.preventDefault(),this.map.Bh(e.viewportX,e.viewportY,this.Mp.bind(this,e)))}},ao.prototype.Mp=function(t,e){var i,r,n=t.target=e||this.map;setTimeout(function(){n.dispatchEvent(t),t.defaultPrevented||(i=t.originalEvent,(r=new globalThis.WheelEvent("wheel",i)).Tx=!0,i.target.dispatchEvent(r))},0)},u(bo,nd),t("H.mapevents.ContextMenuEvent",bo),u(co,Qn),m=co.prototype,m.Zp=function(t){var e=t.currentPointer;"touch"===e.type&&1===t.pointers.length&&eo(this,e.viewportX,e.viewportY,t.originalEvent,t.target)},m.Yp=function(t){"touch"===t.currentPointer.type&&(this.fv=Date.now())},m.Xp=function(t){var e=this;-1===this.ih?this.ih=setTimeout(function(){var i=Fn(e.element),r=t.pageX-i.x;i=t.pageY-i.y,e.ih=-1,eo(e,r,i,t)},this.hp):(clearInterval(this.ih),this.ih=-1),t.preventDefault()},m.Mp=function(t,e,i,r){eo(this,t,e,i,r&&Wa(r.dispatchEvent)?r:this.map)},m.Ft=function(){this.sn&&(this.sn=!1,this.map.dispatchEvent(new nd("contextmenuclose",this.map)))},m.disposeInternal=function(){var t=this.map.B();clearInterval(this.ih),t&&Jd(t,fo,this.Ft,!1,this),Qn.prototype.disposeInternal.call(this)};var fo=["mousedown","touchstart","pointerdown","wheel"];function go(t){var e=ho(this);(window.PointerEvent||window.MSPointerEvent)&&e.push({Za:"MSHoldVisual",listener:"prevent"}),Qn.call(this,t,e)}function ho(t){var e,i,r=!!window.PointerEvent,n=[];return t.$p=z(t.$p,t),"MSPointerDown MSPointerMove MSPointerUp MSPointerCancel MSPointerOut MSPointerOver".split(" ").forEach(function(o){e=o.toLowerCase().replace(/ms/g,""),i=r?e:o,n.push({Za:i,listener:t.$p,target:/^pointer(up|move)$/.test(e)?window:null})}),n}u(go,Qn);var io={2:"touch",3:"pen",4:"mouse"};function jo(t){var e=t.ra.element.style;if(-1!==ko.indexOf(t))throw Error("InvalidArgument: map is already in use");this.s=t,ko.push(t),e.msTouchAction=e.touchAction="none",Sd||!window.PointerEvent&&!window.MSPointerEvent?(this.Ex=new Yn(this.s),this.Bv=new Zn(this.s)):this.Ex=new go(this.s),this.LD=new ao(this.s),this.Hy=new co(this.s),this.s.bc(this.l,this),kd.call(this)}go.prototype.bp=function(t,e){var i=t.pointerType;return"number"==typeof i&&(i=io[i]),t=new Gn(e.x,e.y,t.pointerId,i,t.button,t.buttons),this.pointers.push(t),t},go.prototype.$p=function(t){var e=window.PointerEvent?t.type:t.type.toLowerCase().replace(/ms/g,""),i=Fn(this.element),r=Nn(this.pointers,t.pointerId),n=t.pageX-i.x;i=t.pageY-i.y;var o=io[t.pointerType]||t.pointerType;Od&&"rtl"===globalThis.getComputedStyle(this.Ba.element).direction&&(n-=(globalThis.devicePixelRatio-1)*this.Ba.width),r||/^pointer(up|out|cancel)$/.test(e)||"touch"===o&&"pointerdown"!==e||(r=this.bp(t,{x:n,y:i})),r&&(/^pointer(up|cancel)$/.test(e)?("touch"===o&&this.pointers.remove(r.id),Kn(r,t.button)):"pointerdown"===e&&("touch"===t.pointerType&&(On(this.pointers,"mouse"),On(this.pointers,"pen")),In(r,t.button)),this.changedPointers.push(r),"pointermove"!==e?(Hn(r,n,i),Sn(this,/^pointer(over|out)$/.test(e)?"pointermove":e,t)):r.viewportX===n&&r.viewportY===i||(Hn(r,n,i),Sn(this,e,t))),this.changedPointers.clear()},u(jo,kd),t("H.mapevents.MapEvents",jo);var ko=[];function lo(t){return t=t.Td("_#-;,:","_#-;,:","_#-;,:"),new RegExp("^"+t.replace(/[.*+?^${}()|[\]\\\/]/g,"\\$&").replace(/_#-;,:/g,"\\d+")+"$")}function mo(t,e){return Oa.apply(null,arguments),t}function no(t,e){return(Wa(void 0)?(void 0)(t):void 0===t)?e:t}function oo(t,e){var i=globalThis.console;i&&i.warn&&(t=$a(t)+" is deprecated and will be removed soon. ",e&&(t+=e),i.warn(t))}kb(ko),jo.prototype.l=function(){delete this.s,this.Ex.l(),this.LD.l(),this.Hy.l(),this.Bv&&this.Bv.l(),ko.splice(ko.indexOf(this.s),1),kd.prototype.l.call(this)},jo.prototype.dispose=jo.prototype.l,jo.prototype.yz=function(){return this.s},jo.prototype.getAttachedMap=jo.prototype.yz,t("H.mapevents.buildInfo",function(){return Ig("H-mapevents","1.64.3","4cd9a8f",{region:"row"})}),S.prototype.$n=ca(3,function(t){var e=this.getCache(),i=this;if(t!==x){B(t,Lj,S.prototype.$n,0);var r=t}else r=Sj;r!==e&&e.ia(function(t,e,n){return!!i.cc(t)&&(r.add(t,e,n),!0)}),this.ht=r}),Ei.prototype.Yb=ca(2,function(t){this.rs=t,(t=this.getState())!==hi.INIT&&t!==hi.LOADING&&Li(this)});var po={};function qo(t,e){B(t,ro,qo,0);var i={};Object.assign(i,e),i.min=i.min||0,i.max=i.max||20,i.tileSize=i.tileSize||512,i.getURL=function(e,r,n){return t.Rf(e,r,n).clone().v({size:i.tileSize})},i.headers=i.headers||t.Ub,ck.call(this,i),this.$=t}function so(){}u(qo,ck),t("H.service.rasterTile.Provider",qo),qo.prototype.U=function(t,e){var i=this.$;return i.U().query(i.Ci.Tn+"."+i.K(),e,t)},qo.prototype.getCopyrights=qo.prototype.U,qo.prototype.Wi=function(){return ml()},qo.prototype.rd=function(){return ml()?ll():qo.g.rd.call(this)},so.prototype.pop=function(t){return this[t]||(this[t]=[]),this[t].pop()||document.createElement("canvas")},so.prototype.push=function(t,e){this[e]||(this[e]=[]),this[e].push(t)};var to=new so;function W(t,e,i,r,n,o){if(!t||!e)throw new C(W,A,'Parameters "scheme" and "host" must be specified');this.$r(t),this.Rk(e),this.vc(i),this.Wr(n),this.Sw(o),this.Uk(r)}function uo(t,e){var i,r,n,o=globalThis.document,s="";if(o){if(s=o.createElement("a"),e){var a=(i=o.getElementsByTagName("base")[0])&&i.href,l=o.head,c=i||l.appendChild(o.createElement("base"));c.href=e}s.href=t,s=s.href,e&&(i?i.href=a:l.removeChild(c))}else/[\w]+:\/\//.test(t)&&(s=t);if(t=(a=/(?:(\w+):\/\/)?(?:([^:]+):([^@/]*)@)?([^/:]+)?(?:[:]{1}([0-9]+))?(\/[^?#]*)?(\?[^#]+)?(#.*)?/.exec(s))[1],l=a[4],e=a[5],c=a[6],o=a[7],i=a[8],!a[2]&&l&&/@/.test(l)&&(l=l.split("@")[1]),a=W,c=c&&0<c.length?c.substr(1):"",s={},o)for(r=/([?&]?([^=&+]+))(=([^&]+))?/g;n=r.exec(o);
2)s[decodeURIComponent(n[2])]=n[4]?decodeURIComponent(n[4]):void 0;return new a(t,l,c,s,isNaN(+e)?void 0:+e,i&&0<i.length?i.substr(1):"")}function xo(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16)})}function wo(t){var e,i=[],r=t.Ga,n={};for(e in r){if(r.hasOwnProperty(e)&&"function"!=typeof r[e]){var o=t.Ga[e];n.Og=xo(e),B(o,yo)?o.lo.forEach(function(t){return function(e){i.push(t.Og+"="+xo(e))}}(n)):B(o,zo)?i.push(n.Og+"="+o.lo.map(function(t){return xo(t)}).join(o.Uy)):i.push(void 0===o?n.Og:n.Og+"="+xo(o))}n={Og:n.Og}}return 0<i.length?"?"+i.join("&"):""}function Ao(t){var e=Ig("H-service","1.64.3","4cd9a8f",{region:"row"});return t.Ga.xnlp="CL_JSMv3."+e.version,t}function vo(t){var e,i=0;for(e in t.Ga)if(t.Ga.hasOwnProperty(e)&&"function"!=typeof t.Ga[e]&&0<++i)break;return!i}function Bo(t,e){if(db(t))for(var i=0;i<t.length;i++){var r=t[i];if(!eb(r)&&!hb(r)){var n="The Array does not contain only strings and numbers";break}}else n="Not an Array";if(n)throw new C(e,0,t);return t}function yo(t){this.lo=Bo(t,yo)}function zo(t,e){if(this.lo=Bo(t,zo),!/^[!\$\(\)\*\+,;]$/.test(e))throw new C(zo,1,'Invalid delimiter "'+e+'"');this.Uy=e}function X(t){var e=(t=mo({},this.Sy,t)).apikey||t.apiKey,i=t.baseUrl;if(i=e?i?0:"baseUrl":"apikey")throw new C(X,0,'"'+i+'" must be specified');this.Vw(t.baseUrl),this.at=e,this.kd.v({apikey:e}),this.Ub=t.headers||{},this.$C=Ma(t.servicesConfig||{})}function Co(t,e){if(e=void 0===e?{}:e,!t.Im)throw new vb(t);Co.g.constructor.call(this);var i=Do(this,e);if(!i.baseUrl&&!i.platformBaseUrl)throw new C(t,0,'either "baseUrl" or "platformBaseUrl" must be specified');this.xc=(i.baseUrl?i.baseUrl:i.platformBaseUrl).clone(),(t=i.baseUrl?e:i).host&&this.xc.Rk(t.host),t.subDomain&&this.xc.sa(t.subDomain),t.path&&this.xc.vc(t.path),Ao(this.xc),this.Ub=i.headers||{}}function Do(t,e){return t=t.ya(),e?mo({},t,e):t}function Eo(t,e,i){return function(r){return"function"!=typeof r.json?Promise.reject(i(Fo(e,r))):r.json().then(function(e){return i(t.Ic(e))},function(){return i(Fo(e,r))})}}function Fo(t,e){return Error((e.statusText?"["+e.statusText+"] ":"")+t+" request failed")}function Go(t){Go.g.constructor.call(this,Go,t),this.Nw=Do(this,t).reverseSubDomain,oo(Go,"Use HERE Geocoding and Search API v7 instead.")}function Ho(t){oo(Ho,"Use HERE Geocoding and Search API v7 instead."),Ho.g.constructor.call(this,Ho,t)}function Io(t){Io.g.constructor.call(this,Io,t)}function Jo(t,e){if(!(e instanceof Blob))throw new C(t,1,"must be an instance of Blob");return(t=new FormData).append("file",e),t}function Ko(t){Ko.g.constructor.call(this,Ko,t),oo(Ko,"Use HERE Geofencing API v8 instead.")}function Lo(t){if(!t||!Wa(t.requestData))throw new C(Lo,0,"options.requestData");Lo.g.constructor.call(this,t),this.LC=t.requestData,this.AC=!!t.providesDomMarkers}function Mo(){this.td={}}t("H.service.util.eval",function(a){return eval(a)}),t("H.service.Url",W),W.parse=uo,W.prototype.clone=function(){var t,e={};for(t in this.Ga)e[t]=this.Ga[t];return new W(this.oi,this.Rj,this.hf,e,this.vk,this.Cb)},W.prototype.clone=W.prototype.clone,W.prototype.$r=function(t){if(!t||"string"!=typeof t)throw new C(this.$r,0,'The "scheme" parameter must be a non-empty string.');return this.oi=t,this},W.prototype.setScheme=W.prototype.$r,W.prototype.FA=function(){return this.oi},W.prototype.getScheme=W.prototype.FA,W.prototype.Rk=function(t){if(!t||"string"!=typeof t||"-"===t.charAt(0)||"."===t.charAt(0)||"."===t.charAt(t.length-1))throw new C(this.Rk,0,'The "host" parameter is not a valid host name.');return this.Rj=t,this},W.prototype.setHost=W.prototype.Rk,W.prototype.Yz=function(){return this.Rj},W.prototype.getHost=W.prototype.Yz,W.prototype.vc=function(t){return this.hf=t||void 0,this},W.prototype.setPath=W.prototype.vc,W.prototype.rA=function(){return this.hf},W.prototype.getPath=W.prototype.rA,W.prototype.Uk=function(t){if(t){if("object"!=typeof t)throw new C(this.Uk,0,'Parameter "params" must be an object.');this.Ga=t}else this.Ga={};return this},W.prototype.setQuery=W.prototype.Uk,W.prototype.Bu=function(){return!vo(this)},W.prototype.hasQuery=W.prototype.Bu,W.prototype.getQuery=function(){return this.Ga},W.prototype.getQuery=W.prototype.getQuery,W.prototype.Wr=function(t){if(void 0===t)this.vk=t;else{var e=$b(0|+t,0,65535);if(e!=t)throw new C(this.Wr,0,'Parameter "port" must be an integer in range [0...65535]');this.vk=e}return this},W.prototype.setPort=W.prototype.Wr,W.prototype.wA=function(){return this.vk},W.prototype.getPort=W.prototype.wA,W.prototype.Sw=function(t){return this.Cb=t||void 0,this},W.prototype.setAnchor=W.prototype.Sw,W.prototype.zp=function(){return this.Cb},W.prototype.getAnchor=W.prototype.zp,W.prototype.v=function(t){if("object"!=typeof t)throw new C(this.v,0,'Parameter "other" must be an object.');var e,i=this.Ga;for(e in t)t.hasOwnProperty(e)&&"function"!=typeof t[e]&&(i[e]=t[e]);return this},W.prototype.mergeQuery=W.prototype.v,W.prototype.sa=function(t){if(!t||"string"!=typeof t)throw new C(this.sa,0,'Parameter "subDomain" must be a non-empty string');return"."===t.substr(t.length-1)&&(t=t.substr(0,t.length-1)),this.Rk(t+"."+this.Rj)},W.prototype.addSubDomain=W.prototype.sa,W.prototype.A=function(t){if(!t||"string"!=typeof t)throw new C(this.A,0,'Parameter "subPath" must be a non-empty string');return this.vc((this.hf?this.hf+"/":"")+t)},W.prototype.addSubPath=W.prototype.A,W.prototype.toString=function(){return[this.oi+"://",this.Rj,this.vk?":"+this.vk:"",this.hf||!vo(this)||this.Cb?"/":"",this.hf?encodeURI(this.hf):"",wo(this),this.Cb?"#"+encodeURIComponent(this.Cb):""].join("")},W.prototype.toString=W.prototype.toString,W.MultiValueQueryParameter=yo,yo.prototype.QA=function(){return this.lo},yo.prototype.getValues=yo.prototype.QA,W.DelimitedQuerySubValues=zo,t("H.service.Platform",X),X.prototype.Sy={apikey:null,baseUrl:new W("https","hereapi.com")},X.prototype.Vw=function(t){this.kd=Ao(t.clone()),this.at=t=this.at,this.kd.v({apikey:t})},X.prototype.setBaseUrl=X.prototype.Vw,X.prototype.Kc=function(){return this.kd},X.prototype.getBaseUrl=X.prototype.Kc,X.prototype.Ja=function(t,e){try{return t.Im=!0,new t(mo({platformBaseUrl:this.Kc(),headers:this.Ub},this.$C[t.CONFIG_KEY]||{},e||{}))}finally{t.Im=!1}},X.prototype.createService=X.prototype.Ja,X.prototype.Zl=function(t,e,
2i){var r=this;if(!H.map.render.harp)throw Error("HARP engine module not found");if(!ya(t)&&!eb(t))throw new C(this.Zl,0,"is invalid: must be either a configuration object or a URL");if(!Wa(e))throw new C(this.Zl,1,"is invalid: must be a Function");if(!Wa(i))throw new C(this.Zl,2,"is invalid: must be a Function");var n=new H.map.render.harp.Style(t);n.addEventListener("change",function(){var t=n.getState();if(-1===t)i(Error("H.service.platform#createHybridLayers method failed to load style configuration"));else if(2===t){t={dark:!0};var o=r.Rp({resource:"background",queryParams:{style:"satellite.day"}}),s=n.Qd(),a={styles:[{technique:"raster",attr:{gamma:1,brightness:1}}]};s.definitions&&(void 0!==s.definitions["Satellite.Texture.Gamma"]&&(a.styles[0].attr.gamma=s.definitions["Satellite.Texture.Gamma"]),void 0!==s.definitions["Satellite.Texture.Brightness"]&&(a.styles[0].attr.brightness=s.definitions["Satellite.Texture.Brightness"])),o=new qo(o,{engineType:gn,style:new H.map.render.harp.Style(a)}),e({raster:new Ik(o,t),vector:r.Mj().md(n,{engineType:gn},t),traffic:r.Vp().md(n,{engineType:gn},t)})}}),n.load()},X.prototype.createHybridLayers=X.prototype.Zl,X.prototype.Yl=function(t,e,i,r,n,o){function s(t,e,n){e=t.sm(e),e=d?new Ei(e):new H.map.render.harp.Style(e);var s,a={engineType:c};return u&&u.politicalView&&(a.politicalView=u.politicalView),i&&(a.lg=i),r&&(a.lg2=r),o&&(a.pois=o),n&&(s={dark:n}),t.md(e,a,s)}function a(t,e,i,r,n){return t.Nd(e,i,m,r,f,1,n,h)}var l=this,c=Wi,h={crossOrigin:"anonymous"};if(ya(t)){var u=t;"crossOrigin"in u&&(h.crossOrigin=u.crossOrigin),t=u.tileSize,e=u.ppi,i=u.lg,r=u.lg2,n=u.style,o=u.pois,void 0!==u.engineType&&(c=u.engineType,h.engineType=c)}var p=c===Xi.HARP,d=c===Xi.WEBGL,m=t||512,f={};if(0>[72,250,320,500].indexOf(+e)){if(e!==A)throw new C(this.Yl,1,e)}else f.ppi=+e;if(i&&(f.lg=i),r&&(f.lg2=r),n&&(f.style=n),o&&(f.pois=!!o),p&&!H.map.render.harp)throw new C(this.Yl,0,"HARP engine is not supported, module not found");t={},n=this.Lp();var g=this.Lp({type:"aerial"}),y=this.Tp(),v=y.tt(f.lg?{lg:f.lg,i18n:!0,engineType:c}:{engineType:c});if(mo(t,{raster:{normal:{xbase:a(n,"xbasetile","normal.day","png8",!1),xbasenight:a(n,"xbasetile","normal.night","png8",!0),base:a(n,"basetile","normal.day","png8",!1),basenight:a(n,"basetile","normal.night","png8",!0),map:a(n,"maptile","normal.day","png8",!1),mapnight:a(n,"maptile","normal.night","png8",!0),trafficincidents:v,transit:a(n,"maptile","normal.day.transit","png8",!1),labels:a(n,"labeltile","normal.day","png",!1)},satellite:{xbase:a(g,"xbasetile","hybrid.day","jpg",!0),base:a(g,"basetile","hybrid.day","jpg",!0),map:a(g,"maptile","hybrid.day","jpg",!0),labels:a(g,"labeltile","hybrid.day","png",!0)},terrain:{xbase:a(g,"xbasetile","terrain.day","jpg",!1),base:a(g,"basetile","terrain.day","jpg",!1),map:a(g,"maptile","terrain.day","jpg",!1),labels:a(g,"labeltile","terrain.day","png",!1)}}}),p||d){mo(t,{vector:{normal:{traffic:y.st(void 0,c),trafficincidents:v}}}),g=this.Mj({queryParams:{content:"default,transit"}}),n=this.Vp(),y=this.Mj({queryParams:{content:"default,advanced_roads,advanced_pois,transit"}});var _=this.Mj({queryParams:{content:"default,hillshade,contours,transit"}});if(d)t.vector.normal.map=s(g,"omv/miami/normal.day.yaml"),t.vector.normal.truck=s(g,"omv/miami/truck.day.yaml");else if(p){t.vector.normal.map=s(g,"harp/oslo/normal.day.json"),t.vector.normal.truck=s(g,"harp/oslo/normal.day.json"),t.vector.normal.logistics=s(y,"harp/oslo/logistics.day.json"),t.vector.normal.logisticsnight=s(y,"harp/oslo/logistics.night.json"),v=s(_,"harp/oslo/topo.day.json"),_=s(_,"harp/oslo/topo.night.json"),t.vector.normal.topo=v,t.vector.normal.toponight=_;var b={ppi:72<e||void 0===e&&2<=window.devicePixelRatio?200:100,size:256<m?512:256,features:"pois:"+(!0===o||eb(o)&&/[^0]/.test(o)?"all":"disabled")};i&&(b.lang=i),r&&(b.lang2=r),u&&u.politicalView&&(b.pview=u.politicalView),e={dark:!0},v=function(t,e,i,r,n){var o=mo({},b);return/^explore\./.test(i)||delete o.features,new Ik(n=new qo(t=l.Rp({format:e,resource:t,queryParams:mo({style:i},o)}),{engineType:c,style:n}),r)},mo(t.raster.normal,{base:v("background","png8","explore.day"),basenight:v("background","png8","explore.night",e),map:v("base","png8","explore.day"),mapnight:v("base","png8","explore.night",e),labels:v("label","png8","explore.day")}),mo(t.raster.satellite,{xbase:v("background","jpeg","satellite.day",e),base:v("background","jpeg","explore.satellite.day",e),map:v("base","jpeg","explore.satellite.day",e),labels:v("label","png8","explore.satellite.day")}),mo(t.raster.terrain,{base:v("background","png8","topo.day",e),map:v("base","png8","topo.day",e),labels:v("label","png8","topo.day",e)}),mo(t.vector.normal,{mapnight:s(g,"harp/oslo/normal.night.json",!0),lite:s(g,"harp/oslo/lite.day.json"),litenight:s(g,"harp/oslo/lite.night.json",!0),ism:s(g,"harp/oslo/road.network.day.json"),ismnight:s(g,"harp/oslo/road.network.night.json",!0),roadnetwork:s(g,"harp/oslo/road.network.day.json"),roadnetworknight:s(g,"harp/oslo/road.network.night.json",!0)}),_={styles:[{technique:"raster",attr:{gamma:["step",["zoom"],.9,13,1],brightness:["step",["zoom"],.6,12,.7,13,.8,14,.8,17,.9]}}]};for(var x=[],w=0;6>w;w++){var S=new H.map.render.harp.Style(JSON.parse(JSON.stringify(_)));S=v("background","jpeg","satellite.day",e,S),x.push(S)}t.hybrid={day:{raster:x[0],vector:s(g,"harp/oslo/hybrid.day.json",!0),traffic:s(n,"harp/oslo/hybrid.day.json",!0)},night:{raster:x[1],vector:s(g,"harp/oslo/hybrid.night.json",!0),traffic:s(n,"harp/oslo/hybrid.night.json",!0)},liteday:{raster:x[2],vector:s(g,"harp/oslo/lite.hybrid.day.json",!0),traffic:s(n,"harp/oslo/lite.hybrid.day.json",!0)},litenight:{raster:x[3],vector:s(g,"harp/oslo/lite.hybrid.night.json",!0),traffic:s(n,"harp/oslo/lite.hybrid.night.json",!0)},logistics:{raster:x[4],vector:s(y,"harp/oslo/logistics.hybrid.day.json",!0),traffic:s(n,"harp/oslo/logistics.hybrid.day.json",!0)},logisticsnight:{raster:x[5],vector:s(y,"harp/oslo/logistics.hybrid.night.json",!0),traffic:s(n,"harp/oslo/logistics.hybrid.night.json",!0)}}}(g={traffic:{}}).traffic.map=s(n,d?"traffic/vector.tile.yaml":"harp/oslo/normal.day.json"),p&&(g.traffic.logistics=s(n,"harp/oslo/logistics.day.json"),g.traffic.logisticsnight=s(n,"harp/oslo/logistics.night.json"),g.traffic.mapnight=s(n,"harp/oslo/normal.night.json"),g.traffic.lite=s(n,"harp/oslo/lite.day.json"),g.traffic.litenight=s(n,"harp/oslo/lite.night.json"),g.traffic.topo=s(n,"harp/oslo/topo.day.json"),g.traffic.toponight=s(n,"harp/oslo/topo.night.json")),mo(t.vector,g)}return t},X.prototype.createDefaultLayers=X.prototype.Yl,u(Co,I),t("H.service.Service",Co),Co.prototype.ya=function(){return{}},Co.prototype.i=function(){return this.xc}
2,Co.prototype.getUrl=Co.prototype.i,Co.prototype.u=function(t,e,i,r){return(r=new Me(void 0===r?"application/json":r,t.toString(),Yd,{headers:this.Ub})).then(e,Eo(this,t,i)),r},Co.prototype.Ic=function(t){return Error(t.message)},u(Go,Co),t("H.service.GeocodingService",Go),Go.prototype.ya=function(){return{subDomain:"geocoder.ls",reverseSubDomain:"reverse",path:"6.2"}},Go.CONFIG_KEY="geocoding",Go.prototype.Ic=function(t){return Error(t.Details||t.message||t.error)},Go.prototype.yp=function(t,e,i){return t=this.i().clone().A("geocode.json").v(t),this.u(t,e,i)},Go.prototype.geocode=Go.prototype.yp,Go.prototype.Fr=function(t,e,i){return t=this.i().clone().A("reversegeocode.json").v(t),this.Nw&&t.sa(this.Nw),this.u(t,e,i)},Go.prototype.reverseGeocode=Go.prototype.Fr,Go.prototype.search=function(t,e,i){return t=this.i().clone().A("search.json").v(t),this.u(t,e,i)},Go.prototype.search=Go.prototype.search,X.prototype.Vz=function(t){return this.Ja(Go,t)},X.prototype.getGeocodingService=X.prototype.Vz,u(Ho,Co),t("H.service.PlacesService",Ho),Ho.prototype.ya=function(){return{subDomain:"places.ls",path:"places/v1"}},Ho.CONFIG_KEY="places",Ho.EntryPoint={SEARCH:"discover/search",SUGGEST:"suggest",EXPLORE:"discover/explore",AROUND:"discover/around",HERE:"discover/here",CATEGORIES:"categories/places"},Ho.prototype.request=function(t,e,i,r){return this.I(t,e,i,r)},Ho.prototype.request=Ho.prototype.request,Ho.prototype.I=function(t,e,i,r){return t=this.i().clone().A(t).v(e||{}),this.u(t,i,r)},Ho.prototype.search=function(t,e,i){return this.I("discover/search",t,e,i)},Ho.prototype.search=Ho.prototype.search,Ho.prototype.uD=function(t,e,i){return this.I("suggest",t,e,i)},Ho.prototype.suggest=Ho.prototype.uD,Ho.prototype.hz=function(t,e,i){return this.I("discover/explore",t,e,i)},Ho.prototype.explore=Ho.prototype.hz,Ho.prototype.qy=function(t,e,i){return this.I("discover/around",t,e,i)},Ho.prototype.around=Ho.prototype.qy,Ho.prototype.ZA=function(t,e,i){return this.I("discover/here",t,e,i)},Ho.prototype.here=Ho.prototype.ZA,Ho.prototype.Cy=function(t,e,i){return this.I("categories/places",t,e,i)},Ho.prototype.categories=Ho.prototype.Cy,Ho.prototype.lz=function(t,e,i,r){return t=uo(t).v(this.i().getQuery()).v(r||{}),this.u(t,e,i)},Ho.prototype.follow=Ho.prototype.lz,X.prototype.sA=function(t){return this.Ja(Ho,t)},X.prototype.getPlacesService=X.prototype.sA,u(Io,Co),t("H.service.GeofencingService",Io),Io.CONFIG_KEY="geofencing",Io.prototype.Ic=function(t){return Error(t.issues&&t.issues[0]?t.issues[0].message:t.message,{cause:t})},Io.prototype.sz=function(t,e,i){return t=this.i().clone().sa("geofencing").vc("v8/geofence").v(t),this.I(t,"GET",e,i)},Io.prototype.geofence=Io.prototype.sz,Io.prototype.delete=function(t,e,i){return t=this.i().clone().sa("geofencing").vc("v8/geofence/delete").v(t),this.I(t,"GET",e,i)},Io.prototype.delete=Io.prototype.delete,Io.prototype.upload=function(t,e,i,r){return t=this.i().clone().sa("geofencing").vc("v8/geofence/upload").v(t),e=Jo(Io.prototype.upload,e),this.I(t,"POST",i,r,e)},Io.prototype.upload=Io.prototype.upload,Io.prototype.modify=function(t,e,i,r){return t=this.i().clone().sa("geofencing").vc("v8/geofence/modify").v(t),e=Jo(Io.prototype.modify,e),this.I(t,"POST",i,r,e)},Io.prototype.modify=Io.prototype.modify,Io.prototype.I=function(t,e,i,r,n,o){return o=void 0===o?"application/json":o,e={method:e,headers:Object.assign({},this.Ub),data:n||void 0},(o=new Me(o,t.toString(),Yd,e)).then(i,Eo(this,t,r)),o},u(Ko,Co),t("H.service.extension.geofencing.Service",Ko),Ko.prototype.ya=function(){return{subDomain:"fleet.ls",path:"2"}},Ko.CONFIG_KEY="geofencing",Ko.prototype.request=function(t,e,i,r){return this.I(t,e,i,r)},Ko.prototype.request=Ko.prototype.request,Ko.prototype.Ic=function(t){return Error(t.issues&&t.issues.length?t.issues.map(function(t){return t.message}).join(". "):t.message||t.response_code)},Ko.prototype.I=function(t,e,i,r){if(!t)throw new C(this.request,0,t);if(!Wa(i))throw new TypeError("onResult must be a function");if(!Wa(r))throw new TypeError("onError must be a function");return t=this.i().clone().A(t+".json").v(e),this.u(t,i,r)},Ko.EntryPoint={SEARCH_PROXIMITY:"search/proximity"},X.prototype.iu=function(t,e){if(void 0===(e=e?+e:void 0))e=Ko;else{if(8!==e)throw new C(this.iu,1,"allowed values are 8 or undefined");e=Io}return this.Ja(e,t)},X.prototype.getGeofencingService=X.prototype.iu,u(Lo,S),t("H.map.provider.MarkerTileProvider",Lo),Lo.prototype.u=function(t,e,
2i,r,n){var o=this;return this.LC(t,e,i,function(n){for(var s,a,l=[],c=n.length;c--;)(a=n[c]).wD=o.getTileKey(t,e,i),a.ea(o),s=a.kc(),(B(a,Sh)||1===s.getState())&&l.push(n[c]);r(l)},n)},Lo.prototype.requestInternal=Lo.prototype.u,Lo.prototype.Hh=function(t,e){e===Wg.VISUAL&&(t=this.Rb().get(t.wD))&&(t.valid=!1,this.hb(t))},Lo.prototype.invalidateObject=Lo.prototype.Hh,Lo.prototype.Uc=function(){return this.AC},Lo.prototype.providesDomMarkers=Lo.prototype.Uc,Lo.prototype.Vc=te,Lo.prototype.providesMarkers=Lo.prototype.Vc,Mo.prototype.kc=function(t,e){var i,r=t+e;return(i=this.td[r])?i:(t=(t=No.MARKER.replace("{{icon}}",Oo[t]||Oo.OTHER)).replace("{{color}}",Po[e]||Po.BLOCKING),e={size:{w:26,h:33},anchor:{x:13,y:30},hitArea:new Lh(Mh.POLYGON,Qo.MARKER)},this.td[r]=new Xh(t,e))};var No={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>'},Oo={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.17l1.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"/>',ROADWORKS:'<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"/>',ACCIDENT:'<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,
219z 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.
2083l0.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"/>',OTHER:'<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"/>'},Po={BLOCKING:"#323232",VERYHIGH:"#d5232f",HIGH:"#ffa100"},Qo={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 Ro(t,e,i){(i=i||{}).criticality||(i.criticality="major,critical"),B(t,So,Ro,0),Lo.call(this,{max:20,min:8,requestData:z(this.PC,this),engineType:i.engineType}),this.td=new Mo,this.$=t,this.Ga=i,this.reload=z(this.reload,this),this.yr=setInterval(this.reload,e||18e4)}u(Ro,Lo),t("H.service.traffic.incidents.Provider",Ro);var To={minor:"HIGH","low impact":"HIGH",major:"VERYHIGH",critical:"BLOCKING"};function Uo(t){Uo.g.constructor.call(this,Uo,t)}Ro.prototype.PC=function(t,e,i,r,n){var o=this,s=this.td;return this.$.requestIncidentsByTile(t,e,i,function(t){var e,i=[];if(t=t.TRAFFIC_ITEMS)for(e=(t=t.TRAFFIC_ITEM).length;e--;){var n=t[e],a=n.TRAFFIC_ITEM_TYPE_DESC;switch(a){case"ACCIDENT":case"CONGESTION":var l=a;break;case"CONSTRUCTION":l="ROADWORKS";break;default:l="OTHER"}l=s.kc(l,To[n.CRITICALITY.DESCRIPTION]),(a=new $h({lat:(a=n.LOCATION.GEOLOC.ORIGIN).LATITUDE,lng:a.LONGITUDE},{provider:o,icon:l})).setData(n),i.push(a)}r(i)},n,this.Ga)},Ro.prototype.l=function(){Lo.prototype.l.call(this),clearInterval(this.yr)},Ro.prototype.dispose=Ro.prototype.l,u(Uo,Co),t("H.service.traffic.Service7",Uo),Uo.prototype.ya=function(){return{subDomain:"data.traffic",path:"v7"}},Uo.CONFIG_KEY="traffic_v7",Uo.prototype.OC=function(t,e,i,r){return t=this.i().clone().A(["incidents",t].join("/")).v(e||{}),this.u(t,i,r)},Uo.prototype.requestIncidentById=Uo.prototype.OC,Uo.prototype.MC=function(t,e,i){return t=this.i().clone().A("flow").v(t||{}),this.u(t,e,i)},Uo.prototype.requestFlowByArea=Uo.prototype.MC,Uo.prototype.RC=function(t,e,i){return t=this.i().clone().A("incidents").v(t||{}),this.u(t,e,i)},Uo.prototype.requestIncidentsByArea=Uo.prototype.RC;var Vo="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 Wo(t,e,i,r){Wo.g.constructor.call(this,{min:10,max:21,engineType:r}),B(t,So,Wo,0),this.$=t,this.Ga=i||Xo,this.Ga.responseattributes="sh,fc",this.yr=setInterval(z(this.reload,this),e||18e4),this.jb===Xi.WEBGL?this.Wa(new Ei(t.sm("traffic/flow.yaml")),!0):this.Wa(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","green"],width:3,metricUnit:"Pixel"}}]}))}u(Wo,S),t("H.service.traffic.flow.Provider",Wo),Wo.prototype.rr=te,Wo.prototype.providesGeoJSON=Wo.prototype.rr,Wo.prototype.K=function(){return this.lb()},Wo.prototype.getStyle=Wo.prototype.K,Wo.prototype.Bb=function(t){t.Yb&&t.Yb("GeoJSONTileSource"),this.Wa(t)},Wo.prototype.setStyle=Wo.prototype.Bb;var Xo={locationreferences:"tmc,shp"};
2Wo.prototype.disposeInternal=function(){Wo.g.disposeInternal.call(this),clearInterval(this.yr)},Wo.prototype.u=function(t,e,i,r,n){return this.$.requestFlowByTile(t,e,i,function(t){t.type&&-1!==t.type.indexOf("Error")?n(t.Details):r(t)},n,this.Ga)},Wo.prototype.requestInternal=Wo.prototype.u,Wo.prototype.nd=function(t,e,i,r,n){var o,s,a,l,c,h={type:"FeatureCollection",features:[]},u=r.RWS.length;for(o=0;o<u;o++){var p=r.RWS[o],d=p.RW,m=d.length,f=-1!==Vo.indexOf(p.EXTENDED_COUNTRY_CODE+p.EBU_COUNTRY_CODE);for(p=0;p<m;p++){var g=d[p].FIS,y=g.length;for(g=0;g<y;g++){var v=d[p].FIS[g].FI,_=v.length;for(s=0;s<_;s++){var b=v[s],x=[],w=b.CF[0],S=!!w.SSS,T={type:"Feature",properties:w,geometry:{type:"MultiLineString",coordinates:x}};for(T.properties.LHT=f,b.SHP.length&&(T.properties.FC=b.SHP[0].FC),S&&(c=[]),w=0;w<b.SHP.length;w++){var E=b.SHP[w].value,M=E.length;for(a=0;a<M;a++){var A=S?c:void 0,C=new Fg(E[a].trim()),P=[],L={};for(C.yi();-1!==(l=C.cb());)l===Yo?(L.lat=+String.fromCharCode.apply(Wo,C.mh()),C.next(),C.yi()):l===Zo?(L.lng=+String.fromCharCode.apply(Wo,C.mh()),P.push([L.lng,L.lat]),A&&A.push($e(L)),L=[],C.next(),C.yi()):C.next();L.lng=+String.fromCharCode.apply(Wo,C.mh()),P.push([L.lng,L.lat]),A&&A.push($e(L)),l=P,x.push(l)}}h.features.push(T)}}}}return Wo.g.nd.call(this,t,e,i,h,n)},Wo.prototype.createTileInternal=Wo.prototype.nd;var Zo=32,Yo=44;function $o(t){function e(e){r.contains(n)&&r.removeChild(n),c&&clearTimeout(c),delete $o.Br[o],e&&t.Mt&&t.Mt.call(l,e)}if(!t.url||!t.Qo)throw Error('Parameter "options" must specify at least a URL and a callback.');if("function"!=typeof t.Qo)throw Error("Parameters options.callback must be a function");var i=t.aE||document,r=i.getElementsByTagName("head")[0],n=i.createElement("script");i=t.url instanceof W?t.url:uo(t.url,t.ZD);var o=$o.VC++,s=t.zy||"callback",a=t.Qo,l={},c=null;return l.id=o,l.cancel=function(){e("cancelled")},0!==t.timeout&&(c=globalThis.setTimeout(function(){e("timeout")},t.timeout||3e4)),$o.Br[o]=function(t){e(),a.call(l,t)},n.type="text/javascript",n.src=i.toString()+(i.Bu()?"&":"?")+s+"="+(t.bE?"H.service.jsonp.handleResponse("+o+")":encodeURI("H.service.jsonp.handleResponse("+o+")")),r.appendChild(n),l}function So(t){So.g.constructor.call(this,So,t),this.Ay=Do(this,t).callbackKey,this.Xe=!1}function ap(t,e,i,r){return t.Xe||(oo(So,"Use HERE Traffic API v7 instead."),t.Xe=!0),$o({url:e,Qo:i,Mt:function(t){r(Error("["+t+"] "+e+" request failed"))},zy:t.Ay})}function bp(t,e,i,r,n,o,s){var a=this;s=s||{},o=o||{};var l=t.i().clone().A(e+"/"+t.Ud()+"/"+i).v(o),c=t.Fg;this.$=t,this.vx=l,ck.call(this,{tileSize:r,max:512===r?19:20,min:512===r?2:0,getURL:function(t,e,i){var o=a.vx.clone();return c&&o.sa(c[(i+e+t)%c.length]),o.A(i+"/"+t+"/"+e+"/"+r+"/"+n),o.toString()},crossOrigin:s.crossOrigin,headers:s.headers,uri:l.toString().replace(/_/g,"")+r,engineType:s.engineType}),this.yD=e,this.oi=i,this.Ga=o,this.Zo=i.split(".")[0],this.Be=z(this.Be,this),this.getCopyrights=this.U,this.Xe=!1,t.addEventListener("versionupdate",this.Be)}function dp(){this.ps={}}function ep(t,e){for(var i in e)e.hasOwnProperty(i)&&t.Do(i,e[i])}function cp(t){var e=this;cp.g.constructor.call(this,cp,t);var i=Do(this,t);this.Fg=i.shards,(this.rb=i.ignoreTypes?null:i.type)&&this.i().sa(this.rb),this.ec=new dp,this.pr={},this.Xl=0,setTimeout(function(){e.dispatchEvent("infoupdate"),void 0!==i.version&&"newest"!==i.version||e.dispatchEvent("versionupdate")})}function fp(t){fp.g.constructor.call(this,fp,t)}function gp(t){gp.g.constructor.call(this,gp,t)}function hp(t){hp.g.constructor.call(this,hp,t),oo(hp,"Use HERE Routing API v8 instead.")}function ip(t){ip.g.constructor.call(this,ip,t)}function jp(t,e,i){var r=+(i=i||{}).min,n=+i.max;i.min=r?$b(r,1,17):1,i.max=n?$b(n,1,17):17,jp.g.constructor.call(this,i),B(t,kp,jp,0),B(e,gi,jp,1),this.$=t,e.Yb&&e.Yb("OMV"),this.Wa(e,!0),this.Il=lo(this)}function kp(t){kp.g.constructor.call(this,kp,t),this.Aq=(t||xe).layer||"traffic",this.le="mc",this.nz="omv"}function lp(t){if(this.ms=!!t.toBypassToken,!this.ms&&!t.token)throw new C(lp,0,'"token" must be specified');oo(lp,"Use HERE IML service instead."),lp.g.constructor.call(this,lp,t),this.Cx=t.token,this.qt={},this.Wl={}}function pp(t,e,i,r,n,o,s){return n={method:n,headers:Object.assign(t.ms?{}:{authorization:"Bearer "+t.Cx},{"Content-Type":"application/geo+json"},t.Ub)},o&&(n.data=JSON.stringify(o)),(o=new Me("application/json",(e=np(t.i().clone().A(e+"/features").v(s||{}))).toString(),Yd,n)).then(i,Eo(t,e,r)),o}function op(t,e){return t.ms?e:np(e).v({access_token:t.Cx})}function np(t){var e=Object.assign({},t.getQuery());return delete e.apikey,t.Uk(e)}t("H.service.jsonp",$o),$o.XA=function(t){return(t=$o.Br[t])?t:function(){}},$o.handleResponse=$o.XA,$o.VC=0,$o.Br={},u(So,Co),t("H.service.traffic.Service",So),So.prototype.ya=function(){return{subDomain:"traffic.ls",path:"traffic/6.1",callbackKey:"jsoncallback"}},So.CONFIG_KEY="traffic",So.prototype.st=function(t,e){return new Ik(new Wo(this,void 0,t,e),{max:22})},So.prototype.createFlowLayer=So.prototype.st,So.prototype.tt=function(t){return new kj(new Ro(this,void 0,t))},So.prototype.createIncidentsLayer=So.prototype.tt,So.prototype.QC=function(t,e,
2i){return ap(this,t=this.i().clone().A("incidents.json").v(t),e,i)},So.prototype.requestIncidents=So.prototype.QC,So.prototype.NC=function(t,e,i,r,n,o){return ap(this,t=this.i().clone().A(["flow/json",i,t,e].join("/")).v(o||{}),r,n)},So.prototype.requestFlowByTile=So.prototype.NC,So.prototype.SC=function(t,e,i,r,n,o){return ap(this,t=this.i().clone().A(["incidents/json",i,t,e].join("/")).v(o||{}),r,n)},So.prototype.requestIncidentsByTile=So.prototype.SC,So.prototype.sm=function(t){return pn()+"/"+t},X.prototype.Tp=function(t,e){if(6===(e=e||6))e=So;else{if(7!==e)throw new C(this.Tp,1,"allowed values are 6 and 7");e=Uo}return this.Ja(e,t)},X.prototype.getTrafficService=X.prototype.Tp,u(bp,ck),bp.prototype.MAX_STORE_TIME=2592e6,bp.prototype.u=function(t,e,i,r,n,o){return this.Xe||(oo(cp,"Use HERE Vector Tile API or Raster Tile API v3 instead."),this.Xe=!0),bp.g.u.call(this,t,e,i,r,n,o)},bp.prototype.requestInternal=bp.prototype.u,bp.prototype.disposeInternal=function(){ck.prototype.disposeInternal.call(this),this.$.removeEventListener("versionupdate",this.Be)},bp.prototype.U=function(t,e){return this.$.U().query(this.Zo,e,t)},bp.prototype.getCopyrights=bp.prototype.U,bp.prototype.Be=function(){var t=this.$;this.vx=t.i().clone().A(this.yD+"/"+t.Ud()+"/"+this.oi).v(this.Ga),this.reload(!1)},bp.prototype.Wi=function(){return ml()},bp.prototype.rd=function(){return ml()?ll():bp.g.rd.call(this)},dp.prototype.Do=function(t,e){t=this.ps[t]||(this.ps[t]=[]);var i,r=e.length;for(i=0;i<r;i++){var n=new po.Ps(e[i]);t.push(n)}},dp.prototype.query=function(t,e,i){var r,n=(t=this.ps[t])?t.length:0,o=[];for(r=0;r<n;r++)t[r].Vf(e,i)&&o.push(t[r]);return o},po.Ps=function(t){var e,i=t.boxes;if(this.alt=t.alt,this.label=t.label,this.min=t.minLevel,this.max=t.maxLevel,this.In=[],i&&(e=i.length)){var r=i[0],n=new J(r[0],r[1],r[2],r[3]);for(this.In.push(n),this.tn=new J(r[0],r[1],r[2],r[3]),t=1;t<e;t++)n=new J((r=i[t])[0],r[1],r[2],r[3]),this.In.push(n),this.tn.xd(n,!1,this.tn)}},po.Ps.prototype.Vf=function(t,e){if(t>=this.min&&t<=this.max){if(!(t=this.In.length)||!this.tn)return!0;if(this.tn.Vf(e))for(;t--;)if(this.In[t].Vf(e))return!0}return!1},u(cp,Co),t("H.service.MapTileService",cp),cp.prototype.ya=function(){return{subDomain:"maps.ls",path:"maptile/2.1",type:"base",version:"newest",shards:["1","2","3","4"]}},cp.CONFIG_KEY="maptile",cp.prototype.tu=function(){return this.rb},cp.prototype.getType=cp.prototype.tu,cp.prototype.Ud=function(){return this.ya().version},cp.prototype.getVersion=cp.prototype.Ud,cp.prototype.U=function(){return this.Xl||this.Jf(),this.ec},cp.prototype.getCopyrights=cp.prototype.U,cp.prototype.ql=function(t){ep(this.ec,t),this.dispatchEvent("copyrightupdate")},cp.prototype.Jf=function(){var t=this,e=this.i().clone().A("copyright").A(t.Ud()).v({output:"json"});this.Fg&&e.sa(this.Fg[0]),this.Xl=1,this.u(e,function(e){t.Xl=2,t.ql(e)},function(e){throw t.Xl=-1,e})},cp.prototype.Lj=ve,cp.prototype.getInfo=cp.prototype.Lj,cp.prototype.oj=function(t,e,i,r,n,o){var s,a=this.i().clone().A(t+"/"+this.Ud()+"/"+e+"/"+i+"/"+r).v(n||{}).toString(),l=0,c=a.length;if(0!==c)for(s=0;s<c;s++)l=(l<<5)-l+a.charCodeAt(s),l|=0;return a=l,(l=this.pr[a])||(l=new bp(this,t,e,i,r,n,mo({headers:this.Ub},o||{})),this.pr[a]=l),l},cp.prototype.createTileProvider=cp.prototype.oj,cp.prototype.Nd=function(t,e,i,r,n,o,s,a){return new Ik(t=this.oj(t,e,i,r,n,a),{opacity:o,dark:!!s})},cp.prototype.createTileLayer=cp.prototype.Nd,X.prototype.Lp=function(t){return this.Ja(cp,t)},X.prototype.getMapTileService=X.prototype.Lp,u(fp,Co),t("H.service.WaypointsSequenceService",fp),fp.CONFIG_KEY="waypointsSequence",fp.prototype.jz=function(t,e,i){return t=this.i().clone().sa("wps").vc("v8/findsequence2").v(t),this.u(t,e,i)},fp.prototype.findSequence=fp.prototype.jz,X.prototype.TA=function(t){return this.Ja(fp,t)},X.prototype.getWaypointsSequenceService=X.prototype.TA,u(gp,Co),t("H.service.publicTransit.Service",gp),gp.prototype.ya=function(){return{subDomain:"transit.router",path:"v8"}},gp.CONFIG_KEY="publicTransit",gp.prototype.DA=function(t,e,i){return t=this.i().clone().A("routes").v(t),this.u(t,e,i)},gp.prototype.getRoutes=gp.prototype.DA,gp.prototype.Lz=function(t,e,
2i){return t=this.i().clone().A("departures").v(t),this.u(t,e,i)},gp.prototype.getDepartures=gp.prototype.Lz,gp.prototype.HA=function(t,e,i){return t=this.i().clone().A("stations").v(t),this.u(t,e,i)},gp.prototype.getStations=gp.prototype.HA,gp.prototype.Ic=function(t){return Error(JSON.stringify(t))},X.prototype.zA=function(t){return this.Ja(gp,t)},X.prototype.getPublicTransitService=X.prototype.zA,u(hp,Co),t("H.service.RoutingService",hp),hp.prototype.ya=function(){return{subDomain:"route.ls",path:"routing/7.2"}},hp.prototype.Ic=function(t){return Error(t.details)},hp.CONFIG_KEY="routing",hp.prototype.Xg=function(t,e,i){return t=this.i().clone().A("calculateroute.json").v(t),this.u(t,e,i)},hp.prototype.calculateRoute=hp.prototype.Xg,hp.prototype.Oo=function(t,e,i){return t=this.i().clone().sa("isoline").A("calculateisoline.json").v(t),this.u(t,e,i)},hp.prototype.calculateIsoline=hp.prototype.Oo,u(ip,Co),t("H.service.RoutingService8",ip),ip.CONFIG_KEY="routing_v8",ip.prototype.ya=function(){return{subDomain:"router",path:"v8/routes"}},ip.prototype.Ic=function(t){return Error(401===(t&&void 0===t.status?401:t.status)?t.error_description:t.title,{cause:t})},ip.prototype.Xg=function(t,e,i){return t=this.i().clone().v(t),this.u(t,e,i)},ip.prototype.calculateRoute=ip.prototype.Xg,ip.prototype.Oo=function(t,e,i){return t=this.i().clone().sa("isoline").vc("v8/isolines").v(t),this.u(t,e,i)},ip.prototype.calculateIsoline=ip.prototype.Oo,X.prototype.qu=function(t,e){if(7===(e=+e||7))e=hp;else{if(8!==e)throw new C(this.qu,1,"allowed values are 7 and 8");e=ip}return this.Ja(e,t)},X.prototype.getRoutingService=X.prototype.qu,u(jp,S),t("H.service.trafficVectorTile.Provider",jp),jp.prototype.Wc=te,jp.prototype.providesOMV=jp.prototype.Wc,jp.prototype.cc=function(t){return this.Il.test(t)},jp.prototype.cacheFilter=jp.prototype.cc,jp.prototype.Td=function(t,e,i){return this.$.Rf(t,e,i).toString()},jp.prototype.getTileKey=jp.prototype.Td,jp.prototype.Rb=function(){return this.vf},jp.prototype.getCache=jp.prototype.Rb,jp.prototype.MAX_STORE_TIME=2592e6,jp.prototype.Wi=function(){return ml()},jp.prototype.rd=function(){return ml()?ll():jp.g.rd.call(this)},jp.prototype.u=function(t,e,i,r,n){return this.$.Pa(t,e,i,r,n)},jp.prototype.requestInternal=jp.prototype.u,jp.prototype.Bb=function(t){t.Yb&&t.Yb("OMV"),this.Wa(t)},jp.prototype.setStyle=jp.prototype.Bb,jp.prototype.K=function(){return jp.g.lb.apply(this)},jp.prototype.getStyle=jp.prototype.K,jp.prototype.vf=new Lj(256),jp.prototype.U=function(){return null},jp.prototype.getCopyrights=jp.prototype.U,u(kp,Co),t("H.service.trafficVectorTile.Service",kp),kp.prototype.ya=function(){return{subDomain:"traffic.vector",path:"v2"}},kp.CONFIG_KEY="trafficVectorTile",kp.prototype.md=function(t,e,i){e=e||{};var r={min:0,max:22};return ya(i)&&mo(r,i),new Ik(new jp(this,t,e),r)},kp.prototype.createLayer=kp.prototype.md,kp.prototype.Pa=function(t,e,i,r,n){return this.u(this.Rf(t,e,i),function(t){return t.arrayBuffer().then(r,n)},n,"arraybuffer")},kp.prototype.Rf=function(t,e,i){return this.i().clone().A("traffictiles/"+this.Aq+"/"+this.le+"/"+i+"/"+t+"/"+e+"/"+this.nz)},kp.prototype.sm=function(t){return pn()+"/"+t},kp.prototype.eA=function(){return this.Aq},kp.prototype.getLayerName=kp.prototype.eA,X.prototype.Vp=function(t){return this.Ja(kp,t)},X.prototype.getTrafficVectorTileService=X.prototype.Vp,u(lp,Co),t("H.service.xyz.Service",lp),lp.prototype.ya=function(){return{host:"xyz.api.here.com",path:"hub/spaces"}},lp.prototype.Ic=function(t){return Error(t.errorMessage||t.message)},lp.prototype.Op=function(t,e,i){return ab(t,"String",this.Op,0,'"projectId" must be a string'),mp(this.Op,1,e,i),t=np(this.i().clone().vc("project-api/projects/"+t)),this.u(t,e,i)},lp.prototype.getProject=lp.prototype.Op,lp.prototype.ru=function(t,e,i){return mp(this.ru,0,t,e),i=op(this,this.i().clone().v(i||{})),this.u(i,t,e)},lp.prototype.getSpaces=lp.prototype.ru,lp.prototype.rm=function(t,e,i){return ab(t,"String",this.rm,0,'"spaceId" must be a string'),mp(this.rm,1,e,i),t=op(this,this.i().clone().A(t)),this.u(t,e,i)},lp.prototype.getSpace=lp.prototype.rm,lp.prototype.Dh=function(t,e,
2i){return ab(t,"String",this.Dh,0,'"spaceId" must be a string'),mp(this.Dh,1,e,i),t=op(this,this.i().clone().A(t+"/statistics")),this.u(t,e,i)},lp.prototype.getStatistics=lp.prototype.Dh,lp.prototype.mm=function(t,e,i,r,n,o,s){return t=op(this,this.i().clone().A(r+"/tile/web/"+i+"_"+t+"_"+e+".mvtf").v(Object.assign({clip:!0},s))),this.u(t,function(t){return t.arrayBuffer().then(n)},o,"arraybuffer")},lp.prototype.search=function(t,e,i,r){return ab(t,"String",this.search,0,'"spaceId" must be a string'),mp(this.search,1,e,i),t=op(this,this.i().clone().A(t+"/search").v(r||{})),this.u(t,e,i)},lp.prototype.search=lp.prototype.search,lp.prototype.Te=function(t,e,i,r){if(ab(t,"String",this.Te,0,'"spaceId" must be a string'),!ya(e))throw new C(this.Te,1,'"params" must be an object');return mp(this.Te,2,i,r),t=op(this,this.i().clone().A(t+"/features").v(e)),this.u(t,i,r)},lp.prototype.getFeaturesById=lp.prototype.Te,lp.prototype.wh=function(t,e,i,r){if(ab(t,"String",this.wh,0,'"spaceId" must be a string'),!ya(e))throw new C(this.Te,1,'"params" must be an object');return mp(this.wh,2,i,r),t=op(this,this.i().clone().A(t+"/bbox").v(e)),this.u(t,i,r)},lp.prototype.getFeaturesByBoundingBox=lp.prototype.wh,lp.prototype.U=function(t){return this.qt[t]||(this.Wl[t]||this.Jf(t),null)},lp.prototype.mf=function(t,e,i,r,n){if(ab(t,"String",this.mf,0,'"spaceId" must be a string'),!ya(e))throw new C(this.mf,1,'"geojsonObject" must be an object');if(mp(this.mf,2,i,r),n&&!ya(n))throw new C(this.mf,4,'"opt_params" must be an object');return pp(this,t,i,r,"PUT",e,n)},lp.prototype.putFeatures=lp.prototype.mf,lp.prototype.kf=function(t,e,i,r,n){if(ab(t,"String",this.kf,0,'"spaceId" must be a string'),!ya(e))throw new C(this.kf,1,'"featureCollection" must be an object');if(mp(this.kf,2,i,r),n&&!ya(n))throw new C(this.kf,4,'"opt_params" must be an object');return pp(this,t,i,r,"POST",e,n)},lp.prototype.postFeatures=lp.prototype.kf,lp.prototype.Hf=function(t,e,i,r){if(ab(t,"String",this.Hf,0,'"spaceId" must be a string'),!ya(e))throw new C(this.Hf,1,'"params" must be an object');return mp(this.Hf,2,i,r),pp(this,t,i,r,"DELETE",A,e)},lp.prototype.deleteFeatures=lp.prototype.Hf,lp.prototype.Jf=function(t){var e=this;this.Wl[t]=qp,this.rm(t,function(i){e.Wl[t]=rp,e.qt[t]=i.copyright,e.dispatchEvent("copyrightupdate")},function(i){throw e.Wl[t]=sp,i})},lp.CONFIG_KEY="xyz";var qp=1,rp=2,sp=-1;function mp(t,e,i,r){if(!Wa(i))throw new C(t,e,'"onResult" must be a function');if(!Wa(r))throw new C(t,e+1,'"onError" must be a function')}function tp(t,e,i){var r;if(tp.g.constructor.call(this,i?{min:i.min,max:i.max,engineType:i.engineType}:void 0),B(t,lp,tp,0),!eb(e))throw new C(tp,1,'"spaceId" must be a string');if(this.$=t,this.Gg=e,this.Pk={},i&&(["limit","simplificationLevel","tags"].forEach(function(t){t in i&&(this.Pk[t]=i[t])},this),t=i.parameters))for(r in t)this.Pk[r]=t[r];this.Wa(this.Fp())}function ro(t){t=void 0===t?{}:t,ro.g.constructor.call(this,ro,t),this.Ci={Tn:t.resource||"base",Fn:t.projection||"mc",format:t.format||"png8"},this.Hn=t.queryParams||{}}function up(t,e,i,r){if(!Wa(i))throw new C(t,e,"has invalid type");if(!Wa(r))throw new C(t,e+1,"has invalid type")}function vp(){}function wp(){}function xp(){}function yp(){if(zp)throw new vb(yp)}X.prototype.UA=function(t){return this.Ja(lp,t)},X.prototype.getXYZService=X.prototype.UA,u(tp,S),t("H.service.xyz.Provider",tp),tp.prototype.u=function(t,e,i,r,n){return this.$.mm(t,e,i,this.Gg,r,n,this.Pk)},tp.prototype.requestInternal=tp.prototype.u,tp.prototype.U=function(){return this.$.U(this.Gg)},tp.prototype.getCopyrights=tp.prototype.U,tp.prototype.Wc=te,tp.prototype.providesOMV=tp.prototype.Wc,tp.prototype.K=function(){return this.lb()},tp.prototype.getStyle=tp.prototype.K,tp.prototype.Bb=function(t){B(t,Ei)&&t.Yb("MVT"),this.Wa(t)},tp.prototype.setStyle=tp.prototype.Bb,tp.prototype.Fp=function(){return this.jb===Xi.WEBGL?new Ei({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"]]}}}
2,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"}}}}}}):new 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",color:"#000000",width:"2px",renderOrder:203}]})},u(ro,Co),t("H.service.rasterTile.Service",ro),m=ro.prototype,m.K=function(){return this.Hn.style||"explore.day"},m.Rf=function(t,e,i){return this.i().clone().A(this.Ci.Tn+"/"+this.Ci.Fn+"/"+i+"/"+t+"/"+e+"/"+this.Ci.format).v(this.Hn)},m.ya=function(){return{subDomain:"maps",path:"v3"}},m.U=function(){return this.ec||this.Jf(),this.ec},m.Jf=function(){this.ec=new dp,this.u(this.i().clone().A("copyright"),z(this.ql,this),ve)},m.ql=function(t){var e=t.copyrights;t=t.resources;var i={},r=this.Ci.Tn+"."+this.K();i[r]=[],t[this.Ci.Tn].styles[this.K()].forEach(function(t){e[t].forEach(function(t){var e=[];t.boundingBoxes.forEach(function(t){e.push([t.north,t.west,t.south,t.east])}),i[r].push({boxes:e,label:t.label,alt:t.alt,minLevel:t.minLevel,maxLevel:t.maxLevel})})}),ep(this.ec,i)},m.Lj=function(t,e){return this.u(this.i().clone().A("info"),t,e)},ro.prototype.getInfo=ro.prototype.Lj,ro.prototype.Oj=function(t,e){return this.u(this.i().clone().A("politicalViews"),t,e)},ro.prototype.getPoliticalViews=ro.prototype.Oj,ro.prototype.Uz=function(t,e){return this.u(this.i().clone().A("features"),t,e)},ro.prototype.getFeatures=ro.prototype.Uz,ro.prototype.Jp=function(t,e){return this.u(this.i().clone().A("languages"),t,e)},ro.prototype.getLanguages=ro.prototype.Jp,ro.CONFIG_KEY="rasterTile",X.prototype.Rp=function(t){return this.Ja(ro,t)},X.prototype.getRasterTileService=X.prototype.Rp,t("H.service.extension.customLocation.Permission",{READ:"read",WRITE:"write",EXPORT:"export"}),t("H.service.extension.customLocation.Storage",{READONLY:"readonly",UPDATABLE:"updatable"}),t("H.service.extension.dataView.ITable",vp),vp.prototype.zh=function(){},vp.prototype.getMeta=vp.prototype.zh,vp.prototype.Ch=function(){},vp.prototype.getRowCount=vp.prototype.Ch,vp.prototype.Sd=function(){},vp.prototype.getRow=vp.prototype.Sd,vp.prototype.$a=function(){},vp.prototype.getColumnNames=vp.prototype.$a,vp.prototype.Gj=function(){},vp.prototype.getColumn=vp.prototype.Gj,vp.prototype.xa=function(){},vp.prototype.getCell=vp.prototype.xa,vp.prototype.concat=function(){},vp.prototype.concat=vp.prototype.concat,t("H.service.extension.dataView.IColumn",wp),wp.prototype.xa=function(){},wp.prototype.getCell=wp.prototype.xa,t("H.service.extension.dataView.IRow",xp),xp.prototype.$a=function(){},xp.prototype.getColumnNames=xp.prototype.$a,xp.prototype.xa=function(){},xp.prototype.getCell=xp.prototype.xa,xp.prototype.Qf=function(){},xp.prototype.getTable=xp.prototype.Qf,t("H.service.extension.customLocation.Table",yp);var zp=!0;function Ap(t,e){var i;zp=!1;var r=new yp;zp=!0,r.Zm=Ua(globalThis.JSON.parse(globalThis.JSON.stringify(t))),t=t.columnNames;var n=Ra();for(i=t.length;i--;)n[t[i]]=i;if(r.Uo=n,r.Gc=t.length,e){if(e.length%t.length)throw new C(Ap,1,"Invalid number of cells")}else e=[];return r.tb=e,r}yp.prototype.zh=function(){return this.Zm},yp.prototype.getMeta=yp.prototype.zh,yp.prototype.Ch=function(){return this.tb.length/this.Gc},yp.prototype.getRowCount=yp.prototype.Ch,yp.prototype.Sd=function(t){return t<this.tb.length/this.Gc?new Bp(this,t):A},yp.prototype.getRow=yp.prototype.Sd,yp.prototype.EA=function(){var t,e=this.tb.length/this.Gc,i=new globalThis.Array(e);for(t=0;t<e;t++)i[t]=new Bp(this,t);return i},yp.prototype.getRows=yp.prototype.EA,yp.prototype.Bo=function(t){var e=this.Gc,i=this.tb,r=i.length/this.Gc;if(!t||t.length%e)throw new C(this.Bo,0,"Invalid number of cells");return this.tb=i.concat(t),r}
2,yp.prototype.addCells=yp.prototype.Bo,yp.prototype.ny=function(){for(var t=this.Gc,e=this.tb,i=this.tb.length/this.Gc;t--;)e.push(x);return this.Sd(i)},yp.prototype.addRow=yp.prototype.ny,yp.prototype.$a=function(){return this.Zm.columnNames},yp.prototype.getColumnNames=yp.prototype.$a,yp.prototype.Gj=function(t){return this.Uo[t]===A?A:new Cp(this,t)},yp.prototype.getColumn=yp.prototype.Gj,yp.prototype.xa=function(t,e){return this.tb[t*this.Gc+this.Uo[e]]},yp.prototype.getCell=yp.prototype.xa,yp.prototype.te=function(t,e,i){if(e=this.Uo[e],t>=this.tb.length/this.Gc)throw new C(this.te,0,"Row index out of bounds");if(e===A)throw new C(this.te,0,"Column unknown");this.tb[t*this.Gc+e]=i},yp.prototype.setCell=yp.prototype.te,yp.prototype.concat=function(t){var e,i=arguments.length,r=""+this.$a(),n=this.tb?this.tb.slice():[];for(e=0;e<i;e++){var o=arguments[e];if(!(o instanceof yp))throw new C(this.concat,e);if(""+o.$a()!==r)throw new C(this.concat,e,"Incompatible columns!");o.tb&&(n=n.concat(o.tb))}return Ap(this.Zm,n)},yp.prototype.concat=yp.prototype.concat;var Dp=/(\n|\t|\r|")/;function Fp(t,e,i,r,n,o,s,a){var l;for(l=0;l<s;l++){l&&e.push("\t");var c=i[r*n+o[l]];if(l!==a){if(c!==x){if(c=String(c),Dp.test(c))throw new C(t.ns,0,'Invalid character (\\n, \\r, \\t, or ") in row '+r+" column "+t.Zm.columnNames[o[l]]);e.push(c)}}else e.push(c)}}function Cp(t,e){this.$b=t,this.Ol=e}function Bp(t,e){this.$b=t,this.Lk=e}function Gp(t){var e=Hp;if(!t||!eb(t.layerId)||Ya(t.rowFilter)&&!Wa(t.rowFilter)||Ya(t.rowFilterContext)&&!ya(t.rowFilterContext))throw new C(e,1,Ya("invalid layer config")?"invalid layer config":t)}function Ip(t){return eb(t)&&/^[A-Z][A-Z0-9_]*$/.test(t)}function Jp(t){for(var e=t&&t.length,i=2<=e&&"WKT"===t[--e]&&"GEOMETRY_ID"===t[--e];i&&e--;)i=Ip(t[e]);return i}function Kp(t,e){var i="",r=[];if(e){var n=t.geometries;if(n&&n.length){var o=Object.keys(n[0].attributes);for(i=i+"Meta:\t"+e+"\n"+o.join("\t"),i+="\tWKT\n",t=0;t<n.length;t++){var s=n[t].attributes,a=n[t].geometry;for(e=0;e<o.length;e++)r.push(s[o[e]]);i+=r.join("\t"),i+="\t"+a+"\n",r=[]}}}else{if(a={},r=[],t.geometries)for(n=0;n<t.geometries.length;n++)a[(e=t.geometries[n]).layerId]||(a[e.layerId]=[]),a[e.layerId].push(e);for(o in a)r.push({layerId:o,geometries:a[o]});for(t=0;t<r.length;t++)i+=Kp(r[t],r[t].layerId)}return i}function Lp(t,e,i,r){r=r||Mp,this.Gk={},r.provider=t,this.invalidate=ue,Lp.g.constructor.call(this,e,r),delete this.invalidate,i&&(this.HD=i),this.qa(Wg.ADD)}yp.prototype.ns=function(t,e){var i,r=this.Gc,n=this.$a(),o=[],s=[],a=this.tb,l=-1;for(i=0;i<r;i++)t&&!t.test(n[i])||("WKT"===n[i]&&(l=o.length),o.push(i));if(!(t=o.length))throw new C(this.ns,1,"No columns filtered");if(Fp(this,s,n,0,r,o,t,l),e){var c=e.length;for(i=0;i<c;i++)s.push("\n"),Fp(this,s,a,n=e[i],r,o,t,l)}else for(c=this.Ch(),n=0;n<c;n++)s.push("\n"),Fp(this,s,a,n,r,o,t,l);return s.join("")},yp.Column=Cp,Cp.prototype.xa=function(t){return this.$b.xa(t,this.Ol)},Cp.prototype.getCell=Cp.prototype.xa,Cp.prototype.te=function(t,e){this.$b.te(t,this.Ol,e)},Cp.prototype.setCell=Cp.prototype.te,yp.Row=Bp,Bp.prototype.$a=function(){return this.$b.$a()},Bp.prototype.getColumnNames=Bp.prototype.$a,Bp.prototype.xa=function(t){return this.$b.xa(this.Lk,t)},Bp.prototype.getCell=Bp.prototype.xa,Bp.prototype.te=function(t,e){this.$b.te(this.Lk,t,e)},Bp.prototype.setCell=Bp.prototype.te,Bp.prototype.Qf=function(){return this.$b},Bp.prototype.getTable=Bp.prototype.Qf,u(Lp,yh),t("H.service.remote.Spatial",Lp);var Mp={};function Np(t,e){this.hm=t,e&&(this.labels=e)}Lp.prototype.wb=function(){return this.HD||yh.prototype.wb.call(this)},Lp.prototype.getId=Lp.prototype.wb,Lp.prototype.Un=ve,Lp.prototype.retain=Lp.prototype.Un,Lp.prototype.release=te,Lp.prototype.release=Lp.prototype.release;var Op=new Np(we);function Pp(t,e,i){t.Gk[e.key]=new Np(i,void 0)}function Qp(t,e){this.$b=t,this.Lk=e}function Rp(t,e){this.$b=t,this.Ol=e}function Sp(t,e,i){var r;if(e=e||(t&&t.length?Object.keys(t[0]):A),this.Nb=t,e)for(this.eh=e,this.Vo=t=Ra(),r=e.length;r--;)t[e[r]]=!0;i!==A&&(this.Lq=i)}function Tp(t,e,i){var r=8===t;this.zi=e,this.Nt=i||ve,(this.Nm=4===t||r)?this.We=r:this.Uu=1===t,this.au=this.Nm?"$HProjGeometry":"geometry"}function Up(t,e,i,r,n){var o=[],s=n.paths,a=s.length,l=0,c=t.zi&&t.zi(r);for(t=new Lp(e,t.We,A,{style:c||t.Ty,data:r});l!==a;){r=(e=o).push;for(var h=0,u=(c=s[l++]).length,p=[];h<u;)p.push(new F(c[h++],c[h++]));r.call(e,p)}return Pp(t,i,[new mh(o,n.interiorsIndex,n.outlinesIndex)]),t}function Vp(t,e,i,r){r=new Ye(r[0],r[1]);var n=t.zi&&t.zi(i);return t=t.Uu?new $h(r,t={icon:n,data:i,provider:e}):new Sh(r,t={icon:n,data:i,provider:e})}function Wp(t,e){var i={};this.uC=t,Oa(i,e||i),Gm.call(this,i),this.Ln={},(t=this.Mc(Yg.SPATIAL)).update(t.Kd+1,Wg.ADD)}function Xp(t){return t.Vd(!0)}function Yp(t,e,i){var r,n=e.Ji&&e.Ji[i];return!n&&(r=e.vl)&&(delete e.vl,(e.Ji=t=t.uC.parse(t,e,r))&&(n=t[i])),n||we}Lp.prototype.xh=function(t){return(this.Gk[t.key]||Op).hm},Lp.prototype.getGeometriesForTile=Lp.prototype.xh,Lp.prototype.Ip=function(t){return(this.Gk[t.key]||Op).labels},Lp.prototype.getLabels=Lp.prototype.Ip,t("H.service.extension.dataView.ObjRow",Qp),Qp.prototype.$a=function(){return this.$b.$a()},Qp.prototype.getColumnNames=Qp.prototype.$a,Qp.prototype.xa=function(t){return this.$b.xa(this.Lk,t)},Qp.prototype.getCell=Qp.prototype.xa,Qp.prototype.Qf=function(){return this.$b},Qp.prototype.getTable=Qp.prototype.Qf,t("H.service.extension.dataView.ObjColumn",Rp),Rp.prototype.xa=function(t){return this.$b.xa(t,this.Ol)},Rp.prototype.getCell=Rp.prototype.xa,t("H.service.extension.dataView.ObjTable",Sp),m=Sp.prototype,m.
2Lq=A,m.Nb=A,m.eh=A,m.Vo=A,m.zh=function(){return this.Lq},Sp.prototype.getMeta=Sp.prototype.zh,Sp.prototype.Ch=function(){return this.Nb?this.Nb.length:0},Sp.prototype.getRowCount=Sp.prototype.Ch,Sp.prototype.Sd=function(t){var e=this.Nb;return e&&e[t]?new Qp(this,t):A},Sp.prototype.getRow=Sp.prototype.Sd,Sp.prototype.$a=function(){return this.eh||we},Sp.prototype.getColumnNames=Sp.prototype.$a,Sp.prototype.Gj=function(t){return this.Vo[t]?new Rp(this,t):A},Sp.prototype.getColumn=Sp.prototype.Gj,Sp.prototype.xa=function(t,e){var i=this.Nb;return(t=i&&this.Vo[e]&&i[t])&&t[e]},Sp.prototype.getCell=Sp.prototype.xa,Sp.prototype.concat=function(){var t,e=arguments.length,i=this.eh,r=""+this.eh,n=(this.Nb||[]).slice();for(t=0;t<e;t++){var o=arguments[t];if(!(o instanceof Sp))throw new C(this.concat,t);if(o.Nb){if(i&&""+o.eh!==r)throw new C(this.concat,t,"Incompatible columns!");n=n.concat(o.Nb)}}return new Sp(n,this.eh,this.Lq)},Sp.prototype.concat=Sp.prototype.concat,Tp.prototype.parse=function(t,e,i){var r,n,o,s={},a=[],l=0;for(n=i.length;l<n;l++){var c=i[l],h=c.Rows;if(c=h.length){var u=Object.keys(h[0]).filter(function(t){return"geometry"!==t&&"$HProjGeometry"!==t});for(u=new Sp(h,u),o=0;o<c;o++){var p=h[o];if(r=p[this.au]){if(delete p[this.au],p=u.Sd(o))try{var d=this.Nm?Up(this,t,e,p,r):Vp(this,t,p,r.path);d.ea(t),a.push(d)}catch(t){this.Nt(t.message)}}else this.Nt("Layer must contain geometries")}}}return s[this.Nm?"spatials":this.Uu?"markers":"domMarkers"]=a,s},u(Wp,Gm),t("H.service.remote.ObjectProvider",Wp),Wp.prototype.l=function(){Gm.prototype.l.call(this)},Wp.prototype.dispose=Wp.prototype.l,Wp.prototype.pe=function(){return we},Wp.prototype.requestMarkers=Wp.prototype.pe,Wp.prototype.oe=function(){return we},Wp.prototype.requestDomMarkers=Wp.prototype.oe,Wp.prototype.wg=function(){return we},Wp.prototype.requestOverlays=Wp.prototype.wg,Wp.prototype.Vc=te,Wp.prototype.providesMarkers=Wp.prototype.Vc,Wp.prototype.Uc=te,Wp.prototype.providesDomMarkers=Wp.prototype.Uc,Wp.prototype.me=te,Wp.prototype.providesSpatials=Wp.prototype.me,Wp.prototype.Pn=function(){return we},Wp.prototype.requestSpatials=Wp.prototype.Pn,Wp.prototype.Qn=function(t,e){return t=Yp(this,t,Zp),e&&(t=t.filter(Xp)),t},Wp.prototype.requestSpatialsByTile=Wp.prototype.Qn,Wp.prototype.Y=function(t){var e=t.wb();if(this.Ln[e])throw new vb(this.Y,"Remote object "+e+" already added");return this.Ln[e]=t},Wp.prototype.Oa=function(t){delete this.Ln[t.wb()]};var Zp="spatials";function $p(t){var e=(t=t||{}).tileCacheSize||1024,i=t.resultType,r=t.styleCallback;if(Ya(t.min)||(t.min=12),$p.g.constructor.call(this,t),-1===aq.indexOf(i))throw new C($p,2,"invalid resultType");if(this.resultType=i,r&&!Wa(r))throw new C($p,2,"invalid style callback");this.zi=r,this.na=t.pixelRatio||he(),this.Hc=z(this.Hc,this),this.$n(new Lj(e,z(this.je,this))),this.createTileInternal=z(4===i||8===i?this.Ky:this.Iy,this)}function bq(t){var e=t.zd;return e||(t.ew||(t.ew=t.ou(t.resultType,t.zi,t.Hc)),(e=t.zd=new Wp(t.ew)).ea(t),e.addEventListener(t.j.Ca,z(t.ge,t)),e.yw=!0),e}u($p,S),t("H.service.extension.TileProvider",$p),$p.prototype.qq=!1,$p.prototype.getCapabilities=function(){return $p.g.getCapabilities.call(this)|Qi.CROP_LINES_BY_TILE|Qi.CROP_POLYGONS_BY_TILE},$p.prototype.Pa=function(t,e,i,r){return this.qq?$p.g.Pa.call(this,t,e,i,r):A},$p.prototype.requestTile=$p.prototype.Pa,$p.prototype.Hc=function(t){this.dispatchEvent(new de("error",eb(t)?t:t+"",this))},$p.prototype.Vc=function(){return 1===this.resultType},$p.prototype.providesMarkers=$p.prototype.Vc,$p.prototype.Uc=function(){return 2===this.resultType},$p.prototype.providesDomMarkers=$p.prototype.Uc,$p.prototype.me=function(){return 4===this.resultType||8===this.resultType},$p.prototype.providesSpatials=$p.prototype.me,$p.prototype.Iy=function(t,e,i,r){var n=this.getTileKey(t,e,i);n=this.Rb().get(n);var o=2==this.resultType,s=[],a=bq(this);for(n?n.valid=!0:(delete(t=n=new Qj(t,e,i,x)).Ji,t.vl=r),e=(r=Yp(a,n,o?"domMarkers":"markers")).length;e--;)(t=r[e]).ws=n,(o||1===t.kc().getState())&&s.push(t);return n.data=s,n},$p.prototype.ge=function(t){(t=t.target.ws)&&(t.valid=!1)},$p.prototype.fD=function(t){this.Jw=!!t},$p.prototype.setTileCanvasRendering=$p.prototype.fD,$p.prototype.Jw=!0,$p.prototype.Ky=function(t,e,
2i,r){var n=bq(this),o=this.getTileKey(t,e,i),s=this.tileSize,a=this.Rb().get(o);return a||(delete(t=a=new Mk(o,t,e,i,s,this.na,i,n)).Ji,t.vl=r),this.Jw?(r=to.pop(s),a.L(r)||to.push(r,s)):Sk(a),a},$p.prototype.je=function(t,e){var i;if(4===this.resultType||8===this.resultType){for(i=(t=e.ab()).length;i--;)delete t[i].Gk[e.key];(t=e.Jn())&&(to.push(t,this.tileSize),e.Kn())}else for(i=(t=e.data).length;i--;)delete t[i].ws},$p.prototype.disposeInternal=function(){$p.g.disposeInternal.call(this),bq(this).l()};var cq={MARKER:1,DOM_MARKER:2,POLYLINE:4,POLYGON:8};$p.ResultType=cq;var aq=[1,2,4,8];function Hp(t,e,i){var r,n=this,o=e&&e.rowFilter;Hp.g.constructor.call(this,i),B(t,dq,Hp,0);var s=i.resultType;if(Gp(e),o){var a=Ma(e);a.rowFilter=o.toString()}else a=e;(new Qg).registerProcessor("cle","H.service.extension.worker.processor");var l=e.layerId;t.request(eq,fq,{detail_level:"all",layer_id:l},function(e){var i;for(e=e.layers,i=0;i<e.length;i++)if(e[i].layerId===l){a.level=e[i].level;break}r=t.i().clone().A(gq+"."+fq).v({meta:1}),new Sg("cle",{message:[n.uid,0,{tileSize:n.tileSize,projected:!0,onlyOutline:4===s,serverUrl:r.toString(),layerConfigs:[a],batchTiles:!1,horizontalMargin:1}]}).then(function(){n.qq=!0,n.hb()},n.Hc)},function(t){n.Hc(t.message)})}function hq(t){this.By=t}function iq(t){if(t===A)t="\t";else if(!/^[^"\r\n]$/.test(t))throw new C(iq,0);this.by=String(t).charCodeAt(0),this.vd=z(this.vd,this),this.o=jq}u(Hp,$p),t("H.service.extension.customLocation.TileProvider",Hp),Hp.prototype.ou=function(t,e,i){return new Tp(t,e,i)},Hp.prototype.u=function(t,e,i,r,n){var o,s=this,a=this.getTileKey(t,e,i);a=this.Rb().get(a);var l={cancel:ve},c=!0,h=this.resultType;if(a&&(4===h||8===h?a.Ih()||(r(to.pop(this.tileSize),null),c=!1):(r(x),c=!1)),c){var u=globalThis.setTimeout(function(){(o=new Sg("cle",{message:[s.uid,1,[t,e,i]]})).then(r,n)},500);l.cancel=function(){o?o.cancel():globalThis.clearTimeout(u)}}return l},Hp.prototype.requestInternal=Hp.prototype.u,Hp.prototype.disposeInternal=function(){Hp.g.disposeInternal.call(this),new Sg("cle",{message:[this.uid,3]})},hq.prototype.cancel=function(){for(var t=this.By,e=t.length;e--;)t[e].cancel();t.length=0},hq.prototype.cancel=hq.prototype.cancel;var jq=0;function kq(t,e,i){var r=t.o;if(r!==e)throw 1===r&&(t.o=jq),new vb(i,"Requires state: "+["READY","PARSE","PAUSE"][e]+" but found "+["READY","PARSE","PAUSE"][r])}function lq(t,e){var i=[];return t.parse(e,function(t,e,r){return 1>t&&(i[e]=r),0<t}),t.o=jq,i}function mq(t,e,i){this.cd=new Fg(t),this.Gs=e,this.cq=!0,this.Pl=this.Gr=this.gj=0,nq(this),this.vd=i,this.Dc=[],this.Xf=!1}function nq(t){var e=t.cd.cb();t.Wt=!1,(t.jB=34===e)&&t.cd.next()}function oq(t,e){var i=t.cd;switch(t.Wt=!0,e){case t.Gs:t.gj++;break;case 13:i.next(),10!==i.cb()&&t.vd("CR without LF");case 10:t.gj=0,t.Gr++;break;case-1:t.cq=!1;break;default:t.vd("End of field expected")}return i.next(),-1}function pq(t,e,i,r){if(r=r||{},!e)throw new C(pq,1,"has to be a function");if(!i)throw new C(pq,2,"has to be a function");for(this.on=e,this.en=i,this.bh=[],this.Ub={},this.xq=[],this.lh={},this.es={},this.ks={},this.qx={},this.sj=r.duration||100,this.Hm=z(this.Hm,this),t=t.split("Meta:\t").slice(1),e=0;e<t.length;e++){i=(r=t[e].split("\n"))[0].split("\t")[0],r=r.slice(1).join("\n"),this.lh[i]=new iq,this.Ub[i]=lq(this.lh[i],r);var n={layerId:i,columnNames:this.Ub[i]};this.xq.push(i),this.qx[i]=Ap(n),this.es[i]=yj(),qq(this,r,i),this.Hm(i)}}function qq(t,e,i){var r=[],n=t.Ub[i].length-1,o=t.qx[i];try{t.lh[i].parse(e,function(e,s,a){var l=!1;return 0<e&&(r[s]=a,s===n&&(t.bh.push(o.Sd(o.Bo(r))),yj()-t.es[i]>t.sj&&(l=!0))),l},function(t,e,i){if(0<t&&e===n)return mg(i)})}catch(e){t.en(e)}}function dq(t){dq.g.constructor.call(this,dq,t),oo(dq)}function rq(t,e,i,r){var n=e[t=t===sq?"changes":"file"],o=eb(n),s=!o&&B(n,Blob);if(!o&&!s)throw new C(r,0,"Invalid "+t+" parameter");if(tq)n=s?n:De(n,"text/plain"),(r=new globalThis.FormData).append(t,n,n.name||t+".wkt"),i.method="POST",i.data=r,delete e[t];else if(s)throw new C(r,0,"Sending Blob data is not supported by the browser")}m=iq.prototype,m.getState=function(){return this.o},m.abort=function(){kq(this,2,iq.prototype.abort),this.o=jq},m.vd=function(t){throw this.o=jq,new C(iq.prototype.parse,0,"Malformed DSV at row "+this.cd.Gr+" column "+this.cd.gj+": "+t)}
2,m.parse=function(t,e,i){kq(this,jq,iq.prototype.parse),t=t.trim(),this.cd=new mq(t,this.by,this.vd),this.aC=e,this.Gv=i||ue,this.o=2,this.resume()},m.Gv=ue,m.resume=function(){var t=this.cd,e=[];kq(this,2,iq.prototype.resume),this.o=1;do{if(!t.cq){this.o=jq;break}if(n>t.gj){if(void 0!==i&&i!==n)return void this.cd.vd("The number of columns must be the same for all rows");var i=n}var r=t.Gr,n=t.gj,o=t.Pl,s=this.Gv(r,n,t);if(t.Pl>o)for(;-1!==t.next(););else{for(;-1!==(o=t.next());)e.push(o);s=String.fromCharCode.apply(x,e),e.length=0}nq(t),this.aC(r,n,s)&&(this.o=t.cq?2:jq)}while(1===this.o);2!=this.o&&void 0!==i&&0<n&&i!==n&&this.cd.vd("The number of columns must be the same for all rows")},m=mq.prototype,m.Pl=0,m.cb=function(){if(this.Wt)var t=-1;else{var e=this.cd;if(t=e.cb(),this.jB)switch(t){case 34:e.next(),34!==(t=e.cb())&&(t=oq(this,t));break;case-1:this.vd("Closing quotation mark expected")}else switch(t){case 34:this.vd("Unexpected quotation mark");case this.Gs:case 13:case 10:case-1:t=oq(this,t)}}return t},m.yi=function(){this.Xf=!0,this.Dc=[]},m.mh=function(){var t=this.Dc.slice();return this.Xf=!1,this.Dc=[],t},m.next=function(){var t=this.cb();return-1!==t&&this.cd.next(),this.Xf&&this.Dc.push(t),this.Pl++,t},pq.prototype.cancel=function(){for(var t in this.ks)globalThis.clearTimeout(this.ks[t])},pq.prototype.cancel=pq.prototype.cancel,pq.prototype.Hm=function(t){var e,i,r=this;this.ks[t]=globalThis.setTimeout(function(){if(2===r.lh[t].getState())r.es[t]=yj(),r.on(r.bh,!1),r.bh=[],r.lh[t].resume(),r.Hm(t);else{for(e=!0,i=0;i<r.xq.length;i++)if(r.lh[r.xq[i]].getState()!==jq){e=!1;break}e&&(0<r.bh.length&&r.on(r.bh,!0),r.bh=[])}},0)},u(dq,Co),t("H.service.extension.customLocation.Service",dq),dq.prototype.ya=function(){return{subDomain:"fleet.ls",path:"2"}},dq.CONFIG_KEY="customLocation",dq.prototype.Nd=function(t,e){var i=e&&e.resultType;return t=new Hp(this,t,e),1===i||2===i?new kj(t):new Ik(t)},dq.prototype.createTileLayer=dq.prototype.Nd;var tq=globalThis.FormData&&!!globalThis.FormData.prototype.append;dq.prototype.request=function(t,e,i,r,n){return this.I(t,e,i,r,n)},dq.prototype.request=dq.prototype.request,dq.prototype.I=function(t,e,i,r,n){var o="text/plain",s=t===uq.LAYERS_UPLOAD||t===uq.LAYERS_MODIFY||t===uq.LAYERS_IMPORT,a=i,l={data:A,method:"GET",headers:this.Ub};if(!t)throw new C(this.request,0,t);if(!e)throw new C(this.request,1,e);up(this.request,3,r,n),s&&(B(i,Object,this.request,2,"Invalid request parameters"),rq(t,a=Ma(i),l,this.request));var c=this.i().clone().A(t+"."+e).v(a);return e===vq.JSON&&(o="application/json"),(t=new Me(o,c.toString(),Yd,l)).then(function(t){var e=t.issues;e&&t.error_id&&t.response_code?n(Error(e[0].message)):r(t)},function(t){"error"===t.type||404===t.status?n(Error(t.statusText||"Unable to load data")):t.json().then(function(t){n(Error("["+t.issues[0].message+"] "+c+" request failed"))},function(){n(Error("["+t.statusText+"] "+c+" request failed"))})}),t};var eq="layers/list",sq="layers/modify",gq="tiled/tile",uq={LAYERS_DELETE:"layers/delete",LAYERS_GRANT:"layers/access/grant",LAYERS_LIST:eq,LAYERS_MODIFY:sq,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:gq};dq.EntryPoint=uq;var fq="json",vq={TXT:"txt",JSON:fq};dq.EntryPointType=vq,dq.prototype.Sb=function(t,e,i){var r=this;return this.request("search/all","txt",{filter:'WKT==""',layer_id:t},function(n){var o=String(n).replace(/[\r\n]+$/g,"").split("\t");r.request(eq,fq,{layer_id:t,detail_level:"all"},function(t){(t=t.layers[0]).columnNames=o,e(Ap(t))},i)},i)},dq.prototype.getLayer=dq.prototype.Sb,dq.prototype.yu=function(t,e,i,r){var n=e&&e.length,o=-1,s=this;return function a(){return++o<n?s.request("layers/access/grant",fq,{layer_id:t,granted_app_id:e[o].grantedAppId,permissions:e[o].permissions.join(",")},a,r):s.Sb(t,i,r)}()},dq.prototype.grantAccess=dq.prototype.yu,dq.prototype.Bt=function(t,e,i){return this.request("layers/delete",fq,{layer_ids:t},e,i)},dq.prototype.deleteLayer=dq.prototype.Bt,dq.prototype.md=function(t,e,
2i){function r(){setTimeout(function(){l.Sb(s,function(t){setTimeout(n.bind(null,t),h)},function(){64e3>c?(c+=h,r()):i(globalThis.Error("Timeout"))})},h),h*=2}function n(r){var n=JSON.stringify(r.$a()),o=t.grants;if(n!==JSON.stringify(a)){var c="Results into different column names on the backend: "+n;setTimeout(function(){l.Bt(s,function(){i(globalThis.Error(c))},function(t){i(globalThis.Error(c+". "+t.message))})},h)}else o&&o.length?l.yu(s,o,e,i):e(r)}var o,s,a,l=this,c=0,h=1e3,u=!t||!Ip(s=t.layerId)&&(o="layerId")||!Jp(a=t.columnNames)&&(o="columnNames")?0:Wa(e)?Wa(i)?-1:2:1;if(0<=u)throw new C(l.md,u,o||arguments[u]);return l.Sb(s,function(){i(globalThis.Error("Layer exists already"))},function(){var e={layer_id:s,file:a.join("\t")},n=t.level,o=t.storage;n!==A&&(e.level=n),o!==A&&(e.storage=o),l.request("layers/upload",fq,e,r,i)})},dq.prototype.createLayer=dq.prototype.md,dq.prototype.Bg=function(t,e,i,r){var n,o=[];return t=this.request(t,fq,e,function(t){t.geometries.length?(t=Kp(t,e.layer_id),n=new pq(t,i,r),o.push(n)):i(we,!0)},r),o.push(t),new hq(o)},dq.prototype.Yc=function(t,e,i,r,n,o){if(!db(t))throw new C(this.Yc,0,"has invalid type");if(B(e,Ye,this.Yc,1,"has invalid type"),!hb(i))throw new C(this.Yc,2,"has invalid type");return up(this.Yc,3,r,n),t={layer_ids:t.join(","),proximity:e.lat+","+e.lng+","+i},o&&Oa(t,o),this.Bg("search/proximity",t,r,n)},dq.prototype.searchByProximity=dq.prototype.Yc,dq.prototype.Xc=function(t,e,i,r,n,o){var s="";if(!db(t))throw new C(this.Xc,0,"has invalid type");if(!eb(e)&&!B(e,K))throw new C(this.Xc,1,"has invalid type");if(!hb(i))throw new C(this.Xc,2,"has invalid type");if(up(this.Xc,3,r,n),t={layer_ids:t.join(","),radius:i},eb(e))t.route_id=e;else{var a=e.S;for(e=0,i=a.length;e<i;e+=3)s+=a[e]+","+a[e+1],e<i-3&&(s+=",");t.corridor=s}return o&&Oa(t,o),this.Bg("search/corridor",t,r,n)},dq.prototype.searchByCorridor=dq.prototype.Xc,dq.prototype.re=function(t,e,i,r,n){function o(t,e){e&&s--,i(t,!s)}var s,a=[];if(!db(t))throw new C(this.re,0,"has invalid type");for(B(e,J,this.re,1,"has invalid type"),up(this.re,2,i,r),e={bbox:e.fa+","+e.W+";"+e.ga+","+e.ca},n&&Oa(e,n),t=e.layer_id?[e.layer_id]:t,n=0,s=t.length;n<s;n++)e.layer_id=t[n],a.push(this.Bg("search/bbox",e,o,r));return new hq(a)},dq.prototype.searchByBoundingBox=dq.prototype.re,dq.prototype.Lr=function(t,e,i,r){var n,o=[];if(!eb(t))throw new C(this.Lr,0,"has invalid type");up(this.Lr,1,e,i);var s={layer_id:t};return r&&Oa(s,r),r=this.request("search/all",fq,s,function(r){r.geometries.length?(r=Kp(r,t),n=new pq(r,e,i),o.push(n)):e(we,!0)},i),o.push(r),new hq(o)},dq.prototype.searchAll=dq.prototype.Lr;var wq={delete:/^GEOMETRY_ID$/,append:/^(?!GEOMETRY_ID$)/};function xq(t,e,i,r,n,o){function s(){m++,r(this,m===p)}function a(t){m++,n(t,this,m===p)}var l,c="append"!==e,h={},u=Ra(),p=0,d=[],m=0;if(!db(i))throw new C(o,0,i);for(up(o,1,r,n),l=i.length;l--;){var f=i[l];if(B(f,Bp)){var g=f.Qf().zh().layerId,y=f.xa("GEOMETRY_ID");if(c){if(y===x||""===String(y))var v='GEOMETRY_ID must not be null or ""';h[y=g+"_"+y]&&(v="same GEOMETRY_ID for multiple rows"),h[y]=f}else y!==x&&""!==String(y)&&(v='GEOMETRY_ID must be null or ""')}else v="Invalid type";if(v)throw new C(o,0,"- Invalid row at index "+l+", "+v);(y=u[g])||(y=u[g]=[],p++),y.push(f)}for(g in u){for(i=[],l=(y=u[g]).length;l--;)i.push(y[l].Lk);d.push(t.request(sq,fq,{layer_id:g,action:e,changes:y[0].Qf().ns(wq[e]||null,i)},z(s,y),z(a,y)))}return new hq(d)}function yq(t){var e=zq;if(!t||!eb(oe(t.layerId,t.layer))||!hb(t.level)||Ya(t.rowFilter)&&!Wa(t.rowFilter)||Ya(t.rowFilterContext)&&!ya(t.rowFilterContext))throw new C(e,1,Ya("invalid layer config")?"invalid layer config":t)}function zq(t,e,i){var r=this,n=e&&e.rowFilter,o=i.resultType;zq.g.constructor.call(this,i),B(t,Aq,zq,0),yq(e),n?(i=Ma(e)).rowFilter=n.toString():i=Ma(e),delete i.layer,i.layerId=oe(e.layerId,e.layer),(new Qg).registerProcessor("pde","H.service.extension.worker.processor"),t=t.i().clone().A(Bq+"."+Cq).v({meta:1}),new Sg("pde",{message:[this.uid,0,{tileSize:this.tileSize,projected:!0,onlyOutline:4===o,serverUrl:t.toString(),layerConfigs:[i],horizontalMargin:1}]}).then(function(){r.qq=!0,r.hb()},this.Hc)}
2dq.prototype.bt=function(t,e,i){return xq(this,"append",t,e,i,this.bt)},dq.prototype.appendRows=dq.prototype.bt,dq.prototype.Kx=function(t,e,i){return xq(this,"update",t,e,i,this.Kx)},dq.prototype.updateRows=dq.prototype.Kx,dq.prototype.Ct=function(t,e,i){return xq(this,"delete",t,e,i,this.Ct)},dq.prototype.deleteRows=dq.prototype.Ct,X.prototype.Jz=function(t){return this.Ja(dq,t)},X.prototype.getCustomLocationService=X.prototype.Jz,u(zq,$p),t("H.service.extension.platformData.TileProvider",zq),zq.prototype.ou=function(t,e,i){return(t=new Tp(t,e,i)).Ty=Dq,t};var Dq=new P({strokeColor:"transparent",fillColor:"transparent",lineWidth:0,lineJoin:"round",lineCap:"round"});function Eq(t,e,i,r,n,o){up(Eq,1,e,i),up(Eq,2,r,n),(this.Vn=t.length)?(this.Nb=t,this.on=e,this.en=i,this.lk=0,this.xn=z(this.xn,this),this.Ly=r,this.Jy=n,this.Yh=Ra(),Oa(this.Yh,Fq,o||{}),this.js={},globalThis.setTimeout(this.xn,0)):e(we,!0)}zq.prototype.u=function(t,e,i,r,n){var o,s=this,a=this.getTileKey(t,e,i);a=this.Rb().get(a);var l={cancel:ve},c=!0,h=this.resultType;if(a&&(4===h||8===h?a.Ih()||(r(to.pop(this.tileSize),null),c=!1):(r(x),c=!1)),c){var u=globalThis.setTimeout(function(){(o=new Sg("pde",{message:[s.uid,1,[t,e,i]]})).then(r,n)},500);l.cancel=function(){o?o.cancel():globalThis.clearTimeout(u)}}return l},zq.prototype.requestInternal=zq.prototype.u,zq.prototype.disposeInternal=function(){zq.g.disposeInternal.call(this),new Sg("pde",{message:[this.uid,3]})},zq.ResultType=cq;var Fq={duration:100,vz:"geometry",uz:"WKT",ZC:"searchAttributes",yt:A};function Aq(t){Aq.g.constructor.call(this,Aq,t),oo(Aq)}Eq.prototype.xn=function(){for(var t,e=[],i=!1,r=yj();this.lk<this.Vn;){var n=this.Nb[this.lk];if(i=n.attributes,t=n.layerId||this.Yh.yt,n.distance&&(i[this.Yh.ZC]={nearest:new Ye(n.nearestLat,n.nearestLon),distance:n.distance}),n=n[this.Yh.vz]){try{var o=mg(new Fg(n))}catch(t){this.en(new globalThis.Error(t.message)),i=!0;break}i[this.Yh.uz]=o}if((n=this.js[t])||(n=this.js[t]=this.Ly({layerId:t,columnNames:Object.keys(i)})),i=this.Jy(n,i),e.push(i),this.lk++,(i=this.lk===this.Vn)||yj()-r>=this.Yh.duration){this.on(e,i);break}}i?this.js={}:this.ll=globalThis.setTimeout(this.xn,0)},Eq.prototype.cancel=function(){globalThis.clearTimeout(this.ll),this.lk<this.Vn&&this.en(new globalThis.Error("parsing canceled"))},Eq.prototype.cancel=Eq.prototype.cancel,u(Aq,Co),t("H.service.extension.platformData.Service",Aq),Aq.prototype.ya=function(){return{subDomain:"s.fleet.ls",path:"1"}},Aq.CONFIG_KEY="platformData",Aq.prototype.request=function(t,e,i,r,n){return this.I(t,e,i,r,n)},Aq.prototype.request=Aq.prototype.request,Aq.prototype.I=function(t,e,i,r,n){var o="text/plain";if(!t)throw new C(this.request,0,t);if(!e)throw new C(this.request,1,e);if(!r)throw new C(this.request,3,r);if(!n)throw new C(this.request,4,n);return t=this.i().clone().A(t+"."+e).v(i),e===Gq.JSON&&(o="application/json"),this.u(t,r,n,o)};var Bq="tiles";Aq.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:Bq,FILE:"file",INDEX:"index"};var Cq="json",Gq={TXT:"txt",JSON:Cq,HTML:"html",BIN:"bin"};function Hq(t,e,i){if(!db(t))throw new C(i,0,"has invalid type");if(!db(e))throw new C(i,1,"has invalid type");if(t.length!==e.length||!t.length)throw new C(i,1,"specify one key attribute for each given layer id in the same order")}function Iq(t){Ho.g.constructor.call(this,Iq,t),oo(Iq)}function Jq(t){Jq.g.constructor.call(this,Jq,t),this.su=t.getToken}function Rq(t,e,i,r){return t.i().clone().A(e+"/layers/"+i+"/features").v(r||{})}function Pq(t,e,i,r,n){return Rq(t,i,r,e=Object.assign({},n,{id:new yo(e)}))}function Nq(t,e,i,r,n){return t.i().clone().A(i+"/layers/"+r+"/features/"+e).v(n||{})}function Kq(t,e,i,r){ab(i,"String",t,e,"must be a string"),ab(r,"String",t,e+1,"must be a string")}function Mq(t,e){ab(e,"String",t,0,"must be a string")}function Oq(t,e){if(!Array.isArray(e)||0===e.length||e.some(function(t){return"string"!=typeof t}
2))throw new C(t,0,"must be a non-empty array of strings")}function Qq(t,e,i){if(!ya(i))throw new C(t,e,"must be a GeoJSON object")}function Lq(t,e,i,r){if(!Wa(i))throw new C(t,e,"must be a function");if(!Wa(r))throw new C(t,e+1,"must be a function")}function Sq(t,e,i,r){if(Sq.g.constructor.call(this,r?{min:r.min,max:r.max,engineType:r.engineType}:void 0),B(t,Jq,Sq,0),!eb(e))throw new C(Sq,1,'"catalogHrn" must be a string');if(!eb(i))throw new C(Sq,2,'"layerId" must be a string');this.$=t,this.$g=e,this.Mh=i,this.Pk=ya(r)&&ya(r.parameters)?r.parameters:{},this.Wa(this.Fp())}function Tq(t,e,i){var r,n=this,o=Object.assign({},i||xe),s=no(o.min,1),a=no(o.max,17);o.tileSize=o.tileSize||512,o.min=$b(s,1,17)+Jj(o.tileSize,window.devicePixelRatio||1),o.max=$b(a,1,17),Tq.g.constructor.call(this,o),B(t,Uq,Tq,0),B(e,gi,Tq,1),this.$=t,e.Yb&&e.Yb("OMV"),this.Wa(e,!0),this.zn=!1,i&&(i.politicalView&&(this.An=i.politicalView),Vq(this,i.lg,i.lg2),this.zn=!!i.pois),this.Cw=function(){n.Il=lo(n),n.reload(!1)},t.addEventListener("versionupdate",this.Cw),this.Il=lo(this),Tq.prototype.Zo=(r=/^v2\/vectortiles\/(.+)\/mc$/.exec(t.i().hf))?r[1]:A+""}function Vq(t,e,i){var r=eb(e),n=eb(i);r&&(t.rw=e),n&&(t.Ut=i),(r||n)&&(t.$j=[],(n=(r=/^([a-zA-Z]{2})(-|$)/).exec(e))&&("zh"===n[1]?t.$j.push(e):t.$j.push(n[1])),(n=r.exec(i))&&("zh"===n[1]?t.$j.push(i):t.$j.push(n[1])),t.oq=!0)}Aq.EntryPointType=Gq,Aq.prototype.Nd=function(t,e){var i=e&&e.resultType;return t=new zq(this,t,e),1==i||2===i?new kj(t):new Ik(t)},Aq.prototype.createTileLayer=Aq.prototype.Nd,Aq.prototype.Bg=function(t,e,i,r){var n,o=[],s=e.layer_id||e.layer_ids;return t=this.request(t,Cq,e,function(t){n=new Eq(t.geometries,i,r,function(t){return new Sp([],t.columnNames,t)},function(t,e){var i=t.Sd;return t.Nb?t.Nb.push(e):t.Nb=[e],i.call(t,t.Nb.length-1)},{yt:s}),o.push(n)},function(t){r(new globalThis.Error(t))}),o.push(t),new hq(o)},Aq.prototype.re=function(t,e,i,r,n,o){function s(t,e){e&&a--,r(t,!a)}var a,l=[];for(Hq(t,e,this.re),up(this.re,3,r,n),B(i,J,this.re,2),i={bbox:i.fa+","+i.W+";"+i.ga+","+i.ca},o&&Oa(i,o),t=i.layer_id?[i.layer_id]:t,o=0,a=t.length;o<a;o++)i.layer_id=t[o],i.key_attribute=e[o],l.push(this.Bg("search/bbox",i,s,n));return new hq(l)},Aq.prototype.searchByBoundingBox=Aq.prototype.re,Aq.prototype.Yc=function(t,e,i,r,n,o,s){if(Hq(t,e,this.Yc),B(i,Ye,this.Yc,2,"has invalid type"),!hb(r))throw new C(this.Yc,3,"has invalid type");return up(this.Yc,4,n,o),t={layer_ids:t.join(","),key_attributes:e.join(","),proximity:i.lat+","+i.lng+","+r},s&&Oa(t,s),this.Bg("search/proximity",t,n,o)},Aq.prototype.searchByProximity=Aq.prototype.Yc,Aq.prototype.Xc=function(t,e,i,r,n,o,s){var a="";if(Hq(t,e,this.Xc),!eb(i)&&!B(i,K))throw new C(this.Xc,1,"has invalid type");if(!hb(r))throw new C(this.Xc,2,"has invalid type");if(up(this.Xc,4,n,o),t={layer_ids:t.join(","),key_attributes:e.join(","),radius:r},eb(i))t.route_id=i;else{for(r=i.S,i=0,e=r.length;i<e;i+=3)a+=r[i]+","+r[i+1],i<e-3&&(a+=";");t.corridor=a}return s&&Oa(t,s),this.Bg("search/corridor",t,n,o)},Aq.prototype.searchByCorridor=Aq.prototype.Xc,X.prototype.tA=function(t){return this.Ja(Aq,t)},X.prototype.getPlatformDataService=X.prototype.tA,u(Iq,Co),t("H.service.extension.customRoute.Service",Iq),Iq.prototype.ya=function(){return{subDomain:"s.fleet.ls",path:"2"}},Iq.CONFIG_KEY="customRoute",Iq.prototype.Ic=function(t){return Error(t.issues&&t.issues.length?t.issues.map(function(t){return t.message}).join(". "):t)},Iq.prototype.Xg=function(t,e,i){return up(this.Xg,1,e,i),t=this.i().clone().A("calculateroute.json").v(t),this.u(t,e,i)},Iq.prototype.calculateRoute=Iq.prototype.Xg,X.prototype.Kz=function(t){return this.Ja(Iq,t)},X.prototype.getCustomRoutingService=X.prototype.Kz,u(Jq,Co),t("H.service.iml.Service",Jq),Jq.prototype.ya=function(){return{host:"interactive.data.api.platform.here.com",path:"interactive/v1/catalogs"}},Jq.prototype.Ic=function(t){var e=[{keys:["code","title","cause","action"],format:function(){return t.code+": "+t.title+"; cause: "+t.cause+"; action: "+t.action}},{keys:["error","error_description"],format:function(){return t.error+": "+t.error_description}},{keys:["error","errorMessage"],format:function(){return t.error+": "+t.errorMessage}}];return Error(ya(t)?function(){for(var i=ea(e),r=i.next();!r.done;r=i.next()){var n=(r=r.value).format;if(r.keys.every(function(e){return t[e]}))return n()}return JSON.stringify(t)}():t)}
2,Jq.prototype.Dh=function(t,e,i,r,n){var o=this.Dh;return Kq(o,0,t,e),Lq(o,2,i,r),t=this.i().clone().A(t+"/layers/"+e+"/statistics").v(n||{}),this.I(t,"GET",i,r)},Jq.prototype.getStatistics=Jq.prototype.Dh,Jq.prototype.mm=function(t,e,i,r,n,o,s,a,l){var c=l?"":".mvtf";return t=this.i().clone().A(r+"/layers/"+n+"/tile/web/"+i+"_"+t+"_"+e+c).v(Object.assign({clip:!0},a)),this.I(t,"GET",l?o:function(t){return t.arrayBuffer().then(o)},s,void 0,l?"application/json":"arraybuffer")},Jq.prototype.getFeaturesByTile=Jq.prototype.mm,Jq.prototype.fu=function(t,e,i,r,n,o){var s=this.fu;return Mq(s,t),Kq(s,1,e,i),Lq(s,3,r,n),t=Nq(this,t,e,i,o),this.I(t,"GET",r,n)},Jq.prototype.getFeatureById=Jq.prototype.fu,Jq.prototype.Te=function(t,e,i,r,n,o){var s=this.Te;return Oq(s,t),Kq(s,1,e,i),Lq(s,3,r,n),t=Pq(this,t,e,i,o),this.I(t,"GET",r,n)},Jq.prototype.getFeaturesById=Jq.prototype.Te,Jq.prototype.wh=function(t,e,i,r,n){var o=this.wh;if(!ya(t)||!(t.bbox||t.north&&t.east&&t.south&&t.west))throw new C(o,0,'must be an object with either "bbox" or a full set of "north", "east", "south" and "west"');return Kq(o,1,e,i),Lq(o,3,r,n),t=this.i().clone().A(e+"/layers/"+i+"/bbox").v(t),this.I(t,"GET",r,n)},Jq.prototype.getFeaturesByBoundingBox=Jq.prototype.wh,Jq.prototype.hu=function(t,e,i,r,n){var o=this.hu;if(!(ya(t)&&t.radius&&(t.lat&&(t.lng||t.lon)||t.refCatalogHrn&&t.refLayerId&&t.refFeatureId)))throw new C(o,0,'must be an object with "radius" and a combination of either "lat"+"lng" or "refCatalogHrn"+"refLayerId"+"refFeatureId"');return Kq(o,1,e,i),Lq(o,3,r,n),t=this.i().clone().A(e+"/layers/"+i+"/spatial").v(t),this.I(t,"GET",r,n)},Jq.prototype.getFeaturesByPointAndRadius=Jq.prototype.hu,Jq.prototype.gu=function(t,e,i,r,n,o){var s=this.gu;if(!ya(t)||!t.radius)throw new C(s,0,'must be an object with "radius"');return Qq(s,1,e),Kq(s,2,i,r),Lq(s,4,n,o),t=this.i().clone().A(i+"/layers/"+r+"/spatial").v(t),this.I(t,"POST",n,o,e)},Jq.prototype.getFeaturesByGeometryAndRadius=Jq.prototype.gu,Jq.prototype.Qw=function(t,e,i,r,n){var o=this.Qw;return Kq(o,0,t,e),Lq(o,2,i,r),t=this.i().clone().A(t+"/layers/"+e+"/search").v(n||{}),this.I(t,"GET",i,r)},Jq.prototype.searchFeatures=Jq.prototype.Qw,Jq.prototype.Yu=function(t,e,i,r,n){var o=this.Yu;return Kq(o,0,t,e),Lq(o,2,i,r),t=this.i().clone().A(t+"/layers/"+e+"/iterate").v(n||{}),this.I(t,"GET",i,r)},Jq.prototype.iterateFeatures=Jq.prototype.Yu,Jq.prototype.mf=function(t,e,i,r,n,o){var s=this.mf;return Qq(s,0,t),Kq(s,1,e,i),Lq(s,3,r,n),e=Rq(this,e,i,o),this.I(e,"PUT",r,n,t)},Jq.prototype.putFeatures=Jq.prototype.mf,Jq.prototype.kf=function(t,e,i,r,n,o){var s=this.kf;return Qq(s,0,t),Kq(s,1,e,i),Lq(s,3,r,n),e=Rq(this,e,i,o),this.I(e,"POST",r,n,t)},Jq.prototype.postFeatures=Jq.prototype.kf,Jq.prototype.Hf=function(t,e,i,r,n){var o=this.Hf;return Oq(o,t),Kq(o,1,e,i),Lq(o,3,r,n),t=Pq(this,t,e,i),this.I(t,"DELETE",r,n)},Jq.prototype.deleteFeatures=Jq.prototype.Hf,Jq.prototype.Aw=function(t,e,i,r,n,o,s){var a=this.Aw;return Mq(a,t),Qq(a,1,e),Kq(a,2,i,r),Lq(a,4,n,o),t=Nq(this,t,i,r,s),this.I(t,"PUT",n,o,e)},Jq.prototype.putFeature=Jq.prototype.Aw,Jq.prototype.fw=function(t,e,i,r,n,o,s){var a=this.fw;return Mq(a,t),Qq(a,1,e),Kq(a,2,i,r),Lq(a,4,n,o),t=Nq(this,t,i,r,s),this.I(t,"PATCH",n,o,e)},Jq.prototype.patchFeature=Jq.prototype.fw,Jq.prototype.At=function(t,e,i,r,n){var o=this.At;return Mq(o,t),Kq(o,1,e,i),Lq(o,3,r,n),t=Nq(this,t,e,i),this.I(t,"DELETE",r,n,void 0,"text/plain")},Jq.prototype.deleteFeature=Jq.prototype.At,Jq.prototype.I=function(t,e,i,r,n,o){return o=void 0===o?"application/json":o,e={method:e,headers:Object.assign({},n?{"Content-Type":"application/geo+json"}:void 0,"function"==typeof this.su?{Authorization:"Bearer "+this.su()}:void 0,this.Ub)},n&&(e.data=JSON.stringify(n)),(n=new Me(o,t.toString(),Yd,e)).then(i,Eo(this,t,r)),n},Jq.CONFIG_KEY="iml",X.prototype.Zz=function(t){return this.Ja(Jq,t)},X.prototype.getIMLService=X.prototype.Zz,u(Sq,S),t("H.service.iml.Provider",Sq),Sq.prototype.u=function(t,e,i,r,n){return this.$.mm(t,e,i,this.$g,this.Mh,r,n,this.Pk)},Sq.prototype.requestInternal=Sq.prototype.u,Sq.prototype.Wc=te,Sq.prototype.providesOMV=Sq.prototype.Wc,Sq.prototype.K=function(){return this.lb()},Sq.prototype.getStyle=Sq.prototype.K,Sq.prototype.Bb=function(t){B(t,Ei)&&t.Yb("MVT"),this.Wa(t)},Sq.prototype.setStyle=Sq.prototype.Bb,Sq.prototype.Fp=function(){return this.jb===Xi.WEBGL?new Ei({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"]]}}}
2,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",cap:"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+":"+this.Mh,when:["==",["geometry-type"],"LineString"],technique:"solid-line",color:"#0258AE",width:"2px",renderOrder:203}]})},u(Tq,S),t("H.service.omv.Provider",Tq),Tq.prototype.Wc=te,Tq.prototype.providesOMV=Tq.prototype.Wc,Tq.prototype.cc=function(t){return this.Il.test(t)},Tq.prototype.cacheFilter=Tq.prototype.cc,Tq.prototype.Td=function(t,e,i){return this.$.Rf(t,e,i).toString()},Tq.prototype.getTileKey=Tq.prototype.Td,Tq.prototype.Rb=function(){return this.VB},Tq.prototype.getCache=Tq.prototype.Rb,Tq.prototype.vA=function(){return this.An},Tq.prototype.getPoliticalView=Tq.prototype.vA,Tq.prototype.dD=function(t){var e=this.An;this.An=t,this.dispatchEvent(new Oi("politicalviewchange",this.An,e))},Tq.prototype.setPoliticalView=Tq.prototype.dD,Tq.prototype.MAX_STORE_TIME=2592e6,Tq.prototype.Wi=function(){return ml()},Tq.prototype.rd=function(){return ml()?ll():Tq.g.rd.call(this)},Tq.prototype.u=function(t,e,i,r,n){return this.$.Pa(t,e,i,r,n)},Tq.prototype.requestInternal=Tq.prototype.u,Tq.prototype.Bb=function(t){t.Yb&&t.Yb("OMV"),this.Wa(t)},Tq.prototype.setStyle=Tq.prototype.Bb,Tq.prototype.K=function(){return Tq.g.lb.apply(this)},Tq.prototype.getStyle=Tq.prototype.K,Tq.prototype.lb=function(){var t=Tq.g.lb.apply(this),e=t.getState()===hi.READY,i=t.Qd();return e&&i&&i.global&&(this.oq&&(this.rw&&(i.global.ux_language=this.rw),this.Ut&&(i.global.ux_language_fallback=this.Ut)),this.zn&&i.global.poi&&i.global.poi.default&&(i.global.poi.default.visible=this.zn),this.oq||this.zn)&&(t=new Ei(i,t.Kc())),t},Tq.prototype.getStyleInternal=Tq.prototype.lb,Tq.prototype.oq=!1;var Wq=["en"];function Uq(t){Uq.g.constructor.call(this,Uq,t);var e=Do(this,t).mapVersion;this.Hn=t.queryParams||{},this.ek=Ya(e)?e:Xq[this.i().toString()],Ya(this.ek)||Yq(this)}Tq.prototype.Jp=function(){return this.$j||Wq},Tq.prototype.getLanguages=Tq.prototype.Jp,Tq.prototype.disposeInternal=function(){Tq.g.disposeInternal.call(this),this.$.removeEventListener("versionupdate",this.Cw)},Tq.prototype.VB=new Lj(256),Tq.prototype.U=function(t,e){return this.$.U().query(this.Zo,e,t)},Tq.prototype.getCopyrights=Tq.prototype.U,u(Uq,Co),t("H.service.omv.Service",Uq),Uq.prototype.ya=function(){return{subDomain:"vector",path:"v2/vectortiles/base/mc"}},Uq.CONFIG_KEY="omv";var Xq={};function Yq(t){t.u(t.i().clone().A("../../info"),function(e){e=e.mapVersion;var i=t.i().toString();t.ek=e,e!==Xq[i]&&(Xq[i]=e,t.dispatchEvent("versionupdate"))},function(){})}function Zq(t){Zq.g.constructor.call(this,Zq,t)}function $q(t,e,i){this.bf=t=$b(t,0,30),this.rb=e,this.pj=i,this.fs=[],this.ci=[];do{this.ci[t]=[],this.fs[t]=new ar}while(t--);e===br?(this.Rs=cr,this.normalize=dr):(this.Rs=er,this.normalize=fr),this.hk=1/0,this.Ym=-1/0}kb(Xq),Uq.prototype.jA=function(){return this.ek},Uq.prototype.getMapVersion=Uq.prototype.jA,Uq.prototype.md=function(t,e,i){e=e||{};var r={min:0,max:22};return ya(i)&&mo(r,i),new Ik(new Tq(this,t,e),r)},Uq.prototype.createLayer=Uq.prototype.md,Uq.prototype.Pa=function(t,e,i,r,n){return this.u(this.Rf(t,e,i),function(t){return t.arrayBuffer().then(r,n)},n,"arraybuffer")},Uq.prototype.Rf=function(t,e,i){return t=this.i().clone().A(i+"/"+t+"/"+e+"/omv"),Ya(this.ek)&&t.v({mv:this.ek}).v(this.Hn),t},Uq.prototype.sm=function(t){return pn()+"/"+t},Uq.prototype.Oj=function(t,e){if(!Wa(t))throw new C(this.Oj,0,'"onResult" must be a function');if(!Wa(e))throw new C(this.Oj,1,'"onError" must be a function');return this.u(this.i().clone().vc("v2/vectortiles/pviews"),t,e)},Uq.prototype.getPoliticalViews=Uq.prototype.Oj,X.prototype.Mj=function(t){return this.Ja(Uq,t)},X.prototype.getOMVService=X.prototype.Mj,Uq.prototype.Jf=function(){this.ec=new dp,this.u(this.i().clone().A("../../copyrights"),z(this.ql,this),ve)},Uq.prototype.ql=function(t){ep(this.ec,t),this.dispatchEvent("copyrightupdate")},Uq.prototype.U=function(){return this.ec||this.Jf(),this.ec},Uq.prototype.getCopyrights=Uq.prototype.U,u(Zq,Co),t("H.service.SearchService",Zq),Zq.CONFIG_KEY="search",Zq.prototype.ya=function(){return{subDomain:"search",path:"v1"}},Zq.prototype.Ic=function(t){return t=[t.title,t.action,t.cause].filter(function(t){return t}),Error(t.join(". "))}
2,Zq.prototype.yp=function(t,e,i){return t=this.i().clone().sa("geocode").A("geocode").v(t),this.u(t,e,i)},Zq.prototype.geocode=Zq.prototype.yp,Zq.prototype.Fr=function(t,e,i){return t=this.i().clone().sa("revgeocode").A("revgeocode").v(t),this.u(t,e,i)},Zq.prototype.reverseGeocode=Zq.prototype.Fr,Zq.prototype.sy=function(t,e,i){return t=this.i().clone().sa("autosuggest").A("autosuggest").v(t),this.u(t,e,i)},Zq.prototype.autosuggest=Zq.prototype.sy,Zq.prototype.autocomplete=function(t,e,i){return t=this.i().clone().sa("autocomplete").A("autocomplete").v(t),this.u(t,e,i)},Zq.prototype.autocomplete=Zq.prototype.autocomplete,Zq.prototype.Vy=function(t,e,i){return t=this.i().clone().sa("discover").A("discover").v(t),this.u(t,e,i)},Zq.prototype.discover=Zq.prototype.Vy,Zq.prototype.BB=function(t,e,i){return t=this.i().clone().sa("lookup").A("lookup").v(t),this.u(t,e,i)},Zq.prototype.lookup=Zq.prototype.BB,Zq.prototype.wy=function(t,e,i){return t=this.i().clone().sa("browse").A("browse").v(t),this.u(t,e,i)},Zq.prototype.browse=Zq.prototype.wy,X.prototype.GA=function(t){return this.Ja(Zq,t)},X.prototype.getSearchService=X.prototype.GA,t("H.service.buildInfo",function(){return Ig("H-service","1.64.3","4cd9a8f",{region:"row"})});var gr=Math.log(.5);function dr(t){return this.kp?Math.round((t-this.hk)/this.kp*255):127}function fr(t){return void 0===this.$t?127:Math.round(255*Math.pow(t,this.$t))}function hr(t,e,i,r,n){var o,s,a=1<<e;return r=Zb(r,a),!(a=0<=i&&i<a&&(o=t.ci[e])&&(s=o[i])&&(a=s[r])||null)&&n&&0<=e&&(a=hr(t,e-1,i>>1,r>>1,n)),a}function ir(t,e,i,r,n,o){for(var s,a=[];i<=r;i++)for(s=n;s<=o;s++)a.push(hr(t,e,i,s,!1));return a}function jr(t,e){var i,r=0,n=0,o=hr(t,0,0,0,!1);return e.gm||(e.z===t.bf?e.Bj=e.Bc:(kr(t,e,function(e){var s=lr(t,e),a=4-s.length;if(e.z!==t.bf){for(i=0;i<s.length;i++)r+=s[i].Bc,n++;r+=a*o.Bc,n+=a}}),e.Bj=r/n),e.gm=!0),e.Bj}function kr(t,e,i){e=[e];for(var r,n;0<e.length;)r=lr(t,n=e.shift()),i(n),e.push.apply(e,r)}function lr(t,e){var i,r,n,o=[];for(r=0;1>=r;r++)for(n=0;1>=n;n++)(i=hr(t,e.z+1,2*e.x+r,2*e.y+n,!1))&&o.push(i);return o}function er(t,e,i){this.x=t,this.y=e,this.z=i,this.Bc=this.dd=this.count=0,this.gm=!1,this.Bj=0}function cr(t,e,i){this.x=t,this.y=e,this.z=i,this.Bc=this.dd=this.count=0,this.gm=!1,this.Bj=0}function ar(){this.yv=this.xv=1/0,this.Qh=this.Iq=-1/0}function mr(t,e,i,r,n){1&n&&nr(t,t,e,i,r,0),2&n&&nr(t,t,e,i,r,1),4&n&&nr(t,t,e,i,r,2),8&n&&nr(t,t,e,i,r,3)}function nr(t,e,i,r,n,o){for(var s,a,l,c,h=(i+1)*(i+1),u=4*r,p=i+1,d=[{r:0,pz:0,b:0,a:0,next:null}],m=1,f=["r","g","b","a"][o],g=2*i+1;m<g;m++)d[m]={r:0,pz:0,b:0,a:0,next:null},d[m-1].next=d[m];d[2*i].next=d[0];var y=4*(r-1);for(s=0;s<n;s++){var v=s*u,_=t[v+o],b=_*p*(i+2)/2;for(g=_*p,m=0;m<=i;m++)d[m][f]=_;var x=0;for(m=1;m<=i;m++){var w=m<r?v+4*m:v+y;b+=(w=t[w+o])*(p-m),x+=w,d[i+m][f]=w}w=d[0],l=d[p],m=v,c=4*p;var S=v+y;for(_=0;_<r;_++){e[m+o]=b/h,b-=g;var T=_+p<r?m+c:S;if(b+=x+=T=t[T+o],g-=w[f],g+=l[f],x-=l[f],w[f]=T,w=w.next,l=l.next,m+=4,!b)for(;(a=4*(_+p))<u&&0===t[v+o+a];)_++,m+=4}}for(v=(n-1)*u,_=0;_<r;_++){for(b=(s=e[(t=4*_)+o])*p*(i+2)/2,g=s*p,m=0;m<=i;m++)d[m][f]=s;for(x=0,m=1;m<=i;m++)b+=(w=e[(w=m<n?t+m*u:t+v)+o])*(i-m+1),x+=w,d[i+m][f]=w;for(w=d[0],l=d[p],m=t,S=p*u,y=t+v,s=0;s<n;s++)if(e[m+o]=b/h,b-=g,b+=x+=T=e[(T=s+p<n?m+S:y)+o],g-=w[f],g+=l[f],x-=l[f],w[f]=T,w=w.next,l=l.next,m+=u,!b)for(;(a=s+p)<n&&0===e[a*u+o+t];)s++,m+=u}}function or(t,e,i){this.bB=e=t>>e,this.EB=Math.log(e)*Math.LOG2E,this.Dc=t=document.createElement("CANVAS"),this.xy=t.getContext("2d"),this.yy=t.width=t.height=3*e;var r=document.createElement("canvas");t=i.Ou;var n,o=i.rD;for(s in e=[],r.width=256,r.height=1,r=r.getContext("2d"),o)o.hasOwnProperty(s)&&e.push({stop:parseFloat(s),value:o[s]});o=e.length,e.sort(this.qD),0<e[0].stop&&e.unshift({stop:0,value:e[0].value}),1>e[o-1].stop&&e.push({stop:1,value:e[o-1].value}),o=e.length;var s=r.createLinearGradient(0,0,256,0);for(n=0;n<o;n++){if(!t&&l){var a=l.stop+(e[n].stop-l.stop)/2;s.addColorStop(a,l.value),s.addColorStop(a,e[n].value)}s.addColorStop(e[n].stop,e[n].value);var l=e[n]}r.fillStyle=s,r.fillRect(0,0,256,1),this.Fy=r.getImageData(0,0,256,1).data,this.cB=i.Ou}function pr(t,e){this.canvas=t,this.size=e}function qr(t,e){var i,r=0;if(!ya(t)||La(t))throw new C(qr,0,t);for(i in t){var n=+i;if(r++,!(hb(n)&&0<=n&&1>=n&&eb(t[i])))throw new C(qr,0,t)}if(2>r)throw new C(qr,0,"Specify at least 2 stops");this.rD=t,this.Ou=!!e}$q.prototype.yc=function(t){var e,i,r=t.value;void 0===r&&(r=1),r>this.Ym&&(this.Ym=r,this.kp=this.Ym-this.hk),r<this.hk&&(this.hk=r,this.kp=this.Ym-this.hk);var n=bj.Re(t).scale(1073741823).floor();r=this.bf;var o=n.x>>30-r;for(n=n.y>>30-r,i=this.Rs;-1<r;){this.ci[r][n]||(this.ci[r][n]=[]),(e=this.ci[r][n][o])||(e=this.ci[r][n][o]=new i(o,n,r)),e.yc(t,r);var s=this.fs[r];s.yv>e.dd&&(s.yv=e.dd),s.Qh<e.dd&&(s.Qh=e.dd),s.xv>e.Bc&&(s.xv=e.Bc),s.Iq<e.Bc&&(s.Iq=e.Bc),r--,o>>=1,n>>=1}},$q.prototype.clear=function(){$q.call(this,this.bf,this.rb,this.pj)},er.prototype.yc=function(t,e){this.count++,this.dd+=t.value||1,this.Bc=this.dd/Math.pow(2,2*(30-e))},cr.prototype.yc=function(t){t=t.value,this.dd+=void 0!==t?t:1,this.Bc=this.dd/++this.count,this.gm=!1},or.prototype.qD=function(t,e){return t.stop-e.stop},or.prototype.Vx="#000",or.prototype.jy="#080",t("H.data.heatmap.Colors",qr);var rr=new qr({0:"#008",.2:"#0b0",.5:"#ff0",.7:"#f00"},!0);function sr(t){var e=t||{},i=+e.sampleDepth,r=e.pointSize;t=+e.coarseness;var n=e.colors,o={min:e.min,max:e.max,engineType:e.engineType},s=e.tileSize,a=+e.dataMax;if(e.tileSize&&(o.tileSize=s),S.call(this,o),this.Eg(e.opacity),this.rb="value"===e.type?br:tr,this.sampleDepth_
2=hb(i)?$b(Math.round(i),1,8):4,this.Ow=this.rb===tr?hb(r)?$b(Math.round(7-r),0,6):2:1,this.ct=!!e.assumeValues,e=this.max,this.pj=hb(a)?$b(Math.round(a),this.min,e+this.sampleDepth_):e,t=hb(t)?$b(Math.round(t),0,3):1,n&&!B(n,qr))throw new C(sr,0,"colors");this.Bi=new $q(e+this.sampleDepth_+this.Ow,this.rb,this.pj),this.xD=new or(this.tileSize,t,n||rr),this.rg=z(this.rg,this),this.kg=z(this.kg,this),this.On=new zj(20,this.rg)}qr.DEFAULT=rr,u(sr,S),t("H.data.heatmap.Provider",sr),sr.prototype.Dd=function(t){this.Eg(t)},sr.prototype.setOpacity=sr.prototype.Dd,sr.prototype.Ue=function(){return this.Rc},sr.prototype.getOpacity=sr.prototype.Ue,sr.prototype.Ak=te,sr.prototype.providesRasters=sr.prototype.Ak,sr.prototype.u=function(t,e,i,r,n){var o,s,a=this.ct;if(hr(this.Bi,0,0,0,!1)){if(!a){var l=ir(this.Bi,i,e-1,e+1,t-1,t+1);for(o=l.length;o--&&!a;)if(null!==l[o]){a=!0;break}}a&&(s=this.On.push([t,e,i,r,n],this.kg))}return a||r(null),s||bk},sr.prototype.requestInternal=sr.prototype.u,sr.prototype.rg=function(t,e){var i=t.done,r=e[0],n=e[1],o=e[2];e=document.createElement("canvas");var s=this.tileSize,a=e.getContext("2d");e.width=e.height=s;var l,c,h=this.xD,u=this.Bi,p=this.ct,d=this.rb,m=this.Ow,f=h.bB,g=h.xy,y=d===tr?void 0===m?2:m:1;m=y,y=Math.min(this.sampleDepth_+y,h.EB);var v=h.yy,_=u.bf;if(p&&d===br){for(c=-1;1>=c;c++)for(p=-1;1>=p;p++){var b=(b=hr(u,o,n+c,r+p,!0))?u.normalize(jr(u,b)):128;g.fillStyle="rgba("+b+",128,0,1)",g.fillRect((p+1)*f,(c+1)*f,f,f)}p=f-Math.floor(f/10),c=3,mr((b=g.getImageData(0,0,v,v)).data,p,v,v,c),g.putImageData(b,0,0)}else g.fillStyle=p?h.jy:h.Vx,g.fillRect(0,0,v,v);for(;m<=y&&o+m<=_;m++){c=f-(p=f>>m);var x=d===tr?127+Math.floor(128/(1<<y-m)):255;b=2+(1<<m);var w=1<<m,S=r<<m,T=n<<m;for(S=(w=ir(u,o+m,T-1,T+w,S-1,S+w)).length;S--;){T=S%b;var E=S/b|0;(l=w[S])&&(l=u.normalize(l.Bc),g.fillStyle="rgba("+l+","+x+",0,1)",g.fillRect(T*p+c,E*p+c,p,p))}b=g,x=p,w=c,S=f+2*p,p=f+2*p,T=T=3,mr((E=g.getImageData(w,c,S,p)).data,x,S,p,T),b.putImageData(E,w,c)}for(r=g.getImageData(0,0,v,v),n=h.Fy,o=h.cB,y=0,v=(u=r.data).length;y<v;y+=4)d=u[y],m=u[y+1],4===n.length&&(d=0),u[y]=n[4*d],u[y+1]=n[4*d+1],u[y+2]=n[4*d+2],u[y+3]=n[4*d+3]*(o?m/255:10>m?0:1);g.putImageData(r,0,0),f=(h=new pr(h.Dc,f)).size,a.drawImage(h.canvas,f,f,f,f,0,0,s,s),i.call(t,e)},sr.prototype.kg=function(t,e,i){var r=t.data;t=r[3],r=r[4],i?r():t(e)},sr.prototype.Xs=function(t,e){var i;if(!db(t))throw new C(this.Xs,0,t);if(i=t.length){for(;i--;)this.Bi.yc(t[i]);var r;i=(t=this.Bi).fs;var n=t.bf,o=0;if(t.rb===tr){var s=i[t.bf].Qh;for(r=t.bf;0<=r&&i[r].Qh===s;r--)o=r;for(s=i[0].Qh,r=0;r<=o&&s===i[r].Qh;r++)n=r;o>t.pj&&(o=t.pj),s=Math.round(n+(o-n)/2),t.$t=gr/Math.log(i[s].Iq)}this.reload(!!e)}},sr.prototype.addData=sr.prototype.Xs,sr.prototype.clear=function(){this.Bi.clear(),this.reload(!0)},sr.prototype.clear=sr.prototype.clear;var tr=0,br=1;function ur(){}function vr(){this.aB={4:function(t){return["#",t.charAt(1),t.charAt(1),t.charAt(2),t.charAt(2),t.charAt(3),t.charAt(3),"ff"].join("")},5:function(t){return["#",t.charAt(1),t.charAt(1),t.charAt(2),t.charAt(2),t.charAt(3),t.charAt(3),t.charAt(4),t.charAt(4)].join("")},7:function(t){return t+"ff"},9:function(t){return t}},this.WC={4:function(t){return[wr(t.charAt(1)),wr(t.charAt(2)),wr(t.charAt(3)),255]},5:function(t){return[wr(t.charAt(1)),wr(t.charAt(2)),wr(t.charAt(3)),wr(t.charAt(4))]},7:function(t){return[(t=parseInt(t.substring(1),16))>>16&255,t>>8&255,255&t,255]},9:function(t){return[(t=parseInt(t.substring(1),16))>>24&255,t>>16&255,t>>8&255,255&t]}}}function wr(t){return((t=parseInt(t,16))<<4)+t}function xr(t){return 16>t?"0"+Math.round(t).toString(16):Math.round(t).toString(16)}function yr(t,e,i){return/^(#|rgb).*/.test(e)?(i||(i="","#"===e.charAt(0)?i=t.aB[e.length]?e:"":"rgb"===e.substr(0,3)&&(i=2<(i=(e=e.match(/\d+(\.\d+)?/g)).length)&&5>i?["#",xr(+e[0]),xr(+e[1]),xr(+e[2]),3<i?xr(255*+e[3]):"ff"].join(""):""),e=i),(t=t.WC[e.length](e))[3]=Math.round(t[3]/255*100)/100,t):[0,0,0,255]}function zr(t){for(var e,i=(t=t.childNodes).length,r=new ur,n=new vr;i--;)switch(e=t[i],e.nodeName){case"color":this.color=r.lm(e);break;case"colorMode":this.Ey=r.Ta(e)}"random"===this.Ey&&(this.color="#"+n.zx(this.color,!1))}function Ar(t){var e=t.childNodes,i=e.length,r=new ur;for(this.Nl=new zr(t);i--;)"width"===(t=e[i]).nodeName&&(this.width=r.nm(t))}function Br(t){for(var e,i=(t=t.childNodes).length,r=new ur;i--;)switch(e=t[i],e.nodeName){case"bgColor":this.bgColor=r.lm(e);break;case"textColor":this.textColor=r.lm(e);break;case"text":this.text=r.Ta(e);break;case"displayMode":this.displayMode=r.Ta(e)}}function Cr(t){var e=t.childNodes,i=e.length,r=new ur;for(this.outline=this.fill=!0,this.Nl=new zr(t);i--;)switch(t=e[i],t.nodeName){case"fill":this.fill=r.sh(t);break;case"outline":this.outline=r.sh(t)}}function Dr(t){for(var e,i=(t=t.attributes).length;i--;)switch(e=t[i],e.name){case"x":this.x=parseFloat(e.value);break;case"y":this.y=parseFloat(e.value);break;case"xunits":this.Ye="fraction"===ur.prototype.Ta(e);break;case"yunits":this.Zd="fraction"===ur.prototype.Ta(e)}}function Er(t){var e=t.childNodes,i=new ur;for(this.offsetX=this.offsetY=0,t=e.length;t--;){var r=e[t];"href"===r.nodeName&&(this.href=i.Ta(r))}}function Fr(t){var e;if(t){var i=(t=t.childNodes).length;for(e=new ur;i--;){var r=t[i];switch(r.nodeName){case"scale":this.scale=e.nm(r);break;case"Icon":this.icon=r=new Er(r);break;case"hotSpot":this.Eu=r=new Dr(r)}}}}function Gr(t){var e=t.childNodes,i=e.length;for(this.id=t.getAttribute("id");i--;)switch(t=e[i],t.nodeName){case"IconStyle":this.Fu=t=new Fr(t);break;case"LineStyle":this.Nh=t=new Ar(t);break;case"PolyStyle":this.kw=t=new Cr(t);break;case"BalloonStyle":this.El=t=new Br(t)}}function Hr(t,e){var i=(t=t.childNodes).length,r=new ur;for(this.tD=e;i--;)switch(e=t[i],e.nodeName){case"key":this.key=r.Ta(e);break;case"styleUrl":this.cl=r.Ta(e)}}function Ir(t,e){var i=t.childNodes,r=i.length;for(this.gs=e,this.id=t.getAttribute("id"),this.wn=[];r--;)"Pair"===(t=i[r]).nodeName&&(t=new Hr(t,this.gs),this.wn.push(t))}function Jr(){this.nx={}}function Kr(t){for(var e,i=(t=t.childNodes).length,r=new ur;i--;)if("coordinates"===(e=t[i]).nodeName){e=r.Ta(e);var n=[],o=new ur;try{n=o.dw(e)}catch(t){n=[]}this.Ul=2>n.length?[]:n}}function Lr(){}function Mr(t){var e=t.childNodes,i=e.length;for(this.Rt=new K,this.Nu=[];i--;){var r=e[i],n=r.nodeName;if("outerBoundaryIs"===n||"innerBoundaryIs"===n){var o=r.childNodes;for(r=o.length;r--;){var s=o[r];if("LinearRing"===s.nodeName){var a=new Kr(s);if("outerBoundaryIs"===n){this.Rt=a.vh();var l=void 0,c=t,h=a.Ul;a=new ur;var u=c.querySelector("altitudeMode");if(u&&u.parentNode===c&&!/^\s*clampTo/.test(a.Ta(u))&&h){u=h.length;for(var p=0;p<u&&0!==l;
2p++){var d=h[p].alt;d?l?d!==l&&(l=0):l=d:l=0}(h=c.querySelector("*|altitudeOffset"))&&h.parentNode===s&&"http://www.google.com/kml/ext/2.2"===h.namespaceURI&&(s=a.nm(h))&&(l+=s),l&&(l=xb(2047,l),(s=c.querySelector("extrude"))&&s.parentNode===c&&a.sh(s)?this.St=l:this.elevation=l)}}else this.Nu.push(a.vh())}}}}}function Nr(t){for(var e,i=(t=t.childNodes).length,r=null,n=new ur;i--;)"coordinates"===(e=t[i]).nodeName&&(r=n.Ta(e));this.hv=null,r&&(this.hv=n.fr(r)||null)}function Or(t,e){var i=t&&t.childNodes||[],r=new ur;if(!t||!e)throw Error("Node or stylesContainer is not defined");for(this.visibility=!0,this.wC=t,t=i.length;t--;){var n=i[t];switch(n.nodeName){case"name":this.name=r.Ta(n);break;case"description":this.description=r.Ta(n);break;case"visibility":this.visibility=r.sh(n);break;case"open":this.open=r.sh(n);break;case"styleUrl":(this.cl=r.Ta(n))&&(n=this.cl.substr(1),this.iz=e.Sp(n,!1));break;case"Style":this.lv=n=new Gr(n)}}}function Pr(t,e){var i=document.createElement("CANVAS");i.width=1,i.height=1,this.gs=t,this.eq={},this.hr={},this.cz=new Xh(i),this.kd=e||""}function Qr(t,e,i){for(var r,n,o=(e=e.childNodes).length,s={};o--;){var a=e[o];switch(a.nodeName){case"Point":a=new Nr(a),n=Rr(t,"Marker"),(a=a.vh())&&(r=new $h(a,n),n.gr&&Cd(n.gr,"statechange",z(t.iC,t,n.gr,r,n),!1));break;case"LineString":case"LinearRing":a=new Kr(a),n=Rr(t,"Polyline"),r=new ai(a.vh(),n);break;case"Polygon":a=new Mr(a),(n=Rr(t,"Polygon")).elevation=a.elevation,n.extrusion=a.St,r=new Eh(new L(a.Rt,a.Nu),n);break;case"MultiGeometry":r=Qr(t,a,new U)}r&&(t.oh.name&&(s.name=t.oh.name),t.oh.description&&(s.description=t.oh.description),n&&n.El&&(s.balloonStyle=n.El),s.kmlNode=t.oh.wC,r.setData(s),i&&i.Y(r))}return i||r}function Rr(t,e){var i=t.oh,r={visibility:i.visibility},n=new vr,o=1,s={x:0,y:0,Ye:!1,Zd:!1},a=Sr(t,i.iz);switch(i.lv&&(a=Sr(t,i.lv,a)),e){case"Marker":if(a&&a.Fu){if((n=a.Fu).scale&&(o=n.scale),n.Eu){var l=n.Eu;s={x:l.x,y:l.y,Ye:l.Ye,Zd:l.Zd}}n.icon&&n.icon.href?(e=n.icon.href,Tr.test(e)||(e=t.kd+e),n=o+"_"+s.x+s.y+s.Ye+s.Zd+"_"+e,(l=t.eq[n]||t.hr[n])||(l=new Xh(e),t.hr[n]=l),0===l.getState()?(r.icon=t.cz,r.gr=l,r.href=e,r.anchor=s,r.scale=o):1===l.getState()&&(r.icon=l)):1!==o&&(l||(s={x:14,y:4,Ye:!1,Zd:!1}),n=Xh,t=t.Ep(),o={size:new ch((l={w:28*o,h:36*o}).w,l.h),anchor:new F(s.Ye?l.w*s.x:s.x*o,s.Zd?l.h*(1-s.y):l.h-s.y*o),hitArea:new Lh(Mh.POLYGON,[0*o,16*o,0*o,7*o,8*o,0*o,18*o,0*o,26*o,7*o,26*o,16*o,18*o,34*o,8*o,34*o])},r.icon=new n(t,o))}break;case"Polyline":r.style={},a&&a.Nh&&(o=a.Nh,r.style.strokeColor="rgba("+yr(n,o.Nl.color,!0)+")",0<=o.width&&(r.style.lineWidth=o.width));break;case"Polygon":r.style={},a&&(a.Nh&&(o=a.Nh,r.style.strokeColor="rgba("+yr(n,o.Nl.color,!0)+")",0<=o.width&&(r.style.lineWidth=o.width)),a.kw&&(o=a.kw,r.style.fillColor=o.fill?"rgba("+yr(n,o.Nl.color,!0)+")":"rgba(0,0,0,0)",o.outline||(r.style.lineWidth=0)))}return r.El=a.El,r}function Sr(t,e,i){for(var r in i=i||{},e)e.hasOwnProperty(r)&&(i[r]="object"==typeof e[r]?Sr(t,e[r],i[r]):e[r]);return i}t("H.data.utils.Dom",ur),ur.prototype.sh=function(t){return!!t&&/^\s*(1|true)\s*$/i.test(this.Ta(t))},ur.prototype.getBoolean=ur.prototype.sh,ur.prototype.Ta=function(t){var e;try{if(t.nodeType===Node.ATTRIBUTE_NODE)return t.value;var i="",r=0,n=t.childNodes;for(e=n.length;r<e;r++)n[r].nodeType!==Node.COMMENT_NODE&&(i+=n[r].nodeValue.replace(/^\s+|\s+$/g,""))}catch(t){}return i||""},ur.prototype.getString=ur.prototype.Ta,ur.prototype.nm=function(t){return parseFloat(this.Ta(t))||0},ur.prototype.getFloat=ur.prototype.nm,ur.prototype.dw=function(t){var e,i=t.split(/\s+/),r=i.length,n=!(i&&1==r),o=n?1:3,s=[];for(n||(r=(i=t.split(",")).length),e=0;e<r;e+=o){if(!(t=this.fr(n?i[e]:e+3>i.length?null:i.slice(e,e+3))))return[];s.push(t)}return s},ur.prototype.parseCoords=ur.prototype.dw,ur.prototype.fr=function(t){if(!t)return null;var e=t instanceof Array&&0<t.length&&4>t.length?t:t.split(",");t=parseFloat(e[0]);var i=parseFloat(e[1]);return e=parseFloat(e[2]),isNaN(i)||isNaN(t)?null:new Ye(i,t,isNaN(e)?void 0:e)},ur.prototype.parseCoord=ur.prototype.fr,ur.prototype.lm=function(t){return t=this.Ta(t),/^[0-9a-fA-F]{8}$/.test(t)?"#"+t.substr(6,2)+t.substr(4,2)+t.substr(2,2)+t.substr(0,2):"#000000ff"},ur.prototype.getColor=ur.prototype.lm,t("H.data.utils.ColorHelper",vr),vr.prototype.zx=function(t,e){var i="";if(!/^(#|rgb).*/.test(t)){for(i="",t=0;6>t;t++)i+="ABCDEF0123456789".charAt(Math.floor(16*Math.random()));return i+"ff"}for(t=yr(this,t,e),e=0;4>e;e++)i+=""+xr(3>e?Math.floor(Math.random()*(t[e]-0+1))+0:255*t[e]);return i},vr.prototype.toRandomRGBA=vr.prototype.zx,t("H.data.kml.ColorStyle",zr),t("H.data.kml.LineStyle",Ar),t("H.data.kml.BalloonStyle",Br),t("H.data.kml.PolyStyle",Cr),t("H.data.kml.HotSpot",Dr),t("H.data.kml.Icon",Er),t("H.data.kml.IconStyle",Fr),t("H.data.kml.Style",Gr),t("H.data.kml.Pair",Hr),Hr.prototype.K=function(){if(this.cl){var t="highlight"===this.key;t=this.tD.Sp(this.cl.substr(1),t)}return t},Hr.prototype.getStyle=Hr.prototype.K,t("H.data.kml.StyleMap",Ir),Ir.prototype.K=function(t){var e=null;t=t?"highlight":"normal";for(var i=this.wn.length;i--;)this.wn[i].key===t&&(e=this.wn[i].K());return e},Ir.prototype.getStyle=Ir.prototype.K,t("H.data.kml.StyleContainer",Jr),Jr.prototype.Co=function(t){t&&t.id&&(this.nx["style_"+t.i
2d]=t)},Jr.prototype.addStyle=Jr.prototype.Co,Jr.prototype.Sp=function(t,e){return(t=this.nx["style_"+t])instanceof Ir&&(t=t.K(e)),t},Jr.prototype.getStyleById=Jr.prototype.Sp,t("H.data.kml.Line",Kr),Kr.prototype.vh=function(){for(var t=new K,e=this.Ul?this.Ul.length:0;e--;)t.sg(this.Ul[e]);return t},Lr.prototype.elevation=0,Lr.prototype.St=0,u(Mr,Lr),t("H.data.kml.Polygon",Mr),t("H.data.kml.Point",Nr),Nr.prototype.vh=function(){return this.hv},t("H.data.kml.Feature",Or),Pr.prototype.create=function(t){return this.oh=new Or(t,this.gs),Qr(this,t)},Pr.prototype.iC=function(t,e,i){var r=i.anchor,n=i.scale;i=n+"_"+r.x+r.y+r.Ye+r.Zd+"_"+i.href;var o={};if(1===t.getState()){var s=this.eq[i];if(!s){var a=r.x,l=r.y;(s=t.mc())&&(s={w:s.w*n,h:s.h*n},o.size=s),a=r.Ye&&s?s.w*a:a*n,l=r.Zd&&s?s.h*(1-l):!r.Zd&&s?s.h-l*n:l*n,o.anchor={x:a,y:l},s=new Xh(t.Se(),o),this.eq[i]=s}e.ve(s)}delete this.hr[i]};var Tr=/^[^:\/]+:/;function Ur(t){Za(this,Ur),this.url=t,this.hj=[],this.ae=x,this.mj=z(this.mj,this),I.call(this)}Pr.prototype.Ep=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>'},u(Ur,I),t("H.data.AbstractReader",Ur);var Vr={ERROR:-1,LOADING:0,VISIT:1,READY:2};function Wr(t,e,i,r){Wr.g.constructor.call(this,e,t),this.state=i,this.message=r}function Xr(t){var e=t?t.lastIndexOf("/"):-1;this.Bk=[],Ur.call(this,t),0<=e&&(this.mB=t.substr(0,e)+"/")}function Yr(t,e){for(var i,r=t.length,n=[];r--;)(i=t[r]).nodeName===e&&n.push(i);return n}function Zr(t,e){this.Xa=t,this.Oe=e}function $r(t){return new Ye(t[1],t[0])}function bs(t){for(var e,i=as(t[0]),r=[],n=1,o=t.length;n<o;n++)e=as(t[n]),r.push(e);return new L(i,r)}function as(t){for(var e=0,i=t.length,r=new K;e<i;e++)r.sg($r(t[e]));return r}function cs(t,e){e=e||{},this.Xa=e.style||this.gh,(this.Oe=!!e.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."),Ur.call(this,t)}function ds(t){var e={};if(t.geometry){var i=t.geometry;e.type=i.type,e.properties=t.properties,i.coordinates&&(e.coordinates=i.coordinates),i.geometries&&(e.geometries=i.geometries),t.id&&(e.id=t.id)}return e}function es(t){this.na=t,this.ty=11;var e=(t=document.createElement("canvas")).getContext("2d"),i=this.na,r=14*i;t.width=r,t.height=r,e.scale(i,i),e.beginPath(),e.strokeStyle="#FFFFFF",e.fillStyle="#1080DD",e.arc(7,7,6,0,2*Math.PI,!1),e.fill(),e.lineWidth=1,e.stroke(),this.RB=new Xh(t,{size:{w:14,h:14},anchor:{x:7,y:7}}),this.mt={},this.nt={}}function fs(t,e,i){var r,n=document.createElement("canvas"),o=n.getContext("2d",{willReadFrequently:!0}),s=t.na,a=e*s;return n.width=a,n.height=a,o.scale(s,s),s=e+":"+i,(r=t.mt[s])?o.putImageData(r,0,0):(e/=2,o.beginPath(),o.strokeStyle="rgba("+i+",0.2)",o.fillStyle="rgba("+i+",1)",o.arc(e,e,e/5*3,0,2*Math.PI,!1),o.fill(),o.lineWidth=e/5*4,o.stroke(),t.mt[s]=o.getImageData(0,0,a,a)),n}function gs(t){var e;kd.call(this),this.fc=[],t?Oa(e={},hs,t):e=hs,this.options=e,kd.call(this)}Ur.State=Vr,Ur.prototype.state=Vr.READY,Ur.prototype.j={Oi:"statechange"},Ur.prototype.Sb=function(){return this.ae||(this.ae=new N,this.ae.qd().hd(this.hj)),new $k(this.ae)},Ur.prototype.getLayer=Ur.prototype.Sb,Ur.prototype.qA=function(){return this.hj.concat([])},Ur.prototype.getParsedObjects=Ur.prototype.qA,Ur.prototype.i=function(){return this.url},Ur.prototype.getUrl=Ur.prototype.i,Ur.prototype.hD=function(t){if(this.state===Vr.LOADING||this.state===Vr.VISIT)throw Error("InvalidState: state "+this.state);return this.hj=[],this.ae=x,this.url=t,this},Ur.prototype.setUrl=Ur.prototype.hD,Ur.prototype.getState=function(){return this.state},Ur.prototype.getState=Ur.prototype.getState,Ur.prototype.F=function(t,e,
2i){this.state=t,this.dispatchEvent(new Wr(e||this,this.j.Oi,t,i||""))},Ur.prototype.parse=function(){var t=this;Ya(this.url)?(this.F(Vr.LOADING),new Me("text/plain",this.url).then(function(e){try{t.mj(e)}catch(e){t.F(Vr.ERROR,x,e.message)}},function(){t.F(Vr.ERROR,x,"Error loading file")})):t.F(Vr.ERROR,x,"File url was not set")},Ur.prototype.parse=Ur.prototype.parse,u(Wr,nd),Ur.Event=Wr,u(Xr,Ur),t("H.data.kml.Reader",Xr),Xr.prototype.mj=function(t){var e,i=null;if(eb(t)&&""!=t.trim()){try{var r=(new DOMParser).parseFromString(t,"text/xml")}catch(t){return void this.F(Vr.ERROR,x,"Error parsing KML document")}if(r.getElementsByTagName("parsererror").length)this.F(Vr.ERROR,x,"Error parsing KML document");else if((t=r.childNodes&&"kml"===r.childNodes[0].nodeName?r.childNodes[0]:void 0)&&(e=Yr(t.childNodes,"Document")[0]),e=e||t){r=new Jr;for(var n=Yr(e.childNodes,"Style"),o=Yr(e.childNodes,"StyleMap"),s=n.length;s--;)t=new Gr(n[s]),r.Co(t);for(s=o.length;s--;)t=new Ir(o[s],r),r.Co(t);for(this.TB=new Pr(r,this.mB),e=(t=e.childNodes).length;e--;)r=i,"Placemark"===(n=t[e]).nodeName?(n=this.TB.create(n))&&this.Rg(n,r):"Folder"===n.nodeName&&(n={group:new U,node:n},this.Rg(n.group,r),this.Bk.push(n)),!e&&(r=this.Bk.shift())&&(t=r.node.childNodes,i=r.group,e=t.length);this.F(Vr.READY)}else this.F(Vr.ERROR,x,"Invalid KML document")}else this.F(Vr.ERROR,x,"Unable to create objects from the empty data")},Xr.prototype.Rg=function(t,e){e?e.Y(t):(this.ae&&this.ae.qd().Y(t),this.hj.push(t),this.F(Vr.VISIT,t))},Zr.prototype.create=function(t,e){var i=t.coordinates;switch(t.type){case"Point":var r=new $h($r(i));break;case"LineString":r=new ai(as(i));break;case"Polygon":r=new Eh(bs(i));break;case"MultiPoint":var n=0,o=i.length;if(r=[],this.Oe){for(;n<o;n++)r.push($r(i[n]));i=new $h(new jg(r))}else{for(;n<o;n++)r.push(new $h($r(i[n])));(i=new U).hd(r)}r=i,o="multiPoint";break;case"MultiLineString":if(n=0,o=i.length,r=[],this.Oe){for(;n<o;n++)r.push(as(i[n]));i=new ai(new kg(r))}else{for(;n<o;n++)r.push(new ai(as(i[n])));(i=new U).hd(r)}r=i,o="multiLineString";break;case"MultiPolygon":if(r=[],n=0,o=i.length,this.Oe){for(;n<o;n++)r.push(bs(i[n]));i=new Eh(new ig(r))}else{for(;n<o;n++)r.push(new Eh(bs(i[n])));(i=new U).hd(r)}r=i,o="multiPolygon";break;case"GeometryCollection":i=r=new U,o=0;for(var s=(n=t.geometries).length;o<s;o++)this.create(n[o],i);o="geometryCollection"}return r&&(i=r,n=t.properties,t=t.id,s={},n&&(this.Oe?s=n:s.properties=n),o&&!this.Oe&&(s[o]=!0),t&&i.Zr(t),i.setData(s),this.Xa(r)),e&&r&&e.Y(r),r},Zr.prototype.create=Zr.prototype.create,u(cs,Ur),t("H.data.geojson.Reader",cs),cs.prototype.mj=function(t){var e,i;try{var r="string"==typeof t?JSON.parse(t):t;if("object"==typeof r){var n=new Zr(this.Xa,this.Oe);switch(r.type){case"FeatureCollection":if(e=r.features){var o=new U;for(this.Rg(o),i=0;i<e.length;i++){var s=ds(e[i]);(s=n.create(s))&&o.Y(s)}}break;case"Feature":s=ds(r),(s=n.create(s))&&this.Rg(s);break;default:(s=n.create(r))&&this.Rg(s)}this.F(Vr.READY)}else this.F(Vr.ERROR,x,"Invalid syntax")}catch(t){this.F(Vr.ERROR,x,"Parse error. "+t.message)}},cs.prototype.tC=function(t){this.F(Vr.LOADING),this.mj(t)},cs.prototype.parseData=cs.prototype.tC,cs.prototype.gh=function(){},cs.prototype.Rg=function(t){this.ae&&this.ae.qd().Y(t),this.hj.push(t),this.F(Vr.VISIT,t)},t("H.data.buildInfo",function(){return Ig("H-data","1.64.3","4cd9a8f",{region:"row"})}),sf.prototype.ze=ca(1,function(t,e){this.root.ze(t,hb(e)?e:this.Ph)}),wf.prototype.ze=ca(0,function(t,e){var i,r=0;if(!t(this)&&e--)for(;3>=r;r++)(i=this[r])&&i.ze(t,e)}),t("H.clustering.DataPoint",function(t,e,i,r){this.lat=t,this.lng=e,this.wt=i===+i?i:1,this.data=r}),t("H.clustering.theme.Circular",es),es.prototype.Dz=function(t){var e=t.Wd(),i=this.nt[e];if(!i){if(10>e){i=fs(this,28,"118,209,0");var r={x:11,y:18}}else 25>e?(i=fs(this,38,"255,105,0"),r={x:13,y:23}):50>e?(i=fs(this,38,"240,60,0"),r={x:13,y:23}):100>e?(i=fs(this,38,"181,0,21"),r={x:13,y:23}):1e3>e?(i=fs(this,48,"181,0,21"),r={x:15,y:28}):(i=fs(this,66,"181,0,21"),r={x:20,y:38});var n=i.getContext("2d");n.fillStyle="#FFFFFF",n.font="bold "+this.ty+"px Arial",n.fillText(String(e),r.x,r.y),i=new Xh(i,{size:{w:r=i.width/this.na,h:r}
2,anchor:{x:r/2,y:r/2}}),this.nt[e]=i}return(e=new $h(t.Aa(),{icon:i,min:t.Rd(),max:t.pm()})).setData(t),e},es.prototype.getClusterPresentation=es.prototype.Dz,es.prototype.nA=function(t){var e=new $h(t.Aa(),{icon:this.RB,min:t.Rd()});return e.setData(t),e},es.prototype.getNoisePresentation=es.prototype.nA,u(gs,kd);var is={clusters:[],noisePoints:[]},hs={projection:bj,min:0,max:22,eps:32,minWeight:2};function js(t,e){this.ir=t,this.de=e}function ks(t,e,i){this.Jq=this.de=i,this.jr=[],this.ss=0,this.J=of(t,e,!0)}function ls(t){if(gs.call(this,t),(t=this.options).projection!==bj)throw new C(ls,0,"Other projection than mercator not supported yet");this.le=t.projection,this.np=t.eps,this.MB=t.minWeight,this.hw=new cj(this.le),(new Qg).registerProcessor("cluster","H.clustering.dynamicgrid.worker"),this.gg=z(this.gg,this),this.Pq=z(this.Pq,this)}m=gs.prototype,m.ue=function(t){this.fc=t,this.od=!0},m.yc=function(t){this.fc.push(t),this.od=!0},m.Bl=function(t){this.fc=this.fc.concat(t),this.od=!0},m.Ek=function(t){this.fc=this.fc.filter(function(e){return e!==t}),this.od=!0},m.disposeInternal=function(){gs.g.disposeInternal.call(this),delete this.fc},gs.prototype.disposeInternal=gs.prototype.disposeInternal,gs.prototype.Tw=ve,t("H.clustering.grid.NoisePoint",js),js.prototype.Aa=function(){return $e(this.ir)},js.prototype.getPosition=js.prototype.Aa,js.prototype.Wd=function(){return this.ir.wt},js.prototype.getWeight=js.prototype.Wd,js.prototype.Yf=ue,js.prototype.isCluster=js.prototype.Yf,js.prototype.Rd=function(){return this.de},js.prototype.getMinZoom=js.prototype.Rd,js.prototype.getData=function(){return this.ir.data},js.prototype.getData=js.prototype.getData,t("H.clustering.grid.Cluster",ks),ks.prototype.Qi=function(t){this.Tc||(this.Tc=$e(t)),this.ss+=t.wt||1,this.jr.push(t)},ks.prototype.Aa=function(){return this.Tc},ks.prototype.getPosition=ks.prototype.Aa,ks.prototype.Wd=function(){return this.ss},ks.prototype.getWeight=ks.prototype.Wd,ks.prototype.Yf=te,ks.prototype.isCluster=ks.prototype.Yf,ks.prototype.Rd=function(){return this.de},ks.prototype.getMinZoom=ks.prototype.Rd,ks.prototype.pm=function(){return this.Jq},ks.prototype.getMaxZoom=ks.prototype.pm,ks.prototype.C=function(){return this.J},ks.prototype.getBoundingBox=ks.prototype.C,ks.prototype.wp=function(t){this.Aj(t)},ks.prototype.forEachEntry=ks.prototype.wp,ks.prototype.Aj=function(t){var e=this;if(!Wa(t))throw new C(this.Aj,0,t);this.jr.forEach(function(i){t(new js(i,e.de+1))})},ks.prototype.forEachDataPoint=ks.prototype.Aj,u(ls,gs),ls.prototype.Tw=function(t,e){this.Ny=t,this.Oy=Ab(e)},ls.prototype.ds=function(t,e){var i=this.Lg,r=this.Ny,n=this.Oy||0,o=!i||!(i.zoom===n&&i.Ti.da(r));if(r&&(this.od||o)){if(i&&3>i.state&&i.cancel(),this.od=!1,(i=this.np)>=128*Fb(2,n))var s=ms;else{(o=this.hw).Ua(n);var a=o.Fb(r.Nc());s=o.Fb(r.Lc()),a.y-=i,s.y+=i,a=o.tk(a);var l=o.tk(s);s=new J(a.lat,a.lng,l.lat,l.lng),i=o.Ya(i,0).lng+180,s=s.ce(a.lat,a.lng-i,l.lat,a.lng).ce(a.lat,l.lng,l.lat,l.lng+i)}for(i=s,s=[],o=(a=this.fc).length;o--;)i.Ff(a[o])&&s.push(a[o]);0<s.length?(this.Lg=new ns(r,n,s,this.np,this.MB,this.le!==bj,t,e),this.Lg.then(this.gg,this.Pq)):t(is)}},ls.prototype.gg=function(t){Ba(t)||(t=new globalThis.Uint32Array(t));for(var e=this.Lg,i=e.jC,r=0,n=t[r++],o=Array(n),s=0,a=[],l=t.length,c=this.Lg.Qy,h=this.Lg.zoom;n--;)o[s++]=new js(c[t[r++]],h);for(;r<l;){n=t[r++],s=c[t[r]];var u=this.hw,p=this.np;u.Ua(this.Lg.zoom);var d=u.Fb(s);
2for(s=u.Ya(d.x-p,d.y-p),u=u.Ya(d.x+p,d.y+p),s=new ks((s=new J(s.lat,s.lng,u.lat,u.lng)).Nc(),s.Lc(),h);n--;)s.Qi(c[t[r++]]);a.push(s)}i.call(e,{clusters:a,noisePoints:o})},ls.prototype.Pq=function(t){eb(t)&&this.Lg.$B(t)};var ms=new J(90,-180,-90,180);function ns(t,e,i,r,n,o,s,a){this.Ti=t,this.zoom=e,this.Qy=i,this.jC=s,this.$B=a,s=3*(t=i.length),a=new(globalThis.Float64Array||Array)(s);for(var l;t--;)l=i[t],a[--s]=l.lat,a[--s]=l.lng,a[--s]=l.wt;Xd.call(this,"cluster",{message:[a,r,n,e,o]},void 0)}function os(t,e,i){this.pa=t,this.em=e,this.de=i}function ps(t,e,i,r){this.pa=t,this.tc=e,this.de=i,this.Jq=r,this.xp=Ia(this.xp,this),this.vp=Ia(this.vp,this)}function qs(t,e,i,r,n,o){this.Eo=e,t&&(this.parent=t,1&e?(i=t[8],n=t[5]):(i=t[7],n=t[8]),2&e?(r=t[9],o=t[6]):(r=t[4],o=t[9])),this[7]=i,this[5]=n,this[8]=(i+n)/2,this[4]=r,this[6]=o,this[9]=(r+o)/2}function rs(t,e,i,r){var n,o;if(!e(t,r)&&i--)for(++r,n=0;4>n;n++)(o=t[n])&&rs(o,e,i,r)}function ss(t){this.Ph=t||10,this.Dk=this.Ck=this.$i=this.Zi=2147483648,this.Fm()}function ts(t,e){var i,r;for(i=0;4>i;i++)(r=e[i])&&(ts(t,r),delete e[i]);delete e.parent,delete e.entries}function us(t,e,i,r){this[0]=e,this[1]=t,this.weight=i,this.data=r}function vs(t){gs.call(this,t),t=this.options,this.le=t.projection,this.ik=t.min,this.eg=t.max,this.zv=t.minWeight,this.hh=7-zb(Db(yb(1,t.eps))/Nb),this.vr=new ss(yb(this.ik,this.eg+this.hh))}function ws(t,e,i,r,n,o,s){var a,l=e.Fc;if(s&&(s.node.Fc!==l?(o.clusters.push(new ps(t,s.node,s.depth,i-1)),s=null):n++),s||(l>=t.zv?(s={node:e,depth:i},n=i):xs(t,e,n+1,o)),e.fb&&r--)for(i++,l=0;4>l;l++)(a=e[l])&&(ws(t,a,i,r,n,o,s),s=null);s&&o.clusters.push(new ps(t,s.node,s.depth,t.eg+t.hh))}function xs(t,e,i,r){var n;if(e=e.entries){var o=e.length;for(r=r.noisePoints,n=0;n<o;n++)r.push(new os(t,e[n],i))}else for(n=0;4>n;n++)(o=t[n])&&xs(t,o,i,r)}function ys(t){gs.call(this,t)}function zs(t,e){var i={},r=(e=e||{}).min||0;switch(r={min:r,max:yb(r,e.max||22)},zs.g.constructor.call(this,r),this.na=e.pixelRatio||he(),Oa(i,hs,r,e.clusteringOptions||{}),i.minWeight=yb(hs.minWeight,i.minWeight),i.strategy){case As.DYNAMICGRID:if(i.projection!==bj)throw new C(zs,1,"Unsupported projection");this.pa=new ls(i);break;case As.GRID:this.pa=new ys(i);break;default:this.pa=new vs(i)}this.pa.ue(t),this.hl=e.theme||new es(this.na),this.Po=z(this.Po,this),this.gg=z(this.gg,this),Bs(this)}ls.prototype.disposeInternal=function(){ls.g.disposeInternal.call(this)},ls.prototype.disposeInternal=ls.prototype.disposeInternal,u(ns,Sg),t("H.clustering.fastgrid.NoisePoint",os),os.prototype.Aa=function(){return this.Tc||(this.Tc=this.pa.Ya(this.em[1],this.em[0],1)),this.Tc},os.prototype.getPosition=os.prototype.Aa,os.prototype.Wd=function(){return this.em.weight},os.prototype.getWeight=os.prototype.Wd,os.prototype.Yf=ue,os.prototype.isCluster=os.prototype.Yf,os.prototype.Rd=function(){return this.de-this.pa.hh},os.prototype.getMinZoom=os.prototype.Rd,os.prototype.getData=function(){return this.em.data},os.prototype.getData=os.prototype.getData,t("H.clustering.fastgrid.Cluster",ps),ps.prototype.Aa=function(){return this.Tc||(this.Tc=this.pa.Ya(this.tc.ej,this.tc.fj,this.tc.Fc)),this.Tc},ps.prototype.getPosition=ps.prototype.Aa,ps.prototype.Wd=function(){return this.tc.Fc},ps.prototype.getWeight=ps.prototype.Wd,ps.prototype.Yf=te,ps.prototype.isCluster=ps.prototype.Yf,ps.prototype.Rd=function(){return this.de?this.de-this.pa.hh:-1/0},ps.prototype.getMinZoom=ps.prototype.Rd,ps.prototype.pm=function(){return this.Jq-this.pa.hh},ps.prototype.getMaxZoom=ps.prototype.pm,ps.prototype.C=function(){return this.J||(this.J=of(this.pa.Ya(this.tc.dh,this.tc.dj,1),this.pa.Ya(this.tc.bj,this.tc.cj,1),!0)),this.J},ps.prototype.getBoundingBox=ps.prototype.C,ps.prototype.wp=function(t){this.Yt=t,this.tc.ze(this.xp,Vb)},ps.prototype.forEachEntry=ps.prototype.wp,ps.prototype.xp=function(t,e){var i,r,n=!1;if(t.Fc>=this.pa.zv&&t!==this.tc&&t.Fc!==this.tc.Fc&&(this.Yt(new ps(this.pa,t,0,e)),n=!0),!n&&(i=t.entries))for(t=i.length,r=0;r<t;r++)this.Yt(new os(this.pa,i[r],e));return n},ps.prototype.Aj=function(t){this.mz=t,this.tc.ze(this.vp,Vb)},ps.prototype.forEachDataPoint=ps.prototype.Aj,ps.prototype.vp=function(t,e){var i;if(t=t.entries){var r=t.length;for(i=0;i<r;i++)this.mz(new os(this.pa,t[i],e))}return!1},m=qs.prototype,m.fb=0,m.th=function(t){return this[t]||(++this.fb,this[t]=new qs(this,t))},m.removeChild=function(t){var e=t.Eo;this[e]===t&&(delete this[e],delete t.parent,--this.fb)},m.ze=function(t,e){for(var i=0,r=this;r=r.parent;)++i;rs(this,t,e,i)},m.Qg=function(t){(this.entries||(this.entries=[])).push(t)},m.ej=0,m.fj=0,m.Fc=0,m=ss.prototype,m.Fm=function(){this.head=this.root=new qs(null,NaN,this.Zi-this.Ck,this.$i-this.Dk,this.Zi+this.Ck,this.$i+this.Dk)},m.Ml=function(){ts(this,this.root),this.Fm()},m.jd=function(t){var e,i=this.head;if(t){var r=t;if(r!==i)for(i=r;
2r=r.parent;)(r.entries||1<r.fb)&&(i=r)}else for(;!i.entries&&2>(e=i.fb)&&e;)i=r;this.head=i},m.Yd=function(t,e,i,r){var n=this.root;if(!(t>=n[7]&&e>=n[4]&&t<=n[5]&&e<=n[6]))throw Error("Coordinates out of bounds");return this.Vb(this.root,t,e,i,this.Ph,r)},m.Vb=function(t,e,i,r,n,o){var s=t.entries;return n?t.fb?s=this.Tj(t,e,i,r,n,o):s?(s=s[0],(s=t.th(+(s[1]>=t[8])|+(s[0]>=t[9])<<1)).entries=t.entries,s.ej=t.ej,s.fj=t.fj,s.Fc=t.Fc,s.dh=t.dh,s.dj=t.dj,s.bj=t.bj,s.cj=t.cj,delete t.entries,this.jd(s),s=this.Tj(t,e,i,r,n,o)):(t.Qg(s=new us(e,i,r,o)),this.jd(t)):(s||this.jd(t),t.Qg(s=new us(e,i,r,o))),t.ej+=e*r,t.fj+=i*r,t.Fc+=r,t.dh===A?(t.dh=t.bj=e,t.dj=t.cj=i):(e<t.dh?t.dh=e:e>t.bj&&(t.bj=e),i<t.dj?t.dj=i:i>t.cj&&(t.cj=i)),s},m.Tj=function(t,e,i,r,n,o){return this.Vb(t.th(+(e>=t[8])|+(i>=t[9])<<1),e,i,r,n-1,o)},m.ze=function(t,e){rs(this.root,t,e===+e?e:this.Ph,0)},u(vs,gs),m=vs.prototype,m.ue=function(t){var e,i=0,r=t.length,n=new F(0,0),o=this.le,s=this.vr;for(vs.g.ue.call(this,t),s.Ml();i<r;i++)o.Re(e=t[i],n).scale(4294967296).floor(),s.Yd(n.x,n.y,e.wt,e.data);this.od=!0},m.yc=function(t){vs.g.yc.call(this,t),this.ue(this.fc)},m.Bl=function(t){for(var e=t.length,i=vs.g.yc;e--;)i.call(this,t[e]);this.ue(this.fc)},m.Ek=function(t){vs.g.Ek.call(this,t),this.ue(this.fc)},m.Ya=function(t,e,i,r){return this.le.Ya(t/i/4294967296,e/i/4294967296,r)},m.ds=function(t){if(this.od){var e={clusters:[],noisePoints:[]};ws(this,this.vr.root,0,this.eg+this.hh,-1/0,e,null),this.od=!1,t(e)}},m.disposeInternal=function(){vs.g.disposeInternal.call(this),this.vr=null},vs.prototype.disposeInternal=vs.prototype.disposeInternal,u(ys,gs),ys.prototype.ds=function(t){var e,i=this.options,r=i.min,n=i.max,o=[],s=[];if(this.od){for(e=this.fc;r<=n;r++){for(var a,l,c,h,u,p,d,m,f=void 0,g=r,y=e,v=o,_=s,b=i.eps,x=i.projection,w=i.minWeight,S=y.length,T=Math.pow(2,g+8),E=[];m=y[--S];)if(!m.zs){for(d=T,p=(c=x.Re(m).scale(T).floor()).x,u=c.y,l=E.length;l--;)h=(a=E[l]).Aa(),a.xs||(a.xs=x.Re(h).scale(T).floor()),(h=(h=a.xs).ib(c))<d&&(d=h,f=a);f&&f.C().Ff(m)||(f=new ks(x.yn({x:(p-b)/T,y:(u-b)/T}),x.yn({x:(p+b)/T,y:(u+b)/T}),g),E.push(f)),f.Qi(m),f=null}for(S=E.length;S--;)if((l=(a=E[S]).Wd())<w)for(l=(a=a.jr).length;m=a[--l];)_.push(new js(m,g)),m.zs=!0;else v.push(a)}for(r=0,n=e.length;r<n;r++)delete e[r].zs;this.od=!1,t({clusters:o,noisePoints:s})}},u(zs,N),t("H.clustering.Provider",zs),zs.prototype.disposeInternal=function(){zs.g.disposeInternal.call(this),this.Ag.ia(),this.pa.l(),delete this.pa,delete this.Rm,delete this.hl,globalThis.clearTimeout(this.jp)};var As={FASTGRID:0,GRID:1,DYNAMICGRID:2};function Bs(t,e,i){t.jp&&globalThis.clearTimeout(t.jp),e&&t.pa.Tw(e,i),t.jp=globalThis.setTimeout(t.Po,t.iy)}function Cs(t){var e=t.Rm.clusters,i=t.Rm.noisePoints,r=e.length,n=i.length,o=0<r+n;for(t.Ag.ia();n--;){var s=i[n];t.Ag.Y(t.hl.getNoisePresentation(s))}for(;r--;)i=e[r],t.Ag.Y(t.hl.getClusterPresentation(i));o&&t.hb()}function Ds(t,e){t:{for(var i=t.length,r="string"==typeof t?t.split(""):t,n=0;n<i;n++)if(n in r&&e.call(void 0,r[n],n,t)){e=n;break t}e=-1}return 0>e?null:"string"==typeof t?t.charAt(e):t[e]}zs.Strategy=As,zs.prototype.iy=150,zs.prototype.Po=function(){this.dispatchEvent("start"),this.pa.ds(this.gg,ve)},zs.prototype.gg=function(t){this.Rm=t,Cs(this),this.dispatchEvent("end")},zs.prototype.ue=function(t){this.pa.ue(t),Bs(this)},zs.prototype.setDataPoints=zs.prototype.ue,zs.prototype.yc=function(t){this.pa.yc(t),Bs(this)},zs.prototype.addDataPoint=zs.prototype.yc,zs.prototype.Bl=function(t){this.pa.Bl(t),Bs(this)},zs.prototype.addDataPoints=zs.prototype.Bl,zs.prototype.Ek=function(t){this.pa.Ek(t),Bs(this)},zs.prototype.removeDataPoint=zs.prototype.Ek,zs.prototype.JA=function(){return this.hl},zs.prototype.getTheme=zs.prototype.JA,zs.prototype.eD=function(t){this.hl=t,this.Rm&&(this.Ag.ia(),Cs(this))},zs.prototype.setTheme=zs.prototype.eD,zs.prototype.Uc=function(){return!0},zs.prototype.providesDomMarkers=zs.prototype.Uc,zs.prototype.Vc=function(){return!0},zs.prototype.providesMarkers=zs.prototype.Vc,zs.prototype.me=function(){return!0},zs.prototype.providesSpatials=zs.prototype.me,zs.prototype.yk=function(t,e){Bs(this,t,e)},zs.prototype.preprocessData=zs.prototype.yk,t("H.clustering.buildInfo",function(){return Ig("H-clustering","1.64.3","4cd9a8f",{region:"row"})});var Es={};function Fs(t){var e=t.ownerDocument,i=e.documentElement;e=e.defaultView;var r=t.getBoundingClientRect();return t=r.left,r=r.top,isNaN(e.pageXOffset)?(t+=i.scrollLeft,r+=i.scrollTop):(t+=e.pageXOffset,r+=e.pageYOffset),new F(t,r)}function Gs(t,e,i){e=hb(e)?e+"px":e,i=hb(i)?i+"px":i,t.style[gc("transform")]="translate("+e+","+i+")"}var Hs,Is=navigator.userAgent,Js=-1<Is.indexOf("Android")&&-1<Is.indexOf("Mozilla/5.0")&&-1<Is.indexOf("AppleWebKit"),Ks=/AppleWeb
2Kit\/([\d.]+)/,Ls=null===Ks.exec(Is)?null:parseFloat(Ks.exec(Is)[1]);Hs=Js&&null!==Ls&&537>Ls;var Ms=document.createElement("T"),Ns={IMPERIAL:"imperial",METRIC:"metric"};t("H.ui.UnitSystem",Ns);var Os={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"};function Ps(){this.dx=this.Et()}t("H.ui.LayoutAlignment",Os),Ps.prototype.Et=function(){var t=navigator,e=[];return t&&(t.msPointerEnabled?e.push(Qs):t.pointerEnabled&&e.push(Rs)),1>e.length&&("TouchEvent"in globalThis&&e.push(Ss),e.push(Ts)),e.push(Us),e},Ps.prototype.detectEventSets=Ps.prototype.Et,Ps.prototype.addEventListener=function(t,e,i,r){for(var n,o=this.dx,s=o.length,a=!1;s--;)(n=o[s][e])&&(a=!0,t.addEventListener(n,i,r||!1));a||t.addEventListener(e,i,r||!1)},Ps.prototype.removeEventListener=function(t,e,i,r){for(var n,o=this.dx,s=o.length,a=!1;s--;)(n=o[s][e])&&(a=!0,t.removeEventListener(n,i,r||!1));a||t.removeEventListener(e,i,r||!1)};var Rs={start:"pointerdown",end:"pointerup",move:"pointermove",cancel:"pointercancel",over:"pointerover",out:"pointerout",hover:"pointerhover"},Qs={start:"MSPointerDown",end:"MSPointerUp",move:"MSPointerMove",cancel:"MSPointerCancel",over:"MSPointerOver",out:"MSPointerOut",hover:"MSPointerHover"},Ss={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},Ts={start:"mousedown",end:"mouseup",move:"mousemove",over:"mouseover",out:"mouseout",hover:"mousehover"},Us={start:"keydown",end:"keyup"};function Vs(t){return!(t instanceof KeyboardEvent)||"Enter"===t.code}function Ws(t,e,i,r){return t=t.createElement(e),i&&(t.className=i),r&&(t.innerHTML=r),t}function Xs(t,e){for(var i=1,r=arguments.length;i<r;i++)t.appendChild(arguments[i])}var Ys=new Ps;function Zs(t,e,i){Ys.addEventListener(t,e,i,void 0)}function $s(t,e,i){Ys.removeEventListener(t,e,i,void 0)}function Y(t,e){I.call(this),this.rb=t||"div",this.Le=e?e.split(" "):[],this.ub=!1,this.Le.push("H_el")}function at(t){(t=t.B())&&t.parentNode&&t.parentNode.removeChild(t)}function bt(t,e,i){Y.call(this,t,e),this.dc=i?[].concat(i):[]}function ct(){bt.call(this,"div","H_ctl"),this.map=null,this.Ee="top-left"}function dt(t){t=t||{},ct.call(this),this.Ha("H_scalebar"),this.Zc(t.alignment||"right-bottom"),this.maxWidth=150,this.update=z(this.update,this),this.Zu=this.Ir=this.Nk=this.el=null,this.tf(0)}function et(t){t=t||{},Y.call(this,"div","H_btn"),this.we(t.label||" "),this.Ed(t.tooltip||""),this.setData(t.data),this.za(!!t.disabled),this.tf(0),this.F(ft.UP,!0),t.onStateChange&&this.addEventListener("statechange",t.onStateChange),this.dn=z(this.dn,this),this.Vh=z(this.Vh,this)}u(Y,I),t("H.ui.base.Element",Y),Y.prototype.L=function(t){if(!t)throw Error("Wrong document object");return this.G=Ws(t,this.rb,this.Le.join(" ")),this.renderInternal(this.G,t),this.za(this.ub,!0),this.Ed(this.Dx),this.Zb(this.Jd),this.tf(this.px),this.G},Y.prototype.subscribe=function(){},Y.prototype.unsubscribe=function(){},Y.prototype.N=function(){},Y.prototype.renderInternal=Y.prototype.N,Y.prototype.lq=function(){return this.ub},Y.prototype.isDisabled=Y.prototype.lq,Y.prototype.za=function(t,e){return((t=!!t)!==this.ub||e)&&((this.ub=t)?this.Ha("H_disabled"):this.Ab("H_disabled")),this},Y.prototype.setDisabled=Y.prototype.za,Y.prototype.gp=null,Y.prototype.getData=function(){return this.gp},Y.prototype.getData=Y.prototype.getData,Y.prototype.setData=function(t){this.gp=t},Y.prototype.setData=Y.prototype.setData,Y.prototype.Ed=function(t){var e=this.B();this.Dx=t,e&&(t?(e.setAttribute("title",t),e.setAttribute("aria-label",t)):(e.removeAttribute("title"),e.removeAttribute("aria-label")))},Y.prototype.setTooltip=Y.prototype.Ed,Y.prototype.G=null,Y.prototype.B=function(){return this.G},Y.prototype.getElement=Y.prototype.B,Y.prototype.Jd=!0,Y.prototype.Zb=function(t){var e=this.B();this.Jd=t,e&&(e.style.display=t?"":"none")},Y.prototype.setVisibility=Y.prototype.Zb,Y.prototype.Vd=function(){return this.Jd},Y.prototype.getVisibility=Y.prototype.Vd,Y.prototype.px=-1,Y.prototype.tf=function(t){this.px=t;var e=this.B();e&&(e.tabIndex=t)},Y.prototype.setTabIndex=Y.prototype.tf,Y.prototype.Ha=function(t){var e=this.B();return 0>this.Le.indexOf(t)&&this.Le.push(t),e&&(e.className=this.Le.join(" ")),this},Y.prototype.addClass=Y.prototype.Ha,Y.prototype.Ab=function(t){t=this.Le.indexOf(t);var e=this.B();return-1<t&&this.Le.splice(t,1),e&&(e.className=this.Le.join(" ")),this},Y.prototype.removeClass=Y.prototype.Ab,Y.prototype.disposeInternal=function(){Y.g.disposeInternal.call(this),at(this),this.gp=this.G=null,delete this.Dx},u(bt,Y),t("H.ui.base.Container",bt),bt.prototype.za=function(t,e){var i=this.dc?this.dc.length:0;for(Y.prototype.za.call(this,t,e);i--;)this.dc[i].za(t,e);return this},bt.prototype.setDisabled=bt.prototype.za,bt.prototype.Ra=function(t){var e=this.B();return this.dc.push(t),e&&(t.L(e.ownerDocument),e.appendChild(t.B())),this},bt.prototype.addChild=bt.prototype.Ra,bt.prototype.Ej=function(){return[].concat(this.dc)},bt.prototype.getChildren=bt.prototype.Ej,bt.prototype.removeChild=function(t){var e=this.dc.indexOf(t),i=this.B();0<=e&&(this.dc.splice(e,1),i&&i.removeChild(t.B()))},bt.prototype.removeChild=bt.prototype.removeChild,bt.prototype.ia=function(){var t=this.B();t&&this.dc.forEach(function(e){t.removeChild(e.B())}),this.dc=[]},bt.prototype.N=function(t,e){for(var i=0,r=this.dc.length;i<r;i++)t.appendChild(this.dc[i].L(e))},bt.prototype.renderInternal=bt.prototype.N,bt.prototype.disposeInternal=function(){this.ia(),this.dc.forEach(this.az,this),Y.prototype.disposeInternal.call(this)},bt.prototype.az=function(t){t.l()},u(ct,bt),t("H.ui.Control",ct),ct.prototype.Qa=function(t){this.map=t},ct.prototype.L=function(t){return bt.prototype.L.call(this,t)},ct.prototype.N=function(t,e){bt.prototype.renderInternal.call(this,t,e),this.Zc(this.Ee)},ct.prototype.renderInternal=ct.prototype.N,ct.prototype.rk=function(){},ct.prototype.onUnitSystemChange=ct.prototype.rk,ct.prototype.lc=function(){return this.map},ct.prototype.getMap=ct.prototype.lc,ct.prototype.la=function(){return this.AB},ct.prototype.getLocalization=ct.prototype.la,ct.prototype.wz=function(){return this.Ee},ct.prototype.getAlignment=ct.prototype.wz,ct.prototype.Zc=function(t){return"string"==typeof t&&Os[t.replace("-","_").toUpperCase()]===t&&(this.Ee=t,this.dispatchEvent("alignmentchange")),this},ct.prototype.setAlignment=ct.prototype.Zc,u(dt,ct),t("H.ui.ScaleBar",dt),dt.prototype.N=function(t,e){ct.prototype.renderInternal.call(this,t,e),t.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>',t.style.direction="ltr",this.el=t.firstChild,e=this.el.childNodes,this.Nk=e[0],this.Ir=e[1],this.Zu=t.lastChild,this.Pb=Ns.METRIC,this.$y=z(function(t){!this.ub&&Vs(t)&&(this.dispatchEvent("toggleunitsystem"),t.preventDefault())},this),this.ie=z(function(t){!this.ub&&Vs(t)&&t.preventDefault()},this),Zs(t,"start",this.ie),Zs(t,"end",this.$y),this.Ed(this.la().translate("scale.switchToImperial")),this.update()},dt.prototype.renderInternal=dt.prototype.N,dt.prototype.Qa=function(t){this.map&&this.map.removeEventListener("mapviewchange",this.update),t&&t.addEventListener("mapviewchange",this.update),
2ct.prototype.Qa.apply(this,arguments)},dt.prototype.setMap=dt.prototype.Qa,dt.prototype.capture=function(t,e,i){var r=this.B(),n=r.ownerDocument,o=n.createElement("canvas"),s=o.getContext("2d"),a=n.createElementNS("http://www.w3.org/2000/svg","svg"),l=n.createElementNS("http://www.w3.org/2000/svg","foreignObject"),c=ze(r,n,!1);n=parseFloat(r.offsetWidth)+1;var h=parseFloat(r.offsetHeight),u=n*t;t*=h,o.width=u,o.height=t,a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("width",u),a.setAttribute("height",t),a.setAttribute("viewBox","0 0 "+n+" "+h),l.setAttribute("width","100%"),l.setAttribute("height","100%"),a.appendChild(l),c.setAttribute("width","100%"),c.setAttribute("height","100%"),c.setAttribute("xmlns","http://www.w3.org/1999/xhtml");var p=window.getComputedStyle(r);"box-shadow display align-items font font-family font-size height text-shadow direction".split(" ").forEach(function(t){c.style.setProperty(t,p.getPropertyValue(t))}),l.appendChild(c),new Me("image",r=pe(a.outerHTML)).then(function(t){s.drawImage(t,0,0),e(o)},i)},dt.prototype.capture=dt.prototype.capture,dt.prototype.rk=function(t){this.Pb=t,this.Ed("imperial"===t?this.la().translate("scale.switchToMetric"):this.la().translate("scale.switchToImperial")),this.update()},dt.prototype.onUnitSystemChange=dt.prototype.rk,dt.prototype.update=function(){var t;if(this.B()){this.el=this.el,this.Nk=this.Nk;var e=this.maxWidth,i=0;if(t=this.map){var r=t.ra,n=Math.round(.5*r.width),o=Math.round(.5*r.height);0<n&&0<o&&(r=t.Va(n,o))&&(t=t.Va(n+1,o))&&(i=100*r.ib(t))}i&&(this.Pb===Ns.IMPERIAL?1609.344>i?(n=i/.3048006,t=this.la().translate("scale.ft")):(n=i/1609.344,t=this.la().translate("scale.mi")):1e3>i?(n=i,t=this.la().translate("scale.m")):(n=i/1e3,t=this.la().translate("scale.km")),(n=(i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)))/n*100)<e/5?(i*=5,n*=5):n<e/2?(i*=2,n*=2):n>e&&(i/=2,n/=2),n=Math.round(n),this.el.setAttribute("width",n),this.Zu.textContent=i+" "+t,this.Nk.points.getItem(2).x=this.Ir.points.getItem(2).x=this.Nk.points.getItem(3).x=this.Ir.points.getItem(3).x=n-2)}},u(et,Y),t("H.ui.base.Button",et),et.prototype.za=function(t,e){return t&&this.Ab("H_active"),et.g.za.call(this,t,e)},et.prototype.setDisabled=et.prototype.za,et.prototype.N=function(t){Zs(t,"start",this.dn),Zs(t,"end",this.Vh),Zs(t,"out",this.Vh),this.we(this.Wb,!0)},et.prototype.renderInternal=et.prototype.N,et.prototype.getState=function(){return this.o},et.prototype.getState=et.prototype.getState,et.prototype.F=function(t,e){return t!==this.o&&(this.o=t,t===ft.DOWN?this.Ha("H_active"):this.Ab("H_active"),e||this.dispatchEvent("statechange")),this},et.prototype.setState=et.prototype.F,et.prototype.Hp=function(){return this.Wb},et.prototype.getLabel=et.prototype.Hp,et.prototype.we=function(t,e){return(e||t!==this.Wb)&&(this.Wb=t,(e=this.B())&&(e.innerHTML=t)),this},et.prototype.setLabel=et.prototype.we,et.prototype.dn=function(t){!this.ub&&Vs(t)&&(this.F(ft.DOWN),t.preventDefault())},et.prototype.Vh=function(t){!this.ub&&Vs(t)&&(this.F(ft.UP),t.preventDefault())},et.prototype.disposeInternal=function(){var t=this.B();t&&($s(t,"start",this.dn),$s(t,"end",this.Vh),$s(t,"out",this.Vh)),Y.prototype.disposeInternal.call(this)};var ft={UP:"up",DOWN:"down"};function gt(t){et.call(this,t),this.ZB=function(t){Vs(t)&&t.preventDefault()},this.ie=z(function(t){!this.ub&&Vs(t)&&(this.toggleState(),t.preventDefault())},this)}function ht(t,e){if(e=e||{},!(t&&t instanceof Ik))throw Error("Base layer is mandatory for overview UI element");ct.call(this),this.dr=new gt({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.ff,this)}),this.Ra(this.dr),this.$h=new it(t,e.zoomDelta,e.scaleX,e.scaleY),this.Zc(e.alignment||"right-bottom"),this.Ra(this.$h)}function it(t,e,i,r){this.oa=t,this.Vs="H_overview_active","number"==typeof e&&(this.Rx=e),"number"==typeof i&&(this.bw=i),"number"==typeof r&&(this.cw=r),bt.call(this,"div","H_overview")}function kt(t){!t.jh&&jt(t),t.Ab(t.Vs),t.s.removeEventListener("mapviewchange",t.hs,!1,t)}function jt(t,e){var i=t.s.ra.element,r=t.B().style,n=i.offsetWidth/t.bw/10;i=i.offsetHeight/t.cw/10;var o=t.Eq.style;e?(r.width=n+"em",r.height=i+"em",o.width=n+"em",o.height=i+"em"):r.width=r.height="0em",t.ai.ra.resize()}et.State=ft,u(gt,et),t("H.ui.base.PushButton",gt),gt.prototype.N=function(t){Zs(t,"start",this.ie),Zs(t,"end",this.ZB),this.we(this.Wb,!0)},gt.prototype.renderInternal=gt.prototype.N,gt.prototype.Ax=function(){var t=ft.DOWN;return this.F(this.getState()===t?ft.UP:t),this},gt.prototype.toggleState=gt.prototype.Ax,gt.prototype.disposeInternal=function(){var t=this.B();t&&$s(t,"start",this.ie),et.prototype.disposeInternal.call(this)},u(ht,ct),t("H.ui.Overview",ht),ht.prototype.Cg=function(t){return this.$h.Cg(t),this},ht.prototype.setBaseLayer=ht.prototype.Cg,ht.prototype.ff=function(t){t.target.getState()===ft.DOWN?(jt(t=this.$h,!0),t.hs(),t.Ha(t.Vs),t.s.addEventListener("mapviewchange",t.hs,!1,t)):kt(this.$h)},ht.prototype.N=function(t,e){ct.prototype.renderInternal.call(this,t,e),this.dr.B().style.float=this.Ee.match("right")?"right":"left",this.$h.Qa(this.map),this.dr.Ed(this.la().translate("minimap"))},ht.prototype.renderInternal=ht.prototype.N,ht.prototype.disposeInternal=function(){this.$h.l(),Y.prototype.disposeInternal.call(this)},u(it,ct),it.prototype.Cg=function(t){this.ai.Cg(t)},it.prototype.N=function(t,e){Xs(t,e=Ws(e,"div","H_overview_map")),this.Eq=e},it.prototype.renderInternal=it.prototype.N,it.prototype.renderInternal=it.prototype.N,m=it.prototype,m.Rx=3,m.bw=5,m.cw=5,m.Qa=function(t){this.s=t,this.ai=new V(this.Eq,this.oa,{pixelRatio:this.s.kb(),engineType:this.s.wa.type}),this.ai.Xd.B().style.display="none",this.aw=this.ai.va,this.qv=this.s.va},m.hs=function(t){t&&t.modifiers&t.SIZE&&jt(this,!0),(t=this.qv.Hb()).zoom-=this.Rx,this.aw.$c(t)},m.disposeInternal=function(){it.g.disposeInternal.call(this),kt(this),this.ai.l(),this.ai=this.aw=this.qv=this.s=this.oa=this.Eq=null};var lt={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 mt(t){var e;t=t||{},this.yf=!!t.vertical,this.tB=t.length||this.Yx,this.yb=hb(e=t.min)?e:this.$x,this.Pc=yb(this.yb,hb(e=t.max)?e:this.Zx),this.nD=E(e=t.step)?this.ay:e,this.Ei=nt(this,hb(e=t.value)?e:(this.yb+this.Pc)/2),this.Qc=z(this.Qc,this),this.he=z(this.he,this),this.ln=z(this.ln,this),this.kn=z(this.kn,this),this.uk=t.pointerArea,Y.call(this,"div","H_slider"+(this.yf?"":" H_l_horizontal"))}function nt(t,e){var i=t.nD;return e=$b(e,t.yb,t.Pc),i?t.yb+zb((e-t.yb)/i)*i:e}function ot(t,e){var i=t.Hx,r=t.yf;t.Gx||(t.Gx=i["offset"+(r?"Height":"Width")]),0>(e-=Fs(i)[r?"y":"x"])&&(e=0),e=(t.Pc-t.yb)*e/t.Gx,e=nt(t,r?t.Pc-e:t.yb+e),t.Ei!==e&&(t.eo(e,!0),t.dispatchEvent(new Oi(t.j.zf,e,t.Ei)))}function pt(t,e){return(e.touches?e.targetTouches[0]:e)["page"+(t.yf?"Y":"X")]}function qt(t,e){var i=!1,r=t.type;return-1!==r.indexOf("pointer")||-1!==r.indexOf("touch")?i=!0:B(t,MouseEvent)&&(i=t.which===e||t.buttons===e),i}function rt(t){var e=t.touches;return e&&1===e.length||B(t,MouseEvent)}function st(t){var e=(t=t||{}).slider;ct.call(this),this.qn=z(this.qn,this),this.rl=z(this.rl,this),this.Id=z(this.Id,this),e&&(this.Xq=z(this.Xq,this),this.Cu=e,this.mD=t.sliderSnaps,this.Ha("H_zoom_slider")),this.ul=new et({label:lt.in,onStateChange:this.qn}),this.uo=new et({label:lt.out,onStateChange:this.qn}),this.Ha("H_zoom"),this.Ha("H_grp"),this.oz=!1!==t.fractionalZoom,this.setZoomSpeed(t.zoomSpeed||4),this.Zc(t.alignment||"right-middle")}function tt(t){t.removeChild(t.vi),t.vi=null,t.oa&&(t.oa.removeEventListener("minchange",t.Id),t.oa.removeEventListener("maxchange",t.Id),t.oa=null)}function ut(t){t=t||{},bt.call(this,"div","H_rdo"),this.ls=new Y("div","H_rdo_title"),this.Ui=new bt("div","H_rdo_buttons"),this.Ra(this.ls),this.Ra(this.Ui),this.Hv=z(function(t){t.target.getState()===ft.DOWN?(this.Rw(t.target,!0),this.dispatchEvent(vt)):t.target.F(ft.DOWN,!0)},this),this.addEventListener("statechange",this.Hv),this.bs(t.title||""),t.onActiveButtonChange&&this.addEventListener(vt,t.onActiveButtonChange),t.buttonsOptions&&t.buttonsOptions.forEach(function(t){this.Ao(new gt(t))},this)}
2u(mt,Y),t("H.ui.base.Slider",mt),m=mt.prototype,m.Ks=1,m.$x=0,m.Zx=100,m.ay=1,m.Yx="16em",m.eo=function(t,e){var i=this.yf,r=i?"top":"left";return this.Ka&&!e||(t=$b(t,this.yb,this.Pc),this.Lh&&(i=(i?-1:1)*(e=100*(t-this.yb)/(this.Pc-this.yb)),this.Lh.style[r]=i+"%",this.DD.style[r]=100+i+"%"),this.Ei=nt(this,t)),this.Ei},mt.prototype.setValue=mt.prototype.eo,mt.prototype.PA=function(){return this.Ei},mt.prototype.getValue=mt.prototype.PA,m=mt.prototype,m.Xk=function(){if(!this.iq){Zs(this.B(),"start",this.Qc);var t=this.uk;Zs(t,"move",this.he),Zs(t,"end",this.ln),Zs(t,"out",this.kn),this.iq=!0}},m.Ai=function(){if(this.iq){$s(this.B(),"start",this.Qc);var t=this.uk;$s(t,"move",this.he),$s(t,"end",this.ln),$s(t,"out",this.kn),this.iq=!1}},m.Qc=function(t){var e=this.yf;if(qt(t,this.Ks)&&rt(t)){var i=pt(this,t),r=t.target;r===this.Lh||r.parentElement===this.Lh?(this.nB=i-Fs(this.Lh)[e?"y":"x"]-this.Lh.offsetWidth/2,this.B().className="H_slider H_slider_active"+(this.yf?"":" H_l_horizontal"),this.Ka=!0):ot(this,i),t.preventDefault()}},m.ln=function(){this.Ka&&(this.B().className="H_slider "+(this.yf?"":" H_l_horizontal"),this.Ka=!1)},m.kn=function(t){this.Ka&&t.target===this.uk&&(this.Ka=!1)},m.he=function(t){this.Ka&&rt(t)&&(qt(t,this.Ks)?(ot(this,pt(this,t)-this.nB),t.preventDefault()):this.Ka=!1)},m.j={zf:"change"},m.N=function(t,e){var i=Ws(e,"div","H_slider_cont"),r=Ws(e,"div","H_slider_knob_cont"),n=Ws(e,"div","H_slider_knob"),o=Ws(e,"div","H_slider_knob_halo"),s=Ws(e,"div","H_slider_track");e=Ws(e,"div","H_slider_track H_slider_track_active"),t.appendChild(i),i.appendChild(s),s.appendChild(e),i.appendChild(r),r.appendChild(n),r.appendChild(o),this.Hx=s,this.DD=e,this.Lh=r,this.uk||(this.uk=t.ownerDocument.body),i.style[this.yf?"height":"width"]=this.tB,this.eo(this.Ei),this.Xk()},mt.prototype.renderInternal=mt.prototype.N,mt.prototype.disposeInternal=function(){this.Ai()},mt.prototype.za=function(t,e){return t?this.Ai():this.Hx&&this.Xk(),Y.prototype.za.call(this,t,e)},mt.prototype.setDisabled=mt.prototype.za,u(st,ct),t("H.ui.ZoomControl",st),st.prototype.VA=function(){return this.Sx},st.prototype.getZoomSpeed=st.prototype.VA,st.prototype.iD=function(t){this.Sx=t},st.prototype.setZoomSpeed=st.prototype.iD,st.prototype.Qa=function(t){this.map!==t&&(this.map&&this.map.removeEventListener("mapviewchange",this.rl),tt(this)),ct.prototype.Qa.apply(this,arguments),this.map&&(this.Id(),t.addEventListener("mapviewchange",this.rl),t.addEventListener("baselayerchange",this.Id))},st.prototype.setMap=st.prototype.Qa,st.prototype.disposeInternal=function(){ct.prototype.disposeInternal.apply(this,arguments),this.map.removeEventListener("baselayerchange",this.Id),tt(this)},st.prototype.N=function(t,e){ct.prototype.renderInternal.call(this,t,e),this.ul.Ed(this.la().translate("zoom.in")),this.uo.Ed(this.la().translate("zoom.out"))},st.prototype.renderInternal=st.prototype.N,st.prototype.Zc=function(t){var e=this.Ee;return ct.prototype.Zc.call(this,t),e!==t&&this.Id(),this},st.prototype.setAlignment=st.prototype.Zc,st.prototype.rl=function(){var t=this.map,e=t.Tb(),i=t.kb()-1;t=t.oa||t.wa.getCapabilities().lookAt.zoom,this.Cu&&this.vi.eo(e),this.ub||(this.ul.za(e+i>=t.max),this.uo.za(e<=t.min))},st.prototype.za=function(t,e){return st.g.za.call(this,t,e),this.rl(),this},st.prototype.setDisabled=st.prototype.za,st.prototype.qn=function(t){var e,i=(t=t.target)===this.ul?1:-1,r=0<i?Math.ceil:Math.floor,n=this.map,o=this;n&&("down"===t.getState()?(n.va.startControl(),n.va.control(0,0,i*this.Sx,0,0,0)):n.va.endControl(!0,function(t){e=o.oz?t.zoom:r(t.zoom),t.zoom=e}))},st.prototype.Xq=function(t){this.map&&this.map.Wk(t.newValue)},st.prototype.Id=function(){var t=this.Ee,e=this.lc();if(/^top/g.test(t)||/^bottom/g.test(t)){var i=this.uo;t=this.ul;var r=!1}else i=this.ul,t=this.uo,r=!0;if(this.removeChild(i),this.removeChild(t),this.Ra(i),this.Cu&&e){tt(this),e=r;var n=(r=(i=this.map)&&i.oa)||i.wa.getCapabilities().lookAt.zoom;(this.oa=r)&&(r.addEventListener("minchange",this.Id),r.addEventListener("maxchange",this.Id)),this.vi=new mt({step:this.mD?1:0,vertical:e,min:n.min,max:n.max,value:i.Tb(),pointerArea:i.B()}),this.vi.addEventListener(this.vi.j.zf,this.Xq),this.Ra(this.vi)}this.Ra(t)},u(ut,bt),t("H.ui.base.RadioGroup",ut);var vt="activebuttonchange";function wt(){this.o=xt.CLOSED,bt.call(this,"div","H_overlay")}ut.prototype.N=function(t,e){bt.prototype.renderInternal.call(this,t,e),this.bs(this.ko,!0)},ut.prototype.renderInternal=ut.prototype.N,ut.prototype.ia=function(){this.Ui.ia()},ut.prototype.bs=function(t,e){return(t!==this.ko||e)&&(this.ko=t,this.ls.B()&&(this.ls.B().innerHTML=this.ko)),this},ut.prototype.setTitle=ut.prototype.bs,ut.prototype.LA=function(){return this.ko},ut.prototype.getTitle=ut.prototype.LA,ut.prototype.Ao=function(t){if(!(t instanceof gt))throw Error("PushButton expected");return t.ea(this),this.Ui.Ra(t),this},ut.prototype.addButton=ut.prototype.Ao,ut.prototype.DC=function(t){return this.Ui.removeChild(t),t.ea(null),this},ut.prototype.removeButton=ut.prototype.DC,ut.prototype.Dj=function(){return this.Ui.Ej()},ut.prototype.getButtons=ut.prototype.Dj,ut.prototype.Rw=function(t,e){for(var i=this.Dj(),r=i.length;r--;)i[r].F(i[r]===t?ft.DOWN:ft.UP,e)},ut.prototype.setActiveButton=ut.prototype.Rw,ut.prototype.disposeInternal=function(){this.removeEventListener("statechange",this.Hv),this.ia(),bt.prototype.disposeInternal.call(this)},u(wt,bt),t("H.ui.base.OverlayPanel",wt),wt.prototype.F=function(t,e){return(t!==this.o||e)&&(this.o=t,t===xt.OPEN?this.Ha("H_open"):this.Ab("H_open")),this},wt.prototype.setState=wt.prototype.F,wt.prototype.getState=function(){return this.o},wt.prototype.getState=wt.prototype.getState,wt.prototype.jw=function(t){var e=t.Ee;t=t.B();var i=this.B(),r=i.style;if(this.Ab("H_top"),this.Ab("H_middle"),this.Ab("H_bottom"),this.Ab("H_left"),this.Ab("H_center"),this.Ab("H_right"),r.bottom=r.to
2p=r.left=r.right=r.margin="",/top/g.test(e)){this.Ha("H_top"),r.top="0",r.margin="0 12px";var n=-1}else/bottom/g.test(e)?(this.Ha("H_bottom"),r.bottom="0",r.margin="0 12px",n=1):(this.Ha("H_middle"),r.top="50%",r.margin="0 12px",r.marginTop=-Math.round(.5*i.offsetHeight)+"px",n=0);/left/g.test(e)?(this.Ha("H_left"),r.left=t.offsetWidth+"px",r.marginLeft="12px"):/right/g.test(e)?(this.Ha("H_right"),r.right=t.offsetWidth+"px",r.marginRight="12px"):(this.Ha("H_center"),r.left="50%",0>n?(r.top=t.offsetHeight+"px",r.marginTop="12px"):0<n&&(r.bottom=t.offsetHeight+"px",r.marginBottom="12px"),r.marginLeft=-Math.round(.5*i.offsetWidth)+"px",t.appendChild(i))},wt.prototype.pointToControl=wt.prototype.jw;var xt={OPEN:"open",CLOSED:"closed"};function yt(t){B(t,ee,yt,1),Y.call(this,"div","H_context_menu_item"),this.Jb=t,this.mk=z(this.mk,this),this.Ce=z(this.Ce,this),this.Jb.addEventListener("update",this.Ce)}wt.State=xt,u(yt,Y),t("H.ui.context.Item",yt),yt.prototype.mk=function(t){var e=this.Jb,i=e.callback;i&&!e.isDisabled()&&(this.dispatchEvent("click"),i(t))},yt.prototype.N=function(){var t=this,e=this.B();Zs(e,"click",this.mk),Zs(e,"keyup",function(e){"Enter"===e.code.code&&t.mk(e)}),this.tf(-1),this.Ce()},yt.prototype.renderInternal=yt.prototype.N,yt.prototype.Ce=function(){var t=this.B(),e=this.Jb;e.callback?this.Ha("H_clickable"):this.Ab("H_clickable"),e.isDisabled()?this.Ha("H_disabled"):this.Ab("H_disabled"),e=e.getLabel(),Ms.textContent=e,t.innerHTML=Ms.innerHTML.split("\n").join("<br/>")},yt.prototype.disposeInternal=function(){Y.prototype.disposeInternal.call(this),this.Jb.removeEventListener("update",this.Ce)};var zt={};function At(t){t=t||{},ct.call(this),this.be=new wt,this.se=this.se.bind(this),this.Ec=this.Ec.bind(this),this.Qc=this.Qc.bind(this),this.vm=this.vm.bind(this),this.Zc(t.alignment||"bottom-right"),Bt(this,t.baseLayers,t.layers)}function Ct(t,e){var i=[];return t.concat(e).forEach(function(t){i=i.concat(t.layer)}),i}function Dt(t,e,i){var r=t.lc();if(r){t=Ct(t.Ge,t.$f);var n=Ct(e,i);t.forEach(function(t){n.includes(t)||r.hi(t)})}}function Bt(t,e,i){Dt(t,e,i),t.uq=NaN,t.Ge=db(e)?e:[],t.$f=db(i)?i:[],t.Af&&(t.Af.ia(),t.dk.ia(),Et(t))}function Ft(t,e){if(t.map.wa.type===gn){var i=H.map.render.harp.Style;e=[].concat(e);for(var r=0;!o&&r<e.length;r++){var n=e[r].D;if(n.Wc()&&n.K)var o=(n=n.K()).getConfig()||n.getUrl()}if(o){var s=function(t){(t=t.D).Wc()&&t.K&&t.K()instanceof i&&t.Bb(new i(o))};t.$f.forEach(function(t){db(t=t.layer)?t.forEach(s):t&&s(t)})}}}function Et(t){var e=t.la();t.Ge.forEach(function(t,i){var r=t.layer;(t=new gt({tooltip:t.tooltip,label:Gt(e,t.label),data:i,disabled:!r||db(r)&&!r.length})).tf(-1),this.Af.Ao(t)},t),t.$f.forEach(function(t,i){var r=t.layer;(t=new gt({tooltip:t.tooltip,label:Gt(e,t.label),onStateChange:this.dC.bind(this,t.layer),data:i,disabled:!r||db(r)&&!r.length})).tf(-1),this.dk.Ra(t)},t),t.zu.Zb(!(!t.$f.length||!t.Ge.length)),globalThis.setTimeout(function(){this.map&&(this.se(),this.sc.za(!(this.Ge&&this.Ge.length||this.$f&&this.$f.length)))}.bind(t))}function Jt(t,e){var i=window.H.service&&window.H.service.omv.Provider,r=e.D;if(i&&e.D instanceof i&&r.K().wj){var n=r.K(),o=function(){var t=Kt.ground.filter(function(t){return!!n.Pp("layers."+t)}),i=Kt.water.filter(function(t){return!!n.Pp("layers."+t)});if(t.concat(i).length){var s={};ki(s,n.wj(t)),ki(s,n.wj(i,!1,!0)),delete s.global,t=new Ei(s,n.Kc()),(t=r.$.md(t)).xo=e,this.map.Cl(t)}n.removeEventListener(ji.CHANGE,o)}.bind(t);n.getState()!==hi.READY?n.addEventListener(ji.CHANGE,o):o()}}function Ht(t){return Ds(t.map.O.Sa(),function(t){return!!t.xo})}function It(t){t=t.map.O.Sa();var e=window.H.service&&window.H.service.traffic.flow.Provider;return!!e&&t.some(function(t){return t.D instanceof e})}zt=function(t,e,i){kd.call(this),this.qh=-1,this.G=t,this.Om=e,this.Kv=i,this.ie=z(this.ie,this),t.focus(),Zs(t,"keydown",this.ie)},u(zt,kd),zt.prototype.disposeInternal=function(){this.qh=-1,this.Jx(),zt.g.disposeInternal.call(this),$s(this.G,"keydown",this.ie);var t=this.Kv;this.G=this.Om=this.Kv=null,t()},zt.prototype.ie=function(t){if(t instanceof KeyboardEvent){var e=this.Om.length-1,i=/^Arrow(Down|Up)$/.exec(t.code);i?(t={Up:-1,Down:1}[i[1]])&&(this.qh=0>this.qh&&0>t?e:$b(this.qh+t,0,e),this.Jx()):"Enter"===t.code?(e=this.Om[this.qh])instanceof et?(e.Ib()instanceof ut?e.F(ft.DOWN):e.Ax(),this.l()):e instanceof yt&&(e.mk(),this.l()):"Escape"===t.code&&this.l()}},zt.prototype.Jx=function(){var t=this;this.Om.forEach(function(e,i){i===t.qh?e.Ha("H_focused"):e.Ab("H_focused")})},u(At,ct),t("H.ui.MapSettingsControl",At),At.prototype.subscribe=function(){var t=this.lc();if(t){var e=this.Ib();e&&(e=e.B())&&Ad(e,"pointerdown",this.Qc),Ad(t,"pointerdown",this.Qc),Ad(t=t.O,"add",this.se),Ad(t,"remove",this.se),Ad(t,"set",this.se)}},At.prototype.Qc=function(t){this.be.getState()===xt.OPEN&&(t.currentTarget!==this.lc()&&this.be.B().contains(t.target)||this.Ec())},At.prototype.unsubscribe=function(){var t=this.lc();if(t){var e=this.Ib();e&&(e=e.B())&&Jd(e,"pointerdown",this.Qc),Jd(t,"pointerdown",this.Qc),Jd(t=t.O,"add",this.se),Jd(t,"remove",this.se),Jd(t,"set",this.se)}},At.prototype.N=function(t,e){var i=this.la().translate("layers.choose");ct.prototype.renderInternal.call(this,t,e),this.subscribe(),this.sc=new gt({tooltip:i,label:'<svg xmlns="http://www.w3.org/2000/svg" class="H_icon" viewB
2ox="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(t){var e=this;t.target.getState()===ft.DOWN?(this.be.F(xt.OPEN),this.be.jw(this),this.Zj=new zt(this.B().ownerDocument.body,this.Af.Dj().concat(this.dk.Ej()),function(){e.sc.F(ft.UP),e.sc.B().blur()})):globalThis.setTimeout(function(){e.be.F(xt.CLOSED),e.Zj.l()})},this)}),this.Af=new ut({title:i,onActiveButtonChange:function(){var t=this.uq;t:{for(var e=this.Af.Dj(),i=e.length;i--;)if(e[i].getState()===ft.DOWN){e=e[i];break t}e=null}if(e=e.getData(),i=db(e=this.Ge[e].layer),this.map.Cg(i?e[0]:e),(t=this.Ge[t])&&db(t=t.layer))for(var r=t.length;1<r--;)this.map.hi(t[r]);if(i)for(t=e.length;1<t--;)this.map.Cl(e[t],1);Ft(this,e),this.vm(),this.Ec()}.bind(this)}),this.dk=new bt("div","H_grp"),this.zu=new Y("div","H_separator"),this.Ra(this.sc),this.Ra(this.be),this.be.Ra(this.Af),this.be.Ra(this.zu),this.be.Ra(this.dk),Et(this);var r=this;Zs(this.sc.B(),"focus",function(){r.sc.F(ft.DOWN)}),Zs(this.sc.B(),"blur",function(){r.Ec()})},At.prototype.renderInternal=At.prototype.N,At.prototype.se=function(){var t=this.map.oa,e=this.map.O;this.uq=NaN,this.Ge.forEach(function(e,i){e=e.layer,e=t===(db(e)?e[0]:e),this.Af.Dj()[i].F(ft[e?"DOWN":"UP"],!0),e&&(this.uq=i)},this),this.$f.forEach(function(t,i){var r=db(t=t.layer);i=this.dk.Ej()[i],!t||r&&!t.length?i.za(!0):i.F(ft[-1!==e.indexOf(r?t[0]:t)?"DOWN":"UP"],!0)},this)},At.prototype.dC=function(t,e){t=db(t)?t:[t],e=e.target.getState()===ft.DOWN;for(var i=0;i<t.length;i++)e?this.map.Cl(t[i]):this.map.hi(t[i]);this.vm(),this.Ec()},At.prototype.vm=function(){var t=Ht(this);t&&(t.xo.D.K().gk(t.D.K().Qd()),this.map.hi(t),t.l(),delete t.xo),It(this)&&Jt(this,this.map.oa)};var Kt={water:["water.water-labels"],ground:"road_labels continent_label island_label roads.shields roads.directions truck-restriction.signs places landuse.label".split(" ")};function Gt(t,e){return/^layers?/.test(e)&&t.ym(e)?t.translate(e):e}function Lt(t,e,i){Sh.call(this,t,{icon:Mt,visibility:i}),Nt(this,e)}function Nt(t,e){t.oB=e,t.G&&(t.G.textContent=e)}At.prototype.Ec=function(){this.sc.F(ft.UP),this.sc.B().blur()},At.prototype.disposeInternal=function(){At.g.disposeInternal.call(this),this.unsubscribe()},u(Lt,Sh);var Mt=new Qh(Ws(globalThis.document,"span","H_dm_label"),{onAttach:function(t,e,i){i.G=t,Nt(i,i.oB)},onDetach:function(t,e,i){delete i.G}});function Ot(t,e){I.call(this),this.Me=t,this.Wb=new Lt(this.BD,""),e.push(this.Wb),this.sd=new U({objects:e,data:this}),this.bo=this.bo.bind(this)}function Pt(t,e){e&&(t.nextSibling=e,e.previousSibling=t)}function Qt(t,e,i,r){var n=new K,o=[];Pt(t,this),Pt(this,e),n.sg(t.Aa()),n.sg(e.Aa()),this.Oh=new ai(n,{style:i.Nh}),this.wu=new ai(n,{style:{strokeColor:"transparent",lineWidth:Math.min(100,this.Oh.K().lineWidth+2*(r||5))}}),i.outlineStyle&&(this.cr=new ai(n,{style:i.outlineStyle}),o.push(this.cr)),o.push(this.Oh,this.wu),Ot.call(this,i,o),this.cv=this.bv=-1,(t=this.sd).addEventListener("pointermove",this.he,!0,this),t.addEventListener("pointerleave",this.Wq,!0,this)}function Rt(t,e,i){var r=t.Oh.V();r.Zk(3*+i,3,[e.lat,e.lng,0]),t.cr&&t.cr.X(r),t.wu.X(r),t.Oh.X(r)}function St(t,e,i){i=e.Kj(i||0),this.dg=new $h(t,{icon:i,zIndex:0}),this.dg.draggable=!0,Ot.call(this,e,[this.dg]),(t=this.sd).addEventListener("dragstart",this.Ad,!0,this),t.addEventListener("drag",this.hg,!0,this),t.addEventListener("dragend",this.df,!0,this)}function Tt(t){var e=0;t.nextSibling&&t.previousSibling&&(t.nextSibling.Ze||t.previousSibling.Ze?t.nextSibling.Ze&&!t.previousSibling.Ze&&(e=2):e=1),e=t.Me.Kj(e),t.dg.ve(e)}function Ut(t,e){this.Ia=e,this.uc=t,this.mb={Ze:!0},Vt(this,this.mb),this.jn=z(this.jn,this)}function Wt(t,e){var i=e||t.mb.nextSibling,r=0,n=0;if(e&&!Xt(t,e))throw new C(t.Fk,0,e);for(i instanceof St?r=i.Jj():i instanceof Qt&&(r=i.previousSibling.Jj()),e=i;e&&e!==t.mb;e=e.nextSibling,n++)e.Nr(r),1==n%2&&(r+=e.Jj())}function Xt(t,e){for(var i=t.mb.nextSibling,r=!1;i!==t.mb;){if(i===e){r=!0;break}i=i.nextSibling}return r}function Yt(t,e,i){e=new Qt(e,i,t.Ia),t.uc.Y(e.sd)}function Vt(t,e){t.mb.nextSibling=e,e.previousSibling=t.mb}u(Ot,I),m=Ot.prototype,m.Ze=!1,m.BD={lat:0,lng:0},m.we=function(t,e){Nt(this.Wb,t),this.Wb.X(e)},m.Tk=function(t){(this.Jd=t)?this.bo():(this.ll&&globalThis.clearTimeout(this.ll),this.ll=globalThis.setTimeout(this.bo,100))},m.ll=0,m.bo=function(){this.Wb.Zb(this.Jd)},u(Qt,Ot),Qt.prototype.Jj=function(){var t=this.Oh.V();return t.xj(0).ib(t.xj(1))},Qt.prototype.he=function(t){var e=t.currentPointer;t=this.previousSibling.Aa();var i=this.nextSibling.Aa(),r=this.Me.jx,n=e.viewportX;e=e.viewportY,this.bv===n&&this.cv===e||(this.bv=n,this.cv=e,r.X(this.Me.mA(t,i,{x:n,y:e})),r.Zb(!0))},Qt.prototype.Wq=function(){this.Me.jx.Zb()},Qt.prototype.Nr=function(){this.we(this.Me.Ht(this.Jj()),this.Oh.C().vb())},u(St,Ot),m=St.prototype,m.kh=0,m.j={zf:"change"},m.Jj=function(){return this.kh},m.Aa=function(){return this.dg.V()},m.hg=function(t){var e=t.currentPointer;t=e.viewportX,e=e.viewportY,this.pB===t&&this.qB===e||(this.pB=t,this.qB=e,this.dg.X(this.Me.map.Va(t-this.tv.x,e-this.tv.y)),this.dispatchEvent(new nd(this.j.zf,this)))},m.Ad=function(t){var e=t.currentPointer,i=e.viewportX;e=e.viewportY;var r=this.Me.map.La(this.Aa());this.dg.ui(1),this.tv={x:i-r.x,y:e-r.y},t.stopPropagation()},m.df=function(){this.dg.ui(0)},m.Nr=function(t){this.kh=t,this.we(this.Me.Ht(t),this.Aa())},t("H.ui.distanceMeasurement.Model",Ut),m=Ut.prototype,m.Jm=function(){return this.mb.nextSibling===this.mb},m.Tk=function(t){for(var e=this.mb,i=e.nextSibling;i!==e;)i.Tk(i.previousSibling!==e&&t),i=i.nextSibling}
2,m.Qi=function(t){var e=this.mb.previousSibling,i=this.Jm();return t=new St(t,this.Ia,i?0:2),this.uc.Y(t.sd),Pt(t,this.mb),t.addEventListener(t.j.zf,this.jn),i?Vt(this,t):(Yt(this,e,t),Tt(e),Wt(this,e)),t},m.insertBefore=function(t,e){var i,r=1;if(e){if(!Xt(this,e))throw new C(this.insertBefore,1,e);(i=e.previousSibling.Ze)&&(r=0),(t=new St(t,this.Ia,r)).addEventListener(t.j.zf,this.jn),this.uc.Y(t.sd),i?(Yt(this,t,i=this.mb.nextSibling),Vt(this,t),e=t,Tt(i)):(e=(i=e.previousSibling).previousSibling,r=i.nextSibling,this.uc.Oa(i.sd),Yt(this,e,t),Yt(this,t,r)),Wt(this,e)}else t=this.Qi(t);return t},m.ia=function(){Vt(this,this.mb),this.uc.ia()},m.Fk=function(t){var e=this.mb,i=t.previousSibling,r=t.nextSibling;if(!Xt(this,t))throw new C(this.Fk,0,t);if(this.uc.Oa(t.sd),i===e){var n=r;n!==e?(Vt(this,t=n.nextSibling),t.Nr(0),Tt(t),Wt(this,t)):Vt(this,this.mb)}else r===e?(Pt(t=(n=i).previousSibling,e),Tt(t)):i&&r&&(Yt(this,i.previousSibling,r.nextSibling),this.uc.ug([r.sd,i.sd]),Wt(this,i.previousSibling));n&&n!==e&&this.uc.Oa(n.sd)},m.jn=function(t){var e=(t=t.target).previousSibling,i=t.nextSibling,r=t.Aa();if(!i.Ze){Rt(i,r,!1);var n=t}e.Ze||(Rt(e,r,!0),n=e.previousSibling),Wt(this,n)};var Zt={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>',point:'<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 $t(t){var e,i=(t=t||{}).lineStyle;ct.call(this),this.No=new gt({label:Zt.btn,onStateChange:z(this.ff,this)}),this.Ra(this.No),(e=t.distanceFormatter)&&(this.It=e),i&&(this.kv=i,this.Zv=A),this.Zc(t.alignment||"right-bottom"),this.td={},this.td[0]=t.startIcon,this.td[2]=t.endIcon,this.td[1]=t.stopoverIcon,this.td[3]=t.splitIcon}function au(t){function e(){var t=r.mc();return t={anchor:r.Cb.clone().scale(o).floor(),size:new ch(Ab(t.w*o),Ab(t.h*o)),hitArea:n},new Xh(r.Se(),t)}var i,r=t.Kj(3),n=new Lh(Mh.NONE,[]),o=r===t.Fs?.5:1;if(1===r.getState())var s=e();else s=new Xh("<svg/>",{hitArea:n}),r.addEventListener("statechange",function(){1===r.getState()&&i.ve(e())});return i=new $h(t.map.vb(),{visibility:!1,icon:s})}u($t,ct),t("H.ui.DistanceMeasurement",$t),m=$t.prototype,m.Pb=Ns.METRIC,m.Xx=22,m.kv={strokeColor:"rgb(39,44,54)",lineWidth:5},m.Zv={strokeColor:"white",lineWidth:7},m.Xk=function(){var t,e=this.map,i={};this.Xj||(this.rc=new N,this.pb=new $k(this.rc,{pixelRatio:this.map.
2kb()}),this.uc=t=this.rc.qd(),this.uc.cx(!0),t.addEventListener("dragstart",this.Ad,!0,this),t.addEventListener("dragend",this.Yk,!0,this),t.addEventListener("pointerenter",this.Yk,!0,this),t.addEventListener("pointerleave",this.Wq,!0,this),t.addEventListener("tap",this.kC,!0,this),this.$k=au(this),i.Ht=z(this.It,this),i.Kj=z(this.Kj,this),i.mA=z(this.nu,this),i.map=this.map,i.jx=this.$k,i.Nh=this.kv,i.outlineStyle=this.Zv,this.Jb=new Ut(this.uc,i),this.Xj=!0),this.$k&&this.uc.Y(this.$k),e.addEventListener("tap",this.Nv,!0,this),e.O.add(this.pb)},m.Ai=function(){var t=this.map;this.Xj&&(t.removeEventListener("tap",this.Nv,!0,this),t.hi(this.pb),this.Jb.ia())},m.It=function(t){var e="m",i=0;return"metric"===this.Pb?1e3<=t&&(t/=1e3,e="km",i=1):(e="ft",5280<=(t/=.3048)&&(t/=5280,e="mi",i=1)),t.toFixed(i)+" "+this.la().translate("scale."+e)},m.nu=function(t,e,i){var r=this.map.La(t);return e=this.map.La(e),i=new F(i.x,i.y).mu(r,e),this.map.Va(i.x,i.y)||$e(t)},m.N=function(t,e){var i=this.map.wa.type===Xi.P2D?this.map.kb():1,r=(i*=this.Xx)/2;ct.prototype.renderInternal.call(this,t,e),this.Pb=Ns.METRIC,this.Fs=new Xh(Zt.point,{anchor:{x:r,y:r},size:{w:i,h:i},hitArea:new Lh(Mh.CIRCLE,[r,r,r])}),this.No.Ed(this.la().translate("distance.measurement"))},$t.prototype.renderInternal=$t.prototype.N,m=$t.prototype,m.Kj=function(t){return this.td[t]||this.Fs},m.Yk=function(){this.Jb.Tk(!0)},m.Ad=function(){this.Jb.Tk()},m.Wq=function(t){"touch"!==t.currentPointer.type&&this.Jb.Tk()},m.kC=function(t){var e,i=t.currentPointer,r=t.target.Na;r&&(r=r.getData())instanceof Ot&&(e=r),r=e,t=(t=t.originalEvent).metaKey||t.altKey,r&&(t&&r instanceof St?this.Jb.Fk(r):r instanceof Qt&&(t=r.previousSibling.Aa(),e=r.nextSibling.Aa(),i={x:i.viewportX,y:i.viewportY},this.Jb.insertBefore(this.nu(t,e,i),r.nextSibling),this.$k.Zb()),this.Yk())},m.Nv=function(t){var e=t.currentPointer;(t=t.target)!==this.map&&t.getProvider&&t.getProvider()===this.rc||(this.Jb.Qi(this.map.Va(e.viewportX,e.viewportY)),this.$k.Zb(),this.Yk())},m.ff=function(t){"down"===t.target.getState()?this.Xk():this.Ai()},m.rk=function(t){this.Pb=t,this.Xj&&(Wt(this.Jb),this.Yk())},$t.prototype.onUnitSystemChange=$t.prototype.rk,$t.prototype.disposeInternal=function(){this.Ai(),this.Xj&&(this.rc.l(),this.pb.l()),$t.g.disposeInternal.call(this)},$t.prototype.Qa=function(t){t?this.No.getState()===ft.DOWN&&(this.map=t,this.Xk()):(this.Ai(),this.Xj=!1),ct.prototype.Qa.apply(this,arguments)},$t.prototype.setMap=$t.prototype.Qa;var bu=[];t("H.ui.i18n.defaultLocales",bu);var cu={},du=[];function eu(t,e){cu[t]=e,-1===bu.indexOf(t)&&bu.push(t),du.length?fu(t,e):du=Object.keys(e)}function fu(t,e){for(var i,r=du,n=r.length;n--;)if(!e[i=r[n]])throw Error("'"+i+"' key missing in translation map for "+t)}function gu(t,e){if(!eb(t))throw new TypeError("string locale code required");if(ya(e))fu(t,e);else{if(-1===bu.indexOf(t))throw Error("Default locale '"+t+"' does nto exist.");e=cu[t]}this.s=e||{},this.Um=t}function hu(t,e){e=e||{};var i=this;Y.call(this,"div","H_ib H_ib_top"),this.Qv=z(function(t){i.ub||!Vs(t)&&t instanceof KeyboardEvent&&"Escape"!==t.code||(i.close(),t.preventDefault())},this),this.update=z(this.update,this),this.bm=z(this.bm,this),this.setPosition(t),this.Qk(e.content),e.onStateChange&&this.addEventListener("statechange",e.onStateChange),this.F(iu.OPEN)}eu("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","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:","distance.measurement":"Measure distance"}),eu("pl-PL",{"layers.normal":"Widok mapy","layers.satellite":"Satelita","layers.terrain":"Teren","layer.transit":"Transport publiczny","layer.traffic":"Warunki drogowe","layer.incidents":"Pokaż zdarzenia drogowe","layers.choose":"Wybierz widok",minimap:"Minimap","scale.switchToImperial":"ZmieÅ na mile","scale.switchToMetric":"ZmieÅ na km","scale.km":"km","scale.m":"m","scale.mi":"mi","scale.ft":"ft","zoom.out":"Oddal","zoom.in":"Przybliż","zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"Transport publiczny","traffic.MISCELLANEOUS":"Inne zdarzenie","traffic.ACCIDENT":"Wypadek","traffic.OTHER_NEWS":"Inne wiadomoÅci","traffic.OTHER":"Inne wiadomoÅci","traffic.PLANNED_EVENT":"Zdarzenie planowane","traffic.ROAD_HAZARD":"NiebezpieczeÅstwo na drodze","traffic.ROAD_CLOSURE":"Jezdnia zamkniÄta","traffic.WEATHER":"Pogoda","traffic.CONGESTION":"Korek","traffic.CONSTRUCTION":"Budowa","traffic.DISABLED_VEHICLE":"Uszkodzony pojazd","traffic.LANE_RESTRICTION":"Ograniczenie pasa ruchu","traffic.from":"Data rozpoczÄcia:","traffic.until":"Przybliżona data zakoÅczenia:","distance.measurement":"Measure distance"}),eu("ru-RU",{"layers.normal":"Режим каÑÑÑ","layers.satellite":"СпÑÑниковаÑ","layers.terrain":"ÐеÑÑноÑÑÑ","layer.transit":"ÐбÑеÑÑвеннÑй ÑÑанÑпоÑÑ","layer.traffic":"ÐоÑожнÑе ÑÑловиÑ","layer.incidents":"ÐоказаÑÑ Ð´Ð¾ÑожнÑе ÑобÑÑиÑ","layers.choose":"ÐÑбеÑиÑе вид",minimap:"Minimap","scale.switchToImperial":"ÐÑполÑзоваÑÑ Ð¼Ð¸Ð»Ð¸","scale.switchToMetric":"ÐÑполÑзоваÑÑ ÐºÐ¸Ð»Ð¾Ð¼ÐµÑÑÑ","scale.km":"км","scale.m":"м","scale.mi":"милÑ","scale.ft":"ÑÑÑ","zoom.out":"ÐÑдалиÑÑ","zoom.in":"ÐÑиблизиÑÑ","zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"ÐбÑеÑÑвеннÑй ÑÑанÑпоÑÑ","traffic.MISCELLANEOUS":"ÐÑоÑее ÐТÐ","traffic.ACCIDENT":"ÐТÐ","traffic.OTHER_NEWS":"ÐÑÑгие новоÑÑи","traffic.OTHER":"ÐÑÑгие новоÑÑи","traffic.PLANNED_EVENT":"Ðлановое меÑопÑиÑÑие","traffic.ROAD_HAZARD":"ÐоÑÐ¾Ð¶Ð½Ð°Ñ Ð¾Ð¿Ð°ÑноÑÑÑ","traffic.ROAD_CLOSURE":"ÐоÑога закÑÑÑа","traffic.WEATHER":"Ðогода","traffic.CONGESTION":"ÐÑобка","traffic.CONSTRUCTION":"РемонÑ","traffic.DISABLED_VEHICLE":"ÐеиÑпÑавнÑй авÑомобилÑ","traffic.LANE_RESTRICTION":"ÐгÑаниÑение полоÑÑ Ð´Ð²Ð¸Ð¶ÐµÐ½Ð¸Ñ","traffic.from":"ÐÑÐµÐ¼Ñ Ð½Ð°Ñала:","traffic.until":"Ðжидаемое вÑÐµÐ¼Ñ Ð¾ÐºÐ¾Ð½ÑаниÑ:","distance.measurement":"ÐзмеÑиÑÑ ÑаÑÑÑоÑние"}),eu("tr-TR",{"layers.normal":"Harita görünümü","layers.satellite":"Uydu","layers.terrain":"Arazi","layer.transit":"Toplu ulaÅım","layer.traffic":"Trafik durumları","layer.incidents":"Trafik olaylarını göster","layers.choose":"Görünüm seç",minimap:"Minimap","scale.switchToImperial":"Mile dönüÅtür","scale.switchToMetric":"Kilometreye dönüÅtür","scale.km":"km","scale.m":"m","scale.mi":"mil","scale.ft":"ft","zoom.out":"UzaklaÅtır","zoom.in":"YakınlaÅtır","zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"Toplu ulaÅım","traffic.MISCELLANEOUS":"ÃeÅitli","traffic.ACCIDENT":"Kaza","traffic.OTHER_NEWS":"DiÄer haberler","traffic.OTHER":"DiÄer haberler","traffic.PLANNED_EVENT":"Planlı etkinlik","traffic.ROAD_HAZARD":"Yol tehlikesi","traffic.ROAD_CLOSURE":"Yol kapalı","traffic.WEATHER":"Hava durumu","traffic.CONGESTION":"YoÄunluk","traffic.CONSTRUCTION":"Yol çalıÅması","traffic.DISABLED_VEHICLE":"Araç arızası","traffic.LANE_RESTRICTION":"Åerit kısıtlaması","traffic.from":"BaÅlangıç zamanı:","traffic.until":"Tahmini bitiÅ zamanı:","distance.measurement":"Measure distance"}),eu("es-ES",{"layers.normal":"Mapa","layers.satellite":"Satélite","layers.terrain":"Terreno","layer.transit":"Transporte público","layer.traffic":"Estado del tráfico","layer.incidents":"Mostrar incidentes de tráfico","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","traffic.MASS_TRANSIT":"Transporte público","traffic.MISCELLANEOUS":"Varios","traffic.ACCIDENT":"Accidente","traffic.OTHER_NEWS":"Más noticias","traffic.OTHER":"Más 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ón","traffic.DISABLED_VEHICLE":"VehÃculo averiado","traffic.LANE_RESTRICTION":"Restricción de carril","traffic.from":"Inicio:","traffic.until":"Finalización estimada:","distance.measurement":"Measure distance"}),eu("zh-CN",{"layers.normal":"å°å¾è§å¾","layers.satellite":"嫿","layers.terrain":"å°å½¢","layer.transit":"å
Œ
±äº¤é","layer.traffic":"交éæ
åµ","layer.incidents":"æ¾ç¤ºäº¤éäºä»¶","layers.choose":"éæ©è§å¾",minimap:"Minimap","scale.switchToImperial":"åæ¢ä¸ºãè±éã","scale.switchToMetric":"åæ¢ä¸ºãå
¬éã","scale.km":"å
¬é","scale.m":"ç±³","scale.mi":"è±é","scale.ft":"è±å°º","zoom.out":"缩å°","zoom.in":"æ¾å¤§","zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"å
Œ
±äº¤é","traffic.MISCELLANEOUS":"综åäºä»¶","traffic.ACCIDENT":"交éæ
2å¤","traffic.OTHER_NEWS":"å
¶ä»æ°é»","traffic.OTHER":"å
¶ä»æ°é»","traffic.PLANNED_EVENT":"é¢å®äºä»¶","traffic.ROAD_HAZARD":"éè·¯å±é©","traffic.ROAD_CLOSURE":"é路已å
³é","traffic.WEATHER":"天æ°","traffic.CONGESTION":"å µå¡","traffic.CONSTRUCTION":"æ½å·¥","traffic.DISABLED_VEHICLE":"è½¦è¾æé","traffic.LANE_RESTRICTION":"车ééå¶","traffic.from":"å¼å§æ¶é´ï¼","traffic.until":"é¢è®¡ç»ææ¶é´ï¼","distance.measurement":"Measure distance"}),eu("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","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:","distance.measurement":"Measure distance"}),eu("fi-FI",{"layers.normal":"Karttanäkymä","layers.satellite":"Satelliitti","layers.terrain":"Maasto","layer.transit":"Julkinen liikenne","layer.traffic":"Liikenneolosuhteet","layer.incidents":"Näytä liikennetapahtumat","layers.choose":"Valitse näkymä",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ähennä","zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"Julkinen liikenne","traffic.MISCELLANEOUS":"Erittelemätön syy","traffic.ACCIDENT":"Onnettomuus","traffic.OTHER_NEWS":"Muu tapahtuma","traffic.OTHER":"Muu tapahtuma","traffic.PLANNED_EVENT":"Suunniteltu tapahtuma","traffic.ROAD_HAZARD":"Vaara tiellä","traffic.ROAD_CLOSURE":"Tie suljettu","traffic.WEATHER":"Sää","traffic.CONGESTION":"Ruuhka","traffic.CONSTRUCTION":"Rakennustyö","traffic.DISABLED_VEHICLE":"Pysähtynyt ajoneuvo","traffic.LANE_RESTRICTION":"Kaista rajoitus","traffic.from":"Alkamisaika:","traffic.until":"Arvioitu päättymisaika:","distance.measurement":"Measure distance"}),eu("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ère","zoom.in":"Zoom avant","zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"Transports publics","traffic.MISCELLANEOUS":"Divers","traffic.ACCIDENT":"Accident","traffic.OTHER_NEWS":"Autre","traffic.OTHER":"Autre","traffic.PLANNED_EVENT":"Ãvénement prévu","traffic.ROAD_HAZARD":"Danger routier","traffic.ROAD_CLOSURE":"Chaussée fermée","traffic.WEATHER":"Météo","traffic.CONGESTION":"Embouteillage","traffic.CONSTRUCTION":"Travaux","traffic.DISABLED_VEHICLE":"Véhicule en panne","traffic.LANE_RESTRICTION":"Restriction de voie","traffic.from":"Date ou heure de début:","traffic.until":"Date et heure de fin estimées:","distance.measurement":"Measure distance"}),eu("pt-BR",{"layers.normal":"Exibição do mapa","layers.satellite":"Satélite","layers.terrain":"Terreno","layer.transit":"Transporte público","layer.traffic":"Condições do trânsito","layer.incidents":"Mostrar incidentes no trânsito","layers.choose":"Escolher exibição",minimap:"Minimap","scale.switchToImperial":"Mudar para milhas","scale.switchToMetric":"Mudar para km","scale.km":"km","scale.m":"m","scale.mi":"milhas","scale.ft":"pés","zoom.out":"Menos zoom","zoom.in":"Mais zoom","zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"Transporte público","traffic.MISCELLANEOUS":"Miscelânea","traffic.ACCIDENT":"Acidente","traffic.OTHER_NEWS":"Outras notÃcias","traffic.OTHER":"Outras notÃcias","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ção","traffic.DISABLED_VEHICLE":"VeÃculo incapacitado","traffic.LANE_RESTRICTION":"Restrição de pista","traffic.from":"Hora de inÃcio:","traffic.until":"Tempo final estimado:","distance.measurement":"Measure distance"}
2),eu("pt-PT",{"layers.normal":"Vista do mapa","layers.satellite":"Satélite","layers.terrain":"Terreno","layer.transit":"Transportes públicos","layer.traffic":"Condições de trânsito","layer.incidents":"Mostrar incidentes de trânsito","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","zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"Transportes públicos","traffic.MISCELLANEOUS":"Diversos","traffic.ACCIDENT":"Acidente","traffic.OTHER_NEWS":"Outras notÃcias","traffic.OTHER":"Outras notÃcias","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ção","traffic.DISABLED_VEHICLE":"VeÃculo avariado","traffic.LANE_RESTRICTION":"Limitação da faixa de rodagem","traffic.from":"Hora de inÃcio:","traffic.until":"Hora de fim prevista:","distance.measurement":"Measure distance"}),eu("de-DE",{"layers.normal":"Kartenansicht","layers.satellite":"Satellit","layers.terrain":"Gelände","layer.transit":"Ãffentliche Verkehrsmittel","layer.traffic":"Verkehrslage","layer.incidents":"Verkehrsstörungen anzeigen","layers.choose":"Ansicht auswählen",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öÃern","zoom.rectangle":"Zoom rectangle","traffic.MASS_TRANSIT":"Ãffentliche 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","traffic.LANE_RESTRICTION":"Fahrstreifensperrung","traffic.from":"Beginn:","traffic.until":"Voraussichtliches Ende:","distance.measurement":"Measure distance"}),eu("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","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:","distance.measurement":"Measure distance"}),t("H.ui.i18n.Localization",gu),gu.prototype.iA=function(){return this.Um},gu.prototype.getLocale=gu.prototype.iA,gu.prototype.bA=function(){return Object.keys(this.s)},gu.prototype.getKeys=gu.prototype.bA,gu.prototype.ym=function(t){return!(!this.s||!this.s[t])},gu.prototype.hasKey=gu.prototype.ym,gu.prototype.translate=function(t){var e=this.s[t];if(!eb(e))throw Error("Translation missing for key '"+t+"'.");return e},gu.prototype.translate=gu.prototype.translate,u(hu,Y),t("H.ui.InfoBubble",hu),hu.prototype.s=null,hu.prototype.Aa=function(){return this.Tc},hu.prototype.setPosition=function(t){this.Tc=$e(t),this.update()},hu.prototype.setPosition=hu.prototype.setPosition,hu.prototype.Qa=function(t){this.s=t},hu.prototype.N=function(t,e){this.Lo=Ws(e,"div","H_ib_body"),this.tailEl_=Ws(e,"div","H_ib_tail"),this.aj=Ws(e,"div","H_ib_close H_btn",'<svg version="1.1" class="H_icon" viewB
2ox="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.aj.setAttribute("tabindex","0"),this.fh=Ws(e,"div","H_ib_content"," "),this.Lo.appendChild(this.aj),this.Lo.appendChild(this.fh),Zs(this.aj,"start",this.Qv),this.s.va.addEventListener("sync",this.update),this.s.ra.addEventListener("sync",this.update),t.appendChild(this.Lo),t.appendChild(this.tailEl_),this.Qk(this.Sl)},hu.prototype.renderInternal=hu.prototype.N,hu.prototype.bm=function(){this.zt||(this.zt=setTimeout(this.update,0))},hu.prototype.update=function(){var t,e=this.B(),i=this.s,r="none";if(this.zt=0,i&&e&&this.getState()===iu.OPEN){if(t=i.La(this.Tc)){var n=t.x;t=t.y,(n>=-(i=i.ra.width)||n<=2*i||t>=-i||t<=2*i)&&(r="",Hs?(e.style.left=n-i+"px",e.style.top=t+"px"):Gs(e,n,t))}e.style.display=r,""===r&&(e.style.visibility="visible")}};var iu={OPEN:"open",CLOSED:"closed"};function ju(t,e){this.wc=t,this.Cc=null,this.ik=0,this.eg=22,this.ED=e,this.fn=z(this.fn,this),this.ap=z(this.ap,this),(t=this.wc.lc()).addEventListener("mapviewchange",this.hC,!1,this),this.jb=t.wa.type,(t=t.O).addEventListener("add",this.ig,!1,this),t.addEventListener("remove",this.jg,!1,this)}function ku(t,e,i){var r=e.D;r&&void 0!==i&&i&&r.removeEventListener("tap",t.fn),e?(r.addEventListener("tap",t.fn),t.ik=r.min,t.eg=r.max):(t.ik=0,t.eg=22)}function lu(t){return window.H.service&&(t.D instanceof window.H.service.traffic.incidents.Provider||t.D instanceof window.H.service.trafficVectorTile.Provider&&"incident"===t.D.$.Aq)}function mu(t,e){var i={},r={};i["top-left"]=Ws(e,"div",[nu,ou].join(" ")),i["top-center"]=Ws(e,"div",[nu,pu,qu,ou].join(" ")),i["top-right"]=Ws(e,"div",[nu,ou].join(" ")),i["left-top"]=Ws(e,"div",[nu,ru].join(" ")),i["left-middle"]=Ws(e,"div",[nu,su,tu,ru].join(" ")),i["left-bottom"]=Ws(e,"div",[nu,ru].join(" ")),i["right-top"]=Ws(e,"div",[nu,ru].join(" ")),i["right-middle"]=Ws(e,"div",[nu,uu,tu,ru].join(" ")),i["right-bottom"]=Ws(e,"div",[nu,ru].join(" ")),i["bottom-left"]=Ws(e,"div",[nu,ou].join(" ")),i["bottom-center"]=Ws(e,"div",[nu,vu,qu,ou].join(" ")),i["bottom-right"]=Ws(e,"div",[nu,ou].join(" ")),r["top-left"]=Ws(e,"div",[pu,su].join(" ")),r["top-right"]=Ws(e,"div",[pu,uu].join(" ")),r["bottom-left"]=Ws(e,"div",[vu,su].join(" ")),r["bottom-right"]=Ws(e,"div",[vu,uu].join(" ")),Xs(r["top-left"],i["top-left"],i["left-top"]),Xs(r["top-right"],i["top-right"],i["right-top"]),Xs(r["bottom-left"],i["left-bottom"],i["bottom-left"]),Xs(r["bottom-right"],i["right-bottom"],i["bottom-right"]),Xs(t,r["top-left"],r["top-right"],r["bottom-left"],r["bottom-right"],i["top-center"],i["left-middle"],i["right-middle"],i["bottom-center"]),this.Zs=i}hu.State=iu,hu.prototype.o=iu.OPEN,hu.prototype.getState=function(){return this.o},hu.prototype.getState=hu.prototype.getState,hu.prototype.F=function(t){t!==this.o&&(this.o=t,this.dispatchEvent("statechange")),(t=this.B())&&(this.o===iu.OPEN?(t.style.display="block",t.style.visibility="hidden",this.bm()):t.style.display="none")},hu.prototype.setState=hu.prototype.F,hu.prototype.close=function(){this.F(iu.CLOSED)},hu.prototype.close=hu.prototype.close,hu.prototype.open=function(){this.F(iu.OPEN)},hu.prototype.open=hu.prototype.open,hu.prototype.Fz=function(){return this.fh||null},hu.prototype.getContentElement=hu.prototype.Fz,hu.prototype.Qk=function(t){if(t){if("string"!=typeof t&&("number"!=typeof t.nodeType||"string"!=typeof t.nodeName))throw Error("InfoBubble content must be a string or HTML node.");this.Sl=t}else this.Sl="";this.B()&&(this.Sl?(this.fh.innerHTML="","string"==typeof this.Sl?this.fh.innerHTML=t:"number"==typeof t.nodeType&&"string"==typeof t.nodeName&&this.fh.appendChild(t)):this.fh.innerHTML=" ",this.bm())},hu.prototype.setContent=hu.prototype.Qk,hu.prototype.disposeInternal=function(){this.close(),this.Qk(""),this.aj&&$s(this.aj,"end",this.Qv),this.s&&(this.s.va.removeEventListener("sync",this.update),this.s.ra.removeEventListener("sync",this.update)),Y.prototype.disposeInternal.call(this)},m=ju.prototype,m.hC=function(t){var e=t.newValue.zoom;this.Cc&&t.modifiers&t.ZOOM&&(e<this.ik||e>this.eg)&&this.Cc.close()},m.ig=function(t){lu(t=t.added)&&ku(this,t)},m.jg=function(t){lu(t=t.removed)&&(this.Cc&&this.Cc.close(),ku(this,t,!0))},m.fn=function(t){var e,i=this.jb===Xi.HARP;t.target&&(e=t.target.getData())&&0===t.currentPointer.button&&(i?(e=this.wc.lc().V
2a(t.currentPointer.viewportX,t.currentPointer.viewportY),(i=t.target.getData()?t.target.getData().properties.id:null)&&this.ED.requestIncidentById(i,{locationReferencing:"none",lang:this.wc.la().Um,units:this.wc.Pb===Ns.METRIC?"metric":"imperial"},this.Ix.bind(this,e),console.error)):(i=t.target.V(),this.Ix(i,e)),t.stopPropagation())},m.Ix=function(t,e){if(this.jb===Xi.HARP){e=e.incidentDetails;var i=this.wc.la().Um,r=e.type,n=r.split(/(?=[A-Z])/).join("_").toUpperCase();this.wc.la().ym("traffic."+n)&&(r=this.wc.la().translate("traffic."+n)),t={position:t,title:r,description:e.description.value,startTime:new Date(e.startTime).toLocaleString(i).split(",").join(" "),endTime:new Date(e.endTime).toLocaleString(i).split(",").join(" ")}}else i=e.TRAFFIC_ITEM_TYPE_DESC.replace(" ","_"),t={position:t,title:i=this.wc.la().ym("traffic."+i)?this.wc.la().translate("traffic."+i):e.TRAFFIC_ITEM_DESCRIPTION[e.TRAFFIC_ITEM_DESCRIPTION.length-1].value,description:e.TRAFFIC_ITEM_DESCRIPTION[0].value,startTime:e.START_TIME,endTime:e.END_TIME};this.ap(t)},m.ap=function(t){var e=t.position,i=t.title,r=t.description,n=t.startTime;t=t.endTime,this.Cc||(this.Cc=new hu(e),this.Cc.Ha("H_tib"),this.wc.Ws(this.Cc)),this.Cc.setPosition(e),this.Cc.Qk('<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}}",i).replace("{{desc}}",r).replace("{{traffic.from}}",this.wc.la().translate("traffic.from")).replace("{{traffic.until}}",this.wc.la().translate("traffic.until")).replace("{{from}}",n).replace("{{until}}",t)),this.Cc.open()};var pu="H_l_top",vu="H_l_bottom",su="H_l_left",uu="H_l_right",qu="H_l_center",tu="H_l_middle",ou="H_l_horizontal",ru="H_l_vertical",nu="H_l_anchor";function wu(t,e){e?(e=t.offsetWidth,t.style.marginLeft=-Math.round(.5*e)+"px"):(e=t.offsetHeight,t.style.marginTop=-Math.round(.5*e)+"px")}function xu(t){B(t,Array,xu,1),bt.call(this,"div","H_context_menu"),this.HB=t,this.s=null,this.Ec=this.Ec.bind(this)}function yu(t){t=t||{},ct.call(this),this.sc=new gt({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>',onStateChange:z(this.ff,this)}),this.Ra(this.sc),this.Zc(t.alignment||"right-bottom")}function zu(t,e){try{return t.Im=!0,new t(e)}finally{t.Im=!1}}function Au(t,e){var i=t.B(),r=this;I.call(this),this.s=t,this.rj=i.ownerDocument,this.Gf={},this.Ie=[],this.G=Ws(this.rj,"div","H_ui"),this.setDirection(),this.WB=z(function(t){this.jv.put(t.target,t.target.Ee)},this),this.addEventListener("alignmentchange",this.WB),this.lC=z(function(){this.Bx()},this),this.addEventListener("toggleunitsystem",this.lC),this.G.addEventListener("contextmenu",this.ow,!1),this.G.addEventListener("MSHoldVisual",this.ow,!1),this.s.addEventListener("contextmenu",this.cn,!1,this),this.s.addEventListener("contextmenuclose",this.Iv,!1,this),this.s.bc(this.l.bind(this)),this.Md=null,this.pt=-1,this.jv=new mu(this.G,this.rj),this.Pb=Ns.METRIC,Bu(this,"en-US"),e&&Cu(this,e),i.appendChild(this.G),globalThis.setTimeout(function(){r.jv.update()},1)}function Bu(t,e){if(eb(e))var i=e;else{if(!(e instanceof gu))throw Error("The locale parameter must be a string or a H.ui.i18n.Localization object.");i=e.Um;var r=e}if(!i)throw Error("No locale was defined.");if(r)t.Bq=r;else{if(!(0<=bu.indexOf(i)))throw Error("Locale ["+i+"] is not supported.");t.Bq=new gu(i)}}function Cu(t,e){var i,r;e.unitSystem&&t.co(e.unitSystem),(r=e.locale)&&Bu(t,r),(i=e.zoom)&&t.Pg("zoom",new st(ya(i)?i:null)),(i=e.zoomrectangle)&&t.Pg("zoomrectangle",new yu(ya(i)?i:null)),(i=e.mapsettings)&&t.Pg("mapsett
2ings",new At(ya(i)?i:null)),(i=e.scalebar)&&t.Pg("scalebar",new dt(ya(i)?i:null)),(i=e.distancemeasurement)&&t.Pg("distancemeasurement",new $t(ya(i)?i:null))}function Eu(t,e,i,r){for(var n=t,o=0;n&&o<e.length;o++)n=n[e[o]];if(n&&n!==t)return t={label:i,layer:n},r.push(t),t}function Du(t,e,i){var r=[],n=[],o=e.raster;if(t===Xi.P2D&&o){if(Eu(e,["raster","normal","map"],"layers.normal",r),Eu(e,["raster","satellite","map"],"layers.satellite",r),Eu(e,["raster","terrain","map"],"layers.terrain",r),i)for(var s in o)if(o[s]&&o[s].map===i){var a=s;break}Eu(e,["raster","normal","trafficincidents"],"layer.incidents",n),Eu(e,["raster",a,"transit"],"layer.transit",n)}else Eu(e,["vector","normal","map"],"layers.normal",r),t===Xi.WEBGL?(n.push({label:"layers.satellite",tooltip:"Disabled with WEBGL engine"}),n.push({label:"layer.traffic",tooltip:"Disabled with WEBGL engine"}),n.push({label:"layer.incidents",tooltip:"Disabled with WEBGL engine"})):(i=Eu(e,["hybrid","day","vector"],"",[]),(o=Eu(e,["hybrid","day","raster"],"layers.satellite",r)).layer=[o.layer,i.layer],window.H.service&&(i=e.vector.traffic.map.D.$.i(),e=zu(window.H.service.trafficVectorTile.Service,{baseUrl:i,layer:"flow"}),i=zu(window.H.service.trafficVectorTile.Service,{baseUrl:i,layer:"incident"}),a=pn()+"/harp/oslo/normal.day.json",o=new H.map.render.harp.Style(a),a=new H.map.render.harp.Style(a),e=e.createLayer(o,{engineType:t}),t=i.createLayer(a,{engineType:t}),n.push({label:"layer.traffic",layer:e},{label:"layer.incidents",layer:t})));return{alignment:"bottom-right",baseLayers:r,layers:n}}mu.prototype.update=function(){var t=this.Zs;wu(t["top-center"],!0),wu(t["bottom-center"],!0),wu(t["left-middle"],!1),wu(t["right-middle"],!1)},mu.prototype.put=function(t,e){t=t?t.B():null;var i=e?this.Zs[e]:null;t&&i&&(t.parentElement&&t.parentElement.removeChild(t),i.insertBefore(t,/(bottom|right)$/.test(e)||/(center|middle)/.test(e)&&i.childNodes.length%2?i.firstChild:null)),this.update()},u(xu,bt),t("H.ui.context.Menu",xu),xu.prototype.disposeInternal=function(){xu.g.disposeInternal.call(this),this.Zj&&this.Zj.l(),this.Zj=null},xu.prototype.disposeInternal=xu.prototype.disposeInternal,xu.prototype.N=function(){bt.prototype.N.apply(this,arguments),this.HB.forEach(function(t){t===fe?t=new Y("div","H_context_menu_item_separator"):(t=new yt(t)).addEventListener("click",this.Ec),this.Ra(t),this.tf(0)},this),Ad(this.B(),["mousedown","touchstart","pointerdown","wheel"],function(t){t.stopPropagation()}),this.Zj=new zt(this.B(),this.Ej().filter(function(t){return t instanceof yt&&(t=t.Jb).callback&&!t.isDisabled()}),this.Ec)},xu.prototype.renderInternal=xu.prototype.N,xu.prototype.setPosition=function(t,e){if(this.s){var i=this.B(),r=i.offsetWidth,n=i.offsetHeight,o=this.s,s=o.ra.width;t+r>s&&t>s/2&&(t-=r),e+n>(o=o.ra.height)&&e>o/2&&(e-=n),Gs(i,t,e)}},xu.prototype.setPosition=xu.prototype.setPosition,xu.prototype.Ec=function(){this.s&&this.s.dispatchEvent(new nd("contextmenuclose",this.s))},xu.prototype.Qa=function(t){this.s=t},xu.prototype.setMap=xu.prototype.Qa,u(yu,ct),t("H.ui.ZoomRectangle",yu),m=yu.prototype,m.ff=function(t){var e=this.map,i=e.ra.element;t.target.getState()===ft.DOWN?(e.addEventListener("dragstart",this.Ad,!0,this),e.addEventListener("drag",this.hg,!0,this),e.addEventListener("dragend",this.df,!0,this),(t=i.ownerDocument.createElement("div")).className="H_zoom_lasso",i.appendChild(t),this.Pm=t):(e.removeEventListener("dragstart",this.Ad,!0,this),e.removeEventListener("drag",this.hg,!0,this),e.removeEventListener("dragend",this.df,!0,this),i.removeChild(this.Pm))},m.Ad=function(t){var e=this.Pm.style,i=t.currentPointer,r=i.viewportX;i=i.viewportY,t.target===this.map&&(t.stopPropagation(),e.width="0px",e.height="0px",e.top=i+"px",e.left=r+"px",e.display="block",this.lx=i,this.kx=r)},m.hg=function(t){var e=t.currentPointer,i=e.viewportX,r=e.viewportY;e=this.kx;var n=this.lx,o=this.Pm.style;t.target===this.map&&(t.stopPropagation(),t=i-e,i=r-n,o.left=e+(0>t?t:0)+"px",o.top=n+(0>i?i:0)+"px",o.width=Math.abs(t)+"px",o.height=Math.abs(i)+"px")},m.df=function(t){var e=this.map,i=t.currentPointer;
2t.target===this.map&&(t.stopPropagation(),this.Pm.style.display="none",e.va.$c({bounds:pf([e.Va(this.kx,this.lx),e.Va(i.viewportX,i.viewportY)])},!0))},m.N=function(t,e){ct.prototype.renderInternal.call(this,t,e),this.sc.Ed(this.la().translate("zoom.rectangle"))},yu.prototype.renderInternal=yu.prototype.N,u(Au,I),t("H.ui.UI",Au),Au.prototype.ow=function(t){for(var e=t.target;e&&!/\bH_ib_content\b/.test(e.className);)e=e.parentNode;e||t.preventDefault()},Au.prototype.B=function(){return this.G},Au.prototype.getElement=Au.prototype.B,Au.prototype.lc=function(){return this.s},Au.prototype.getMap=Au.prototype.lc,Au.prototype.OA=function(){return this.Pb},Au.prototype.getUnitSystem=Au.prototype.OA,Au.prototype.co=function(t){var e,i=this.Gf;if(t!==this.Pb)for(e in this.Pb=t,i)i[e]instanceof ct&&i[e].onUnitSystemChange(this.Pb)},Au.prototype.setUnitSystem=Au.prototype.co,Au.prototype.setDirection=function(t){this.G.setAttribute("dir",t||getComputedStyle(this.lc().B()).direction)},Au.prototype.setDirection=Au.prototype.setDirection,Au.prototype.la=function(){return this.Bq},Au.prototype.Bx=function(){this.Pb===Ns.METRIC?this.co(Ns.IMPERIAL):this.co(Ns.METRIC)},Au.prototype.toggleUnitSystem=Au.prototype.Bx,Au.prototype.Ws=function(t){var e=this.Ie.length,i=this.G;if(0>this.Ie.indexOf(t)){t.ea(this),t.Qa(this.s);var r=t.L(this.rj);e=0<e?this.Ie[e-1].B().nextSibling:this.G.firstChild,i.insertBefore(r,e),this.Ie.push(t)}},Au.prototype.addBubble=Au.prototype.Ws,Au.prototype.cn=function(t){var e=t.items;this.Md&&this.Iv(),clearTimeout(this.pt),this.pt=globalThis.setTimeout(function(){e.length&&(this.Md=new xu(e),this.G.insertBefore(this.Md.L(this.rj),this.G.firstChild),this.Md.ea(this),this.Md.Qa(this.s),this.Md.setPosition(t.viewportX,t.viewportY))}.bind(this),0)},Au.prototype.Iv=function(){this.Md&&(this.Md.l(),this.Md=null)},Au.prototype.CC=function(t){var e=this.Ie.indexOf(t);-1<e&&(t.ea(null),t.Qa(null),this.Ie.splice(e,1),this.G.removeChild(t.B()))},Au.prototype.removeBubble=Au.prototype.CC,Au.prototype.Bz=function(){return this.Ie},Au.prototype.getBubbles=Au.prototype.Bz,Au.prototype.Pg=function(t,e){if(this.Hj(t))throw Error("A control with name ["+t+"] is already registered.");e.ea(this),e.Qa(this.s),e.AB=this.Bq,e.L(this.rj),e.onUnitSystemChange(this.Pb),this.Gf[t]=e},Au.prototype.addControl=Au.prototype.Pg,Au.prototype.EC=function(t){var e=this.Hj(t);if(!e)throw Error("Control ["+t+"] not found in this UI's controls.");return e.unsubscribe(),e.ea(null),e.Qa(null),at(e),delete this.Gf[t],e},Au.prototype.removeControl=Au.prototype.EC,Au.prototype.Hj=function(t){return this.Gf[t]},Au.prototype.getControl=Au.prototype.Hj,Au.prototype.disposeInternal=function(){for(var t in this.Gf)Es.hasOwnProperty.call(this.Gf,t)&&this.Gf[t].l();this.Ie.forEach(function(t){t.l()}),(t=this.G.parentNode)&&t.removeChild(this.G),I.prototype.disposeInternal.call(this),delete this.G},Au.prototype.capture=function(t,e,i,r){var n=this.Hj("scalebar"),o=t.getContext("2d"),s=t.width,a=t.height,l=this.s.Xd,c=5+(l?l.B().childNodes[1].offsetHeight:0);n&&n.Vd()?n.capture(e,function(r){o.drawImage(r,s-r.width-5*e,a-r.height-c*e),i(t)},r):i(t)},Au.prototype.capture=Au.prototype.capture,Au.createDefault=function(t,e,i){var r=t.wa.type;if(i=new Au(t,{unitSystem:Ns.METRIC,zoom:{alignment:"right-bottom"},mapsettings:Du(r,e,t.oa),scalebar:{alignment:"bottom-right"},locale:i||"en-US"}),r===Xi.P2D){var n=i.Hj("mapsettings"),o=function(){if(n.lc()){var i=Du(r,e,t.oa);Bt(n,i.baseLayers,i.layers)}};t.addEventListener(t.j.yl,o),i.bc(function(){t.removeEventListener(t.j.yl,o)}),n.bc(function(){t.removeEventListener(t.j.yl,o)})}if(r===Xi.HARP){if(window.H.service){var s=e.vector.traffic.map.D.$.i(),a=new window.H.service.Url(s.oi,s.Rj.split(".").slice(-2).join(".")),l=(a=zu(window.H.service.traffic.Service7,{platformBaseUrl:a})).i().getQuery();l.apikey=s.getQuery().apikey,a.i().Uk(l),new ju(i,a)}}else new ju(i);return i},Au.prototype.gD=function(){},Au.prototype.setTrafficIncidentsHandle=Au.prototype.gD,t("H.ui.buildInfo",function(){return Ig("H-ui","1.64.3","4cd9a8f",{region:"row"})});var Fu={lookAt:{zoom:{min:-8,max:24},tilt:{min:0,max:0},incline:{min:0,max:0},heading:{min:180,max:180}},interaction:{ZOOM:Bk.ZOOM,COORD:Bk.COORD},capture:!0};function Gu(t,e){this.Xm=[],Gu.g.constructor.apply(this,arguments)}function Hu(t,e){e=e||{},B(t,$k,Hu,0),Hu.g.constructor.call(this,t),this.Od=!!e.Od,this.vC=e.zb||0,this.vn=[],this.$v={}}function Iu(t,e){if(!t)throw new C(Iu,0,t);Iu.g.constructor.call(this,t),this.iw={},this.uj=!(!e||!e.Od),this.Sj=Ju++}t("H.map.render.p2d.capabilities",Fu),u(Gu,Tl),m=Gu.prototype,m.Vt=function(){return this.xb.pe.apply(this.xb,arguments)}
2,m.L=function(t,e,i,r,n,o,s){return this.Xm=[],Gu.g.L.apply(this,arguments)},m.na=1,m.Iw=function(t,e,i,r,n,o){var s=this.na=r.kb();n*=s,o*=s;var a=i.mc();e=a.w*s,a=a.h*s;var l=i.Cb;this.Od?(n-=l.x*s,o-=l.y*s):(n=zb(n-l.x*s),o=zb(o-l.y*s)),r.Qe(i.Se(),n,o,e,a),t.detail?t.detail.set(n,o,n+e,o+a):t.detail=new jh(n,o,n+e,o+a),this.Xm.push(t)},m.Ma=function(t,e,i){for(var r,n,o,s=this.Xm,a=s.length,l=we,c=this.na;a--&&!((n=(r=s[a]).detail).Rl(t,e)&&(r=r.sv,(!(o=r.kc().Bm)||o.Cm((t-n.left)/c,(e-n.top)/c,0))&&0>l.indexOf(r)&&(l===we&&(l=[]),l.push(r),i))););return l},m.Eh=function(){return"2d"},m.disposeInternal=function(){this.Xm=[],Gu.g.disposeInternal.call(this)},Gu.prototype.disposeInternal=Gu.prototype.disposeInternal,u(Hu,Sl),Hu.prototype.L=function(t,e,i,r,n,o){var s,a,l=this.xb;r-=this.vC,this.vn.length=0;var c=this.$v;if(this.$v=s={},r>=l.min&&r<=l.max){var h=l.wg(t,r,n,o),u=h.overlays;if(t=u.length)for(u.sort($g),r=this.Ob,n=this.Od,o=0;o<t;o++){var p=(l=u[o]).C(),d=i.Fb(p.Nc()),m=i.Fb(p.Lc());p=i.w,d.x>=m.x&&(d.x-=
2p),p*=-((d.x+m.x)/p>>1),d.x+=p,d.add(e),m.x+=p,m.add(e),n||(d.round(),m.round()),(p=c[a=l.wb()])?delete c[a]:p={rC:l},s[a]=p;var f=d.x;d=d.y;var g=m.x,y=g-f,v=(m=m.y)-d;r.Dd(l.Ue()),r.Qe(l.Se(),f,d,y,v),p.details?p.details.set(f,d,g,m):p.details=new jh(f,d,g,m),this.vn.push(p)}}return!h||h.requested&&h.requested===h.total||!h.requested&&u.length===h.total?Th.DONE:Th.PENDING},Hu.prototype.Ma=function(t,e,i){for(var r,n,o=this.vn,s=o.length;s--;)if((r=o[s]).details.Rl(t,e))if(r=r.rC,n)n.push(r);else if(n=[r],i)break;return n||we},Hu.prototype.Eh=function(){return"2d"},Hu.prototype.disposeInternal=function(){delete this.vn,Hu.g.disposeInternal.call(this)},Hu.prototype.disposeInternal=Hu.prototype.disposeInternal,u(Iu,Sl);var Ju=0;function Z(t,e,i,r){Z.g.constructor.call(this,t,e,i,r),this.Xb=new F(0,0),(i=r.renderBaseBackground)&&(this.Hw=i.lower,this.Gw=i.higher),this.uj=!!r.enableSubpixelRendering,this.Kg=Ku,this.gv=0,this.vs=this.$u=!1,this.ma=new rl,this.T=r=new gm,this.fg=z(this.fg,this),r.addEventListener(r.j.yo,this.fg),this.La=z(this.La,this),r=t.element,this.qc=t=r.ownerDocument.createElement("div"),t.style.position="absolute",t.style.width=t.style.height="100%",t.style.zIndex=0,r.insertBefore(t,r.firstChild),this.dl=new em(this.qc,this.ja),this.Fe=[],this.fq(),this.vg=z(Z.prototype.vg,this),this.o=Lu,this.Sn(),this.zoom=Mu(this,this.De.Tb()+this.zb),this.zc(),Nu(this,e.Hb().position,this.zoom),this.qb(),this.mg()}Iu.prototype.L=function(t,e,i,r,n,o){var s=zb(r),a=this.xb,l=s+(i.exp-a.pixelProjection.exp),c=a.min,h=a.max;r=a.tileSize;var u=a.D.Rc,p=this.Ob,d=p.Ue(),m=p.mc().w,f=i.w,g=i.x,y=i.y,v={};if(s<c||s>h)return Th.DONE;for(t=(n=a.requestTiles(t,l,n,o,this.Sj)).total,o=(n=n.tiles).length,this.le=i,this.YC=e,this.us=l,d!==u&&p.Dd(u),i=r=r*f/(Fb(2,l)*r),this.uj||(r%1&&(g/=f=i/(r=Ab(r)),y/=f,f=Fb(2,l)*r),g=Ab(g),y=Ab(y)),this.KC=i,l=-r,s=m+r,a=0;a<o;a++){if((c=(m=n[a]).data)&&c.tagName){for(i=e.x-(g-m.x*r),u=e.y-(y-m.y*r),p.Qe(c,i,u,r,r),d=i;(d-=f)>l;)p.Qe(c,d,u,r,r);for(d=i;(d+=f)<s;)p.Qe(c,d,u,r,r)}v[this.us+"_"+m.x+"_"+m.y]=m}return this.iw=v,o===t?Th.DONE:Th.PENDING},Iu.prototype.Ma=function(t,e,i){var r,n=this.KC,o=n/this.xb.tileSize,s=this.le,a=this.YC;if(Ya(this.us)&&s){t=s.x+(t-a.x),e=s.y+(e-a.y);var l=Ab(s.w/n),c=s=Ab(t/n);a=Ab(e/n),Cb(c)>=l&&(c%=l),0>c&&(c=l+c),(l=this.iw[this.us+"_"+c+"_"+a])&&l.Ma&&(r=l.Ma((t-n*s)/o,(e-n*a)/o,i))}return r||we},Iu.prototype.Eh=function(){return"2d"},u(Z,yk),t("H.map.render.p2d.RenderEngine",Z),Z.prototype.type=Hk.P2D;var Lu=2;function Nu(t,e,i){var r=t.pixelProjection;r.Ua(i),t.wd=r.projection.Re(e),r.x=r.w*t.wd.x,r.y=r.h*t.wd.y}function Ou(t,e,i,r){var n=t.getCapabilities().lookAt.zoom.max,o=e.vb(),s=r||o;if(e.Jm()||i&&r)i=i===A?n:i;else{var a=new cj(t.pixelProjection.projection);a.Ua(n);var l=a.Fb(e.Nc()).round(),c=a.Fb(e.Lc()).round();n=a.w,e.pc()&&(l.x-=n),r?(o=a.Fb(s),e=2*yb(o.x-l.x,c.x-o.x),l=2*yb(o.y-l.y,c.y-o.y)):(e=c.x-l.x,l=c.y-l.y,s=o),i===A&&(i=(o=t.sl[4]).right-o.left,o=o.bottom-o.top,i=Dk(t,i=-8+xb(Db(i/e*n)/Nb,Db(o/l*n)/Nb)-t.zb))}return{zoom:Ab(i),position:s}}function Mu(t,e){return Dk(t,Dk(t,e-t.zb)+t.zb)}Z.prototype.getState=function(){return this.o},Z.prototype.getState=Z.prototype.getState,Z.prototype.Fj=function(t,e){return Cb(t=e-t)<this.pixelProjection.w/2?t:t-this.pixelProjection.w*e/Cb(e)},Z.prototype.ar=function(t){var e=this,i=t.animate,r=t.newValue,n=t.modifiers;t=r.position;var o,s=r.bounds,a=this.zoom,l=this.wd,c=0;if(n&Cj.POSITION&&(o=e.pixelProjection.Fb(t)),n&Cj.BOUNDS)r=Ou(this,s.C(),n&Cj.ZOOM?r.zoom:A,n&Cj.POSITION?t:A),this.De.$c(r,i);else{n&Cj.POSITION||(o=e.pixelProjection.Fb(r.position));var h=o.x,u=o.y;this.Jg(),this.Xb.set(0,0);var p=(r=this.Fo(r)).zoom,d=r.position;if(i){var m=p-a,f={x:l.x,y:l.y};i=this.pixelProjection.bi(f).x;var g=this.pixelProjection.projection.Re(t);g.x===this.wd.x&&g.y===this.wd.y&&p===this.zoom||(h=this.Fj(i,h),this.ad(function(t){var i=t-c;if(p!==a){o=e.pixelProjection.bi(g);var r=e.pixelProjection.bi(f);h=e.Fj(r.x,o.x),u=o.y-r.y}c=t,e.Sg(h*i,u*i),a+=m*i,e.sb(a),e.qb(),e.ba()},this.wl,function(){Nu(e,d,p),e.sb(p),e.qb(d),e.ba()},this.xl))}else this.bd(),Nu(this,d,p),this.sb(p),this.qb(d);this.ba()}},Z.prototype.wl=300,Z.prototype.Yn=function(t){var e=hb(t);if(!e||e&&0>t)throw new C(this.Yn,1,"positive number required");this.wl=t},Z.prototype.setAnimationDuration=Z.prototype.Yn,Z.prototype.Ap=function(){return this.wl},Z.prototype.getAnimationDuration=Z.prototype.Ap,Z.prototype.xl=Jl,Z.prototype.Zn=function(t){if(!Wa(t))throw new C(this.Zn,1,"function required");this.xl=t},Z.prototype.setAnimationEase=Z.prototype.Zn,Z.prototype.Bp=function(){return this.xl},Z.prototype.getAnimationEase=Z.prototype.Bp,Z.prototype.Sn=function(){this.xl=Jl,this.wl=300},Z.prototype.resetAnimationDefaults=Z.prototype.Sn,m=Z.prototype,m.Uq=function(t,e,
2i){var r;this.ak=yj(),(r=this.Zh.ka.splice(t,1)[0])&&r.l&&r.l(),(r=this.Lf.ka.splice(t,1)[0])&&r.l&&r.l(),(r=this.ri.ka.splice(t,1)[0])&&r.l&&r.l(),(r=this.pi.ka.splice(t,1)[0])&&r.l&&r.l(),this.af=this.gb.Sa(),0===t&&(Ck(this,e,!1),this.zc()),this.Fe=fm(this.dl,this.Sf(),this.Pf()),this.li(),i||this.ba()},m.fq=function(){var t=this.gb.Sa(),e=0,i=t.length;for([this.Zh={},this.Lf={},this.ri={},this.pi={}].forEach(function(t){t.Pe=[],t.ka=[]}),this.af=this.gb.Sa();e<i;e++)this.qk(e,t[e]);this.zc()},m.Vq=function(){this.zc(),this.ba()},m.gq=function(t,e,i){var r,n,o,s;if(e){var a={Od:this.uj,zb:this.zb};e.L?B(e,oj)?n=new cm(e):B(e,qj)&&(s=new cm(e)):(e.requestOverlays&&(r=new Hu(e,a)),e.requestTiles&&(n=new Iu(e,a)),e.requestMarkers&&(o=new Gu(e,a)),e.requestDomMarkers&&(s=new Wl(e,a)))}i=i||0,this.Zh.ka.splice(t,i,r),this.Lf.ka.splice(t,i,n),this.ri.ka.splice(t,i,o),this.pi.ka.splice(t,i,s),this.af=this.gb.Sa(),this.Fe=fm(this.dl,this.Sf(),this.Pf())},m.Pf=function(){var t=[];return(t=(t=(t=(t=t.concat(this.Lf.ka)).concat(this.Zh.ka)).concat(this.ri.ka)).concat(this.pi.ka)).filter(Ya)},m.Ro=function(){return this.o===Lu},m.Fo=function(t){var e=Dk(this,Dk(this,t.zoom)+this.zb);return(t=Ek(this,t)).zoom=e,t},m.Va=function(t,e){var i=this.Ba.center,r=this.ja;return this.pixelProjection.Ya((t-i.x)*r,(e-i.y)*r)},Z.prototype.screenToGeo=Z.prototype.Va,Z.prototype.Wn=function(t,e){return t=this.Va(t,e),(e=this.De.Hb()).position=t,e},Z.prototype.La=function(t){var e=this.ja,i=this.Ba.center,r=i.x*e;i=i.y*e,t=this.pixelProjection.Fb(t);var n=this.pixelProjection.w;return new F(zb((t.x-zb(t.x/n)*n+r)/e),zb((t.y+i)/e))},Z.prototype.geoToScreen=Z.prototype.La,Z.prototype.C=function(t,e){var i=this.sl[t||4];t=this.pixelProjection;var r=i.left-e,n=t.Ya(r,i.top-e),o=i.right+e;return e=t.Ya(o,i.bottom+e),o-r>=t.w&&(n.lng=-(e.lng=180)),of(n,e)},Z.prototype.Ma=function(t,e,i,r){var n,o=[],s=this.ja;for(t*=s,e*=s,n=(s=[this.Zh,this.Lf,this.ri,this.pi]).length;n--&&(!i||!o.length);)o=this.Np(o,s[n].ka,t,e,i);r(o)},Z.prototype.getObjectsAt=Z.prototype.Ma,m=Z.prototype,m.Np=function(t,e,i,r,n){for(var o,s=e.length;s--&&!((o=e[s])&&o.Ma&&(t=t.concat(o.Ma(i,r,n)),t.length&&n)););return t},m.xe=x,m.Sf=function(){var t=this.sl[2];return{w:t.right-t.left,h:t.bottom-t.top}},m.mg=function(){var t,e=this.Fe.length;Z.g.mg.call(this);var i=this.Sf();this.Xb.set(0,0);var r=i.w;for(t=i.h;e--;){var n=(i=this.Fe[e]).mc();n.w===r&&n.h===t||i.Vk(r,t)}this.xe=new ch(r,t),this.ba()},m.getCapabilities=function(){return Fu},Z.prototype.getCapabilities=Z.prototype.getCapabilities,m=Z.prototype,m.wq=function(){this.ne=!1,this.o=1,this.F(1),this.Mk()},m.Mk=function(){this.ta&&this.ta.R||yj()-this.ak<this.Kg&&!this.ne?this.rh=wj(this.vg):(this.ne&&(this.li(),this.qj(),this.F(0)),this.o=Lu)},m.li=function(){this.Zh.Pe.length=0,this.Lf.Pe.length=0,this.ri.Pe.length=0,this.pi.Pe.length=0},m.vg=function(){var t;this.ef&&this.ef.before();var e=this.Lf.ka,i=this.Ba.center.clone().scale(this.ja).round(),r=this.C(1,0),n=this.C(1,Pu),o=this.zoom,s=o-this.zb,a=this.pixelProjection,l=this.Hw,c=this.Gw,h=e[0];e=this.Xb;var u=this.Fe.length,p=this.af;for(t=p.length;u--;){var d=this.Fe[u];B(d,bm)&&d.clear()}if(h){if(l)for(;l;)u=o-l,h.L(r,i,a,u,!0,e),--l;if(c&&this.vs)for(d=1;d<=c&&(u=o+d,a.Ua(u),l=this.C(2,0),a.Ua(o),!h.L(l,i,a,u,!0,e));d++);}for(this.Kg=Ku;t--;)B(a=p[t],fj)&&a.D&&a.D.yk(n,s);r=this.Nn(r,i,o,!1,e,Qu,this.Lf,this.Zh),i=this.Nn(n,i,s,!1,e,Ru,this.ri,this.pi),this.ne=r&&i,this.ta&&this.ta.R&&this.Ho(),this.uf||(this.uf=this.De.Hb()),this.uf.bounds=this.C(4,0),this.De.qb(this.uf),this.uf=null,this.xe&&(this.Ba.qb(this.xe),this.xe=x),o<this.gv?this.vs=!0:this.$u&&(this.vs=!1),this.gv=o,this.$u=r,this.ef&&this.ef.after(),this.Mk()},m.Nn=function(t,e,i,r,n,o,s){var a,l=Array.prototype.slice.call(arguments,6),c=l.length,h=l[0].ka.length,u=c*h,p=!!u;for(a=0;a<u;a++){if(o===Qu)var d=a%c,m=Math.floor(a/c);else d=Math.floor(a/h),m=a%h;var f=l[d].ka[m];d=l[d].Pe,f&&((f=f.L(t,e,this.pixelProjection,i,r,n,this.La))===Th.ACTIVE&&(this.Kg=1/0),f!==Th.DONE||d[m]||(this.qj(this.af[m]),d[m]=!0),d[m]||(p=!1))}return p},m.qj=function(t){this.dispatchEvent({type:this.j.Ss,target:t||this})},m.disposeInternal=function(){var t=this.gb.Sa()[0],e=this.Ba;
2xj(this.rh),this.bd(!0),t&&Ck(this,t,!1),this.Pf().forEach(function(t){t.l()}),e.element&&e.element.removeChild(this.qc),this.qc=null,this.o=3,Z.g.disposeInternal.call(this)},m.ba=function(){this.ak=yj(),this.Ro()&&this.wq()},m.Ac=function(t,e){this.Sg(t*this.ja,e*this.ja),this.Xb.set(0,0),this.qb(),this.ba()},m.Sg=function(t,e){var i=this.pixelProjection,r=this.wd;i.x=Yb(i.x+t,i.w),i.y=yb(0,xb(i.w,i.y+e)),r.x=i.x/i.w,r.y=i.y/i.h},m.Ng=function(t,e,i){t=Dk(this,Dk(this,t)+this.zb),this.sb(t,e,i)},Z.prototype.zoomAt=Z.prototype.Ng,Z.prototype.sb=function(t,e,i){var r=this.ja,n=this.Ba.center;e===+e&&i===+i?(e=(e-n.x)*r,i=(i-n.y)*r,this.Xb.set(e,i),this.Sg(e,i),this.pixelProjection.Ua(t),this.Sg(-e,-i)):(this.Xb.set(0,0),this.pixelProjection.Ua(t)),this.zoom=t,this.qb(),this.ba()},Z.prototype.Jg=function(){this.bd(!0),this.T.R&&this.hc(!0),this.ma.R&&this.ic(!0),this.bd(!0)},Z.prototype.Hd=function(t,e){this.Jg(),this.Sk(e),this.ma.start(t,!!e)},Z.prototype.startInteraction=Z.prototype.Hd,Z.prototype.Sk=function(t){if(t){var e={};e.xk=t.power,e.tj=t.ease,e.duration=t.duration,this.ua=e}},Z.prototype.ud=function(t,e,i,r,n){var o=!1;this.ma.R&&(e=this.ma.store(t,e,i,r,n),this.ma.$d(Bk.COORD)&&0<ql(t=this.ma.Ah())&&(this.Ac(-t.x,-t.y),o=!0),e&&this.ma.$d(Bk.ZOOM)&&(t=this.ma.jm(),e=this.ma.km(),(e=Db(Fb(2,this.zoom)*e)/Nb)!==this.zoom&&(e=Mu(this,e),this.sb(e,t.x,t.y),o=!0)),o&&this.ba())},Z.prototype.interaction=Z.prototype.ud,Z.prototype.ic=function(t){var e=this;if(this.ma.R&&!t){if(this.ua){t=this.ma.nc();var i=this.ma.Mf(),r=this.ua.duration,n=(this.ua.xk||1)*t,o=new ol(-n/(0<r?r:1),n);!E(i.x)&&!E(i.y)&&0<n&&e.ma.$d(Bk.COORD)&&this.ad(function(t){n=o.Ij(t*r),E(n)||e.Ac(zb(-i.x*n),zb(-i.y*n))},r,void 0,this.ua.tj)}this.ua=null,this.ma.clear()}},Z.prototype.endInteraction=Z.prototype.ic,Z.prototype.Gd=function(t,e,i){this.Jg(),this.T.start(e,i),this.Sk(t)},Z.prototype.startControl=Z.prototype.Gd,Z.prototype.control=function(t,e,i){if(E(+i))throw new C(this.control,2,i);if(E(t))throw new C(this.control,0,t);if(E(e))throw new C(this.control,1,e);this.T.R&&this.T.set(t,e,i,0,0,0)},Z.prototype.control=Z.prototype.control,Z.prototype.hc=function(t,e){var i,r=this;if(this.T.R){this.bd(!0);var n=yj(),o=n-this.kj;if(1<=o){var s=jm(this.T);this.Ri(s,o)}if(!this.ua||t||e)"function"==typeof e&&((t=this.Hb()).zoom=this.zoom-this.zb,e(t),t.zoom+=this.zb,this.Io(t));else{e=this.T.nc();var a=this.T.Mf(),l=this.ua.duration,c=(this.ua.xk||1)*e,h=new ol(-c/(0<l?l:1),c);!E(a.Kb)&&!E(a.Lb)&&0<c&&this.ad(function(t,e,o,s){n&&(o=s-n,n=0),c=h.Ij(t*l)*o,E(c)||((i=a.Mb*c)&&r.sb(Mu(r,r.zoom+i),r.T.Ug,r.T.Vg),r.Ac(zb(a.Kb*c),zb(a.Lb*c)))},l,void 0,this.ua.tj)}this.T.reset()}},Z.prototype.endControl=Z.prototype.hc,m=Z.prototype,m.Io=function(t){var e=this,i=this.wd,r=this.pixelProjection.projection.Re(t.position),n=this.pixelProjection.bi(r),o=n.y;n=n.x;var s=t.zoom;t=(i=this.pixelProjection.bi(i)).y;var a=i.x;i=this.zoom;var l=this.T.nc(),c=this.T.Ug,h=this.T.Vg,u=0;if(n=this.Fj(a,n),t=Eb((n-=a)*n+(o-=t)*o+(i=s-i)*i),0!==l&&0!==t){var p=n/t,d=o/t,m=i/t,f=l*l/(2*t);this.ad(function(t,i){var n;1!==t?((n=m*(i=(t=l*i-f*i*i/2)-u))&&(n=Mu(e,e.zoom+n),e.sb(Mu(e,n),c,h)),e.Ac(zb(p*i),zb(d*i)),u=t):(e.wd=r,e.sb(Mu(e,s),c,h),e.qb(),e.ba())},2*t/l)}},m.fg=function(t){var e=this,i=t.kt;this.Xb.set(0,0),i.Kb||i.Lb||i.Mb?(this.kj=yj(),this.ad(function(t,r,n,o){e.kj=o,e.Ri(i,n)},Number.POSITIVE_INFINITY),this.ba()):this.bd(!0)},m.Ri=function(t,e){e=e||0,t.Mb&&this.sb(Mu(this,this.zoom+t.Mb*e),this.T.atX,this.T.atY),this.Ac(t.Kb*e,t.Lb*e)},m.ad=function(t,e,i,r){this.ta&&this.ta.R&&this.ta.stop(!0),this.ta=new Rl(this,t,e,i,r),this.ta.start()},m.bd=function(t){this.ta&&this.ta.R&&this.ta.stop(t)},m.mp=function(){},Z.prototype.enter=Z.prototype.mp,Z.prototype.rp=function(t){Ak(this.qc,t)},Z.prototype.exit=Z.prototype.rp,Z.prototype.capture=function(t,e,i,r){var n=this.qc.ownerDocument.createElement("canvas"),o=n.getContext("2d"),s=this.ja;for(n.width=(i-t)*s,n.height=(r-e)*s,i=0;i<this.Fe.length;i++)B(r=this.Fe[i],bm)&&o.drawImage(r.B(),-t*s,-e*s);return Pc(n)};var Ru=0,Qu=1,Ku=1e3,Pu=256;function Su(t){var e;if(t)for(Tu={},e=t.length;e--;)Tu[t[e]]=!0;this.mx={}}var Uu,Tu={};
2Su.prototype.parse=function(t,e,i){var r,n,o,s,a;Uu=!1;try{i=JSON.parse(i)}catch(t){Uu=!0}if(i&&(r=i.metadata)){var l={spatials:[]};for(n in r)if((i=!Tu[n]&&(o=Vu[n]))&&((s=r[n])||(Uu=!0,s=void 0),i=s),i)for(i=s.length;i--;){var c;(c=s[i])||(Uu=!0,c=void 0),(a=c)&&o(e,t,this,n,a,l)}}else Uu=!0;return Uu?void 0:l},Su.prototype.parse=Su.prototype.parse;var Vu={"street labels":function(t,e,i,r,n,o){var s;if((s=n.vertices)||(Uu=!0,s=void 0),s){var a,l,c=s.length;if((l=0<c)||(Uu=!0,l=void 0),l)for(a=Array(c/2);c;){var h=s[--c];l=s[--c],a[c/2]=new F(l,h)}a=a?{Sc:[a]}:A,c=+n["font size"]/t.kb(),(s=i.mx[c])||(Wu.lineWidth=c,s=i.mx[c]=i.gh.du(Wu)),Xu(t,e,a,!1,s,n,r,o)}delete n.vertices},"city center labels":function(t,e,i,r,n,o){Xu(t,e,Yu(n,new mh([])),!0,i.gh,n,r,o)},labels:function(t,e,i,r,n,o){var s;if((s=n["bounding boxes"])||(Uu=!0,s=void 0),s){for(var a,l=s.length,c=new mh([]);l--;){var h;(h=s[l])||(Uu=!0,h=void 0),(a=h)&&Yu(a,c)}Xu(t,e,c,!0,i.gh,n,r,o)}delete n["bounding boxes"]},buildings:function(t,e,i,r,n,o){var s,a,l,c,h=n.id,u=e.Ln[h],p=[],d=[];(s=n)||(Uu=!0,s=void 0),s&&((a=s.vertices)||(Uu=!0,a=void 0),a)&&((c=s.polygons)||(Uu=!0,c=void 0),(l=c)&&p.push.apply(p,Zu(a,l)),(s=s.outlines)||(Uu=!0,s=void 0),(l=s)&&d.push.apply(d,Zu(a,l))),l=p.length,p.push.apply(p,d),d=new mh(p,Vb,l),(p=p.length)||(Uu=!0,p=void 0),p&&(u?(Pp(u,t,[d]),o.spatials.push(u)):(u=Xu(t,e,d,!0,i.gh,n,r,o,h),e.Y(u)))}};Vu["transit stops"]=Vu.POIs=Vu.labels;var $u=["box 2","box 1","annotation box","icon box"];function Yu(t,e){for(var i,r,n=$u.length;n--;)if(r=t[i=$u[n]]){var o=r[0],s=r[1],a=r[2];r=r[3],e.Sc.push([new F(o,s),new F(o+a,s),new F(o+a,s+r),new F(o,s+r)]),delete t[i]}return e}function Zu(t,e){var i,r,n,o=e.length;if(0<o)for(r=Array(o);o--;)if((i=e[o])||(Uu=!0,i=void 0),i){var s=i.length;if(0<s)for(r[o]=n=Array(s);s--;){var a=2*i[s];n[s]=new F(t[a],t[a+1])}}return r||[]}var av={};function Xu(t,e,i,r,n,o,s,a,l){return av.style=n,r=new Lp(e,r,l,av),i&&Pp(r,t,[i]),bv(o),o.category=s,r.setData(o),a.spatials.push(r),r.ea(e),r}Su.prototype.gh=new P({strokeColor:"transparent",fillColor:"transparent",lineWidth:0});var Wu={};function bv(t){var e,i=!1;switch(typeof t){case"object":if(t instanceof Array)for(e=t.length;e--;)bv(t[e])?i=!0:delete t[e];else if(t)for(e in t)bv(t[e])?i=!0:delete t[e];break;case"number":i=!0;break;default:i=!!t}return i}function cv(t,e,i){e=e||{};var r=(i=i||{}).tileType||"maptile",n=i.scheme||"normal.day";if(S.call(this,{min:0,max:20}),!0===e.pois&&(e.pois="!F"),this.Ga=e,!(t&&t instanceof dv))throw Error("InvalidArgument: service required");this.$=t,this.Be=z(this.Be,this),this.$.addEventListener("versionupdate",this.Be),this.kd=t.i().clone().A(r+"/"+t.Ud()+"/"+n).v(ev).v(e),this.Fg=t.Fg||null,this.na=i.pixelRatio||i.pixelratio||he(),this.tileSize=i.tileSize||256,this.tileType=r,this.scheme=n,this.ts=0,this.zd=new Wp(new Su(i.categoryFilter)),this.zd.ea(this),this.ge=z(this.ge,this),this.zd.addEventListener("update",this.ge),this.Xe=!1,S.call(this,{min:0,max:20}),this.$n(new Lj(i.tileCacheSize||256,z(this.je,this)))}u(cv,S),t("H.service.metaInfo.TileProvider",cv),cv.prototype.je=function(t,e){for(var i,r=(t=e.ab()).length;r--;)delete(i=t[r]).Gk[e.key],i.release();e.data&&(to.push(e.Jn(),this.tileSize),e.Kn())},cv.prototype.ge=function(){this.dispatchEvent("update")},cv.prototype.u=function(t,e,i,r,n){var o,s=this.kd.clone(),a=this.Fg,l=this.tileSize,c=this.getTileKey(t,e,i);if((c=this.Rb().get(c))&&!c.Ih()){r(to.pop(this.tileSize),null);var h={cancel:function(){}}}else{a&&s.sa(a[(i+e+t)%a.length]),s.A(i+"/"+t+"/"+e+"/"+l+"/png8");var u=globalThis.setTimeout(function(){(o=new Me("text/plain",s.toString())).then(function(t){r(null,t)},n)},500)}return this.Xe||(oo(cv,"Use HERE Vector Tile API or Raster Tile API v3 instead."),this.Xe=!0),h||{cancel:function(){o?o.cancel():globalThis.clearTimeout(u)}}},cv.prototype.requestInternal=cv.prototype.u,cv.prototype.nd=function(t,e,i,r,n){var o=this.zd,s=r||to.pop(this.tileSize);if(r)(t=this.Rb().get(this.getTileKey(t,e,i))).L(r);else if(delete(r=t=new Mk(this.Td(t,e,i),t,e,i,this.tileSize,this.na,i+this.ts,o)).Ji,r.vl=n,t.L(s))for(s=(n=t.ab()).length;s--;)n[s].Un();else to.push(s,this.tileSize);return t},cv.prototype.createTileInternal=cv.prototype.nd,cv.prototype.l=function(){this.zd.l(),this.$.removeEventListener("versionupdate",this.Be),S.prototype.l.call(this)},cv.prototype.dispose=cv.prototype.l,cv.prototype.Be=function(){var t=this.$;this.kd=t.i().clone().A(this.tileType+"/"+t.Ud()+"/"+this.scheme).v(ev).v(this.Ga),this.reload(!1)};var ev={metadata:"metaonly",mgen:"2"},a;function dv(t){var e=this;dv.g.constructor.call(this,dv,t);var i=Do(this,t);this.Fg=i.shards,(this.rb=i.ignoreTypes?null:i.type)&&this.i().sa(this.rb),this.pr={},this.ec=new dp,setTimeout(function(){e.dispatchEvent("infoupdate"),void 0!==i.version&&"newest"!==i.version||e.dispatchEvent("versionupdate")})}u(dv,Co),t("H.service.metaInfo.Service",dv),dv.prototype.ya=function(){return{type:"base",version:"newest",subDomain:"maps.ls",path:"maptile/2.1",shards:["1","2","3","4"]}},dv.CONFIG_KEY="metaInfo",dv.prototype.tu=function(){return this.rb},dv.prototype.Ud=function(){return this.ya().version},dv.prototype.getVersion=dv.prototype.Ud,dv.prototype.U=function(){return this.ec},dv.prototype.getCopyrights=dv.prototype.U,dv.prototype.Lj=ve,dv.prototype.getInfo=dv.prototype.Lj,dv.prototype.oj=function(t,e,
2i,r,n,o){return new cv(this,r,{tileSize:t,pixelRatio:e,categoryFilter:i,tileType:n,scheme:o})},dv.prototype.createTileProvider=dv.prototype.oj,dv.prototype.Nd=function(t,e,i,r,n,o){return new Ik(this.oj(t,e,i,r,n,o))},dv.prototype.createTileLayer=dv.prototype.Nd,X.prototype.ku=function(t){return this.Ja(dv,t)},X.prototype.getMetaInfoService=X.prototype.ku,a=X.prototype.createDefaultLayers,X.prototype.createDefaultLayers=function(t,e,i,r,n,o){var s=a.call(this,t,e,i,r,n,o),l={},c=this.ku();"object"==typeof t&&(t=(o=t).tileSize,e=o.ppi,i=o.lg,r=o.lg2,n=o.style,o=o.pois),t=t||256;var h=320===e?2:1;if(0>[72,250,320,500].indexOf(+e)){if(e!==A)throw new C(this.Yl,1,e)}else l.ppi=+e;return i&&(l.lg=i),r&&(l.lg2=r),n&&(l.style=n),o&&(l.pois=o),s.raster.normal.metaInfo=c.Nd(t,h,["buildings"],l),s},H.__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})}if(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)}
2function 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(a){if(Error.captureStackTrace)Error.captureStackTrace(this,Ga);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))}Fa(Ga,Error);Ga.prototype.name="CustomError";var Ha=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 Ia(){var a=Ja,b;for(b in a)return!1;return!0}function Ka(a){var b={},c;for(c in a)b[c]=a[c];return b}var La="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Ma(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<La.length;f++)c=La[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};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)});function 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]||[]}
2nb.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;function ub(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]}ub.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]};ub.prototype.T=function(){return this.oc};var y=Math,vb=y.min,wb=y.max,xb=y.round,yb=y.floor,zb=y.ceil,Bb=y.abs,Cb=y.log,Db=y.sqrt,z=y.pow,Eb=y.exp,Fb=y.sin,Gb=y.asin,Hb=y.cos,Ib=y.tan,Jb=y.atan,Kb=y.atan2,Lb=y.LN2,A=y.PI,Mb=A/2,Nb=A/4,Ob=2*A,Pb=3*A,Qb=A/180,Rb=180/A,Sb=1/0;function Tb(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-yb(a/b)*b+c});function Ub(a,b,c){return(a-=0)>c?c:a<b?b:a}r("H.math.clamp",Ub);\nfunction Vb(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 Wb={NONE:0,VERTEX:1,EDGE:2,SURFACE:3};r("H.math.CoverType",Wb);\nfunction Xb(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=Vb(b,g,k)&&0>=Db(z((a-h)*(g-k)-(b-k)*(f-h),2)/(z(f-h,2)+z(g-k,2)))?2:0;else if(!n&&Vb(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=Vb(b,g,k)&&0>=Db(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 Yb(a,b){return Xb(a.x,a.y,b)!==Wb.NONE}r("H.math.isPointInsidePolygon",Yb);function Zb(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",Zb);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=xb(this.x);this.y=xb(this.y);return this};B.prototype.round=B.prototype.round;B.prototype.floor=function(){this.x=yb(this.x);this.y=yb(this.y);return this};B.prototype.floor=B.prototype.floor;B.prototype.ceil=function(){this.x=zb(this.x);this.y=zb(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 Db(z(this.x-a.x,2)+z(this.y-a.y,2))};B.prototype.distance=B.prototype.eb;B.fromIPoint=function(a){if(!a)throw Error("invalid argument");return a instanceof B?a:new B(a.x,a.y)};function $b(a,b,c){var d=Ub(+a,-90,90);if(b&&Ya(d))throw new x(b,c,a);return d}function ac(a,b,c){var d=+a;if(-180>d||180<d)d=Tb(d+180,360)-180;if(b&&Ya(d))throw new x(b,c,a);return d}function bc(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<Bb(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=$b(a,D,0);this.lng=ac(b,D,1);c!==t&&(this.alt=bc(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;
2D.prototype.eb=function(a){if(this===a||this.lat===a.lat&&this.lng===a.lng)a=0;else{var b=this.lat*Qb;var c=a.lat*Qb;a=1.274200158E7*Gb(vb(1,Db(z(Fb((b-c)/2),2)+Hb(b)*Hb(c)*z(Fb((this.lng*Qb-a.lng*Qb)/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*Qb;a=Qb*this.lat;var e=Fb(a);c=Fb(d);var f=Hb(d);d=Qb*this.lng;var g=Hb(a);a=Gb(g*Hb(b)*c+e*f);b=Kb(Fb(b)*g*c,f-e*Fb(a));b=(d+b+A)%(2*A)-A;b*=Rb;e=new D(a*Rb,(b+540)%360-180)}return e||this}a=(a%360+360)%360;if(0===(a+90)%180)return a=this.lng+b/(6371000.79*Ob*Hb(this.lat*Qb))*(270===a?-360:360),new D(this.lat,(a+540)%360-180);if(b/=6371000.79)a*=Qb,e=this.lat*Qb,c=this.lng*Qb,d=e+b*Hb(a),f=d-e,g=Cb(Ib(d/2+Nb)/Ib(e/2+Nb)),g=Ya(f/g)?\nHb(e):f/g,a=b*Fb(a)/g,Bb(d)>Mb&&(d=0<d?A-d:-(A+d)),d=new D(d*Rb,((c+a+Pb+(Bb(e+f)>Mb?A:0))%Ob-A)*Rb);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 cc(a,b,c){var d=ra(a)&&!(Ya(a.lat=$b(a.lat))||Ya(a.lng=ac(a.lng))||a.alt!==t&&Ya(a.alt=bc(a.alt)));if(!d&&b)throw new x(b,c,a);return d}D.validate=cc;function dc(a){if(!a)throw new x(dc,0,a);return new D(a.lat,a.lng,a.alt)}\nD.fromIPoint=dc;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]};r("H.util.constants.DEFAULT_MIN_ZOOM_LEVEL",0);r("H.util.constants.DEFAULT_MAX_ZOOM_LEVEL",22);function ec(){}function fc(a){return vb(1,wb(0,.5-Cb(Ib(Nb+Mb*a/180))/A/2))}ec.prototype.Oa=function(a,b,c){c?(c.x=b/360+.5,c.y=fc(a)):c=new B(b/360+.5,fc(a));return c};ec.prototype.latLngToPoint=ec.prototype.Oa;ec.prototype.Ac=function(a,b){return this.Oa(a.lat,a.lng,b)};ec.prototype.geoToPoint=ec.prototype.Ac;function gc(a){return 0>=a?90:1<=a?-90:Rb*(2*Jb(Eb(A*(1-2*a)))-Mb)}\nec.prototype.ka=function(a,b,c){c?(c.lat=gc(b),c.lng=360*(1===a?1:Tb(a,1))-180):c=new D(gc(b),360*(1===a?1:Tb(a,1))-180);return c};ec.prototype.xyToGeo=ec.prototype.ka;ec.prototype.ed=function(a,b){return this.ka(a.x,a.y,b)};ec.prototype.pointToGeo=ec.prototype.ed;var hc=new ec;r("H.geo.mercator",hc);function G(a,b){this.projection=a||hc;this.ec=0;this.Da=this.exp=Cb(b||256)/Lb;ic(this);this.y=this.x=0}r("H.geo.PixelProjection",G);var jc=Bb(24)+Bb(-8);G.prototype.hd=hc;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,jc);G.prototype.w=G.prototype.w;G.prototype.Rc=z(2,jc);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;ic(this);this.x=b*this.w;this.y=c*this.h};G.prototype.rescale=G.prototype.Aa;function ic(a){a.Da>jc&&(a.Da=jc);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;var kc=new B(0,0);function lc(a,b,c,d,e){d[e]=b;d[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 ub(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));
2c=[k].concat(n).concat(m);c=e?(new Uint32Array(c)).buffer:c;this.postMessage(c,[c])});function L(){}r("H.service.extension.dataView.ITable",L);L.prototype.nb=function(){};L.prototype.getMeta=L.prototype.nb;L.prototype.ob=function(){};L.prototype.getRowCount=L.prototype.ob;L.prototype.Ja=function(){};L.prototype.getRow=L.prototype.Ja;L.prototype.L=function(){};L.prototype.getColumnNames=L.prototype.L;L.prototype.lb=function(){};L.prototype.getColumn=L.prototype.lb;L.prototype.o=function(){};L.prototype.getCell=L.prototype.o;L.prototype.concat=function(){};L.prototype.concat=L.prototype.concat;function qc(){}r("H.service.extension.dataView.IRow",qc);qc.prototype.L=function(){};qc.prototype.getColumnNames=qc.prototype.L;qc.prototype.o=function(){};qc.prototype.getCell=qc.prototype.o;qc.prototype.pb=function(){};qc.prototype.getTable=qc.prototype.pb;function rc(a,b){this.Ca=a;this.nd=b}r("H.service.extension.dataView.ObjRow",rc);rc.prototype.L=function(){return this.Ca.L()};rc.prototype.getColumnNames=rc.prototype.L;rc.prototype.o=function(a){return this.Ca.o(this.nd,a)};rc.prototype.getCell=rc.prototype.o;rc.prototype.pb=function(){return this.Ca};rc.prototype.getTable=rc.prototype.pb;function sc(){}r("H.service.extension.dataView.IColumn",sc);sc.prototype.o=function(){};sc.prototype.getCell=sc.prototype.o;function tc(a,b){this.Ca=a;this.qc=b}r("H.service.extension.dataView.ObjColumn",tc);tc.prototype.o=function(a){return this.Ca.o(a,this.qc)};tc.prototype.getCell=tc.prototype.o;function M(){0!=uc&&(vc[ua(this)]=this);this.na=this.na;this.G=this.G}var uc=0,vc={};M.prototype.na=!1;M.prototype.C=function(){if(!this.na&&(this.na=!0,this.K(),0!=uc)){var a=ua(this);if(0!=uc&&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 vc[a]}};\nM.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))};M.prototype.K=function(){if(this.G)for(;this.G.length;)this.G.shift()()};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");var Cc=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 Q(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=this.xa=!1}Q.prototype.stopPropagation=function(){this.xa=!0};Q.prototype.preventDefault=function(){this.defaultPrevented=!0};function Dc(a,b){Q.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:Ec[a.pointerType]||"";this.state=a.state;this.oa=a;a.defaultPrevented&&Dc.Z.preventDefault.call(this)}}\nFa(Dc,Q);var Ec={2:"touch",3:"pen",4:"mouse"};Dc.prototype.stopPropagation=function(){Dc.Z.stopPropagation.call(this);this.oa.stopPropagation?this.oa.stopPropagation():this.oa.cancelBubble=!0};Dc.prototype.preventDefault=function(){Dc.Z.preventDefault.call(this);var a=this.oa;a.preventDefault?a.preventDefault():a.returnValue=!1};var Fc="closure_listenable_"+(1E6*Math.random()|0);var Gc=0;function Hc(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=++Gc;this.za=this.Ga=!1}function Ic(a){a.za=!0;a.listener=null;a.proxy=null;a.src=null;a.La=null};
2function Jc(a){this.src=a;this.m={};this.Ea=0}Jc.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=Kc(a,b,d,e);-1<g?(b=a[g],c||(b.Ga=!1)):(b=new Hc(b,this.src,f,!!d,e),b.Ga=c,a.push(b));return b};Jc.prototype.remove=function(a,b,c,d){a=a.toString();if(!(a in this.m))return!1;var e=this.m[a];b=Kc(e,b,c,d);return-1<b?(Ic(e[b]),Array.prototype.splice.call(e,b,1),0==e.length&&(delete this.m[a],this.Ea--),!0):!1};\nfunction Lc(a,b){var c=b.type;if(c in a.m){var d=a.m[c],e=Ha(d,b),f;(f=0<=e)&&Array.prototype.splice.call(d,e,1);f&&(Ic(b),0==a.m[c].length&&(delete a.m[c],a.Ea--))}}Jc.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,Ic(d[e]);delete this.m[c];this.Ea--}return b};Jc.prototype.mb=function(a,b,c,d){a=this.m[a.toString()];var e=-1;a&&(e=Kc(a,b,c,d));return-1<e?a[e]:null};\nfunction Kc(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 Mc="closure_lm_"+(1E6*Math.random()|0),Nc={},Oc=0;function Pc(a,b,c,d,e){if(d&&d.once)Qc(a,b,c,d,e);else if(Array.isArray(b))for(var f=0;f<b.length;f++)Pc(a,b[f],c,d,e);else c=Rc(c),a&&a[Fc]?a.D.add(String(b),c,!1,ra(d)?!!d.capture:!!d,e):Sc(a,b,c,!1,d,e)}\nfunction Sc(a,b,c,d,e,f){if(!b)throw Error("Invalid event type");var g=ra(e)?!!e.capture:!!e,h=Tc(a);h||(a[Mc]=h=new Jc(a));c=h.add(b,c,d,g,f);if(!c.proxy){d=Uc();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)Cc||(e=g),void 0===e&&(e=!1),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(Vc(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error("addEventListener and attachEvent are unavailable.");Oc++}}\nfunction Uc(){function a(c){return b.call(a.src,a.listener,c)}var b=Wc;return a}function Qc(a,b,c,d,e){if(Array.isArray(b))for(var f=0;f<b.length;f++)Qc(a,b[f],c,d,e);else c=Rc(c),a&&a[Fc]?a.D.add(String(b),c,!0,ra(d)?!!d.capture:!!d,e):Sc(a,b,c,!0,d,e)}function Xc(a,b,c,d,e){if(Array.isArray(b))for(var f=0;f<b.length;f++)Xc(a,b[f],c,d,e);else d=ra(d)?!!d.capture:!!d,c=Rc(c),a&&a[Fc]?a.D.remove(String(b),c,d,e):a&&(a=Tc(a))&&(b=a.mb(b,c,d,e))&&Yc(b)}\nfunction Yc(a){if("number"!==typeof a&&a&&!a.za){var b=a.src;if(b&&b[Fc])Lc(b.D,a);else{var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(Vc(c),d):b.addListener&&b.removeListener&&b.removeListener(d);Oc--;(c=Tc(b))?(Lc(c,a),0==c.Ea&&(c.src=null,b[Mc]=null)):Ic(a)}}}function Vc(a){return a in Nc?Nc[a]:Nc[a]="on"+a}function Wc(a,b){if(a.za)a=!0;else{b=new Dc(b,this);var c=a.listener,d=a.La||a.src;a.Ga&&Yc(a);a=c.call(d,b)}return a}\nfunction Tc(a){a=a[Mc];return a instanceof Jc?a:null}var Zc="__closure_events_fn_"+(1E9*Math.random()>>>0);function Rc(a){if("function"===typeof a)return a;a[Zc]||(a[Zc]=function(b){return a.handleEvent(b)});return a[Zc]};r("H.util.Event",Q);Q.prototype.stopPropagation=Q.prototype.stopPropagation;Q.prototype.stopPropagation=Q.prototype.stopPropagation;Q.prototype.CAPTURING_PHASE=1;Q.prototype.CAPTURING_PHASE=Q.prototype.CAPTURING_PHASE;Q.prototype.AT_TARGET=2;Q.prototype.AT_TARGET=Q.prototype.AT_TARGET;Q.prototype.BUBBLING_PHASE=3;Q.prototype.BUBBLING_PHASE=Q.prototype.BUBBLING_PHASE;Q.prototype.eventPhase=0;Q.prototype.eventPhase=Q.prototype.eventPhase;function S(){M.call(this);this.D=new Jc(this);this.hc=this;this.wb=null}Fa(S,M);S.prototype[Fc]=!0;l=S.prototype;l.M=function(){return this.wb};l.Sa=function(a){this.wb=a};l.addEventListener=function(a,b,c,d){Pc(this,a,b,c,d)};l.removeEventListener=function(a,b,c,d){Xc(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 Q(a,c);else if(a instanceof Q)a.target=a.target||c;else{var e=a;a=new Q(d,c);Ma(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(){S.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&&Lc(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",S);S.prototype.Sa=S.prototype.Sa;S.prototype.setParentEventTarget=S.prototype.Sa;S.prototype.M=S.prototype.M;S.prototype.getParentEventTarget=S.prototype.M;S.prototype.addEventListener=S.prototype.addEventListener;S.prototype.addEventListener=S.prototype.addEventListener;S.prototype.removeEventListener=S.prototype.removeEventListener;S.prototype.removeEventListener=S.prototype.removeEventListener;S.prototype.dispatchEvent=S.prototype.dispatchEvent;\nS.prototype.dispatchEvent=S.prototype.dispatchEvent;S.prototype.C=S.prototype.C;S.prototype.dispose=S.prototype.C;S.prototype.aa=S.prototype.aa;
2S.prototype.addOnDisposeCallback=S.prototype.aa;S.prototype.yc=S.prototype.da;\nS.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=S.prototype.yc.apply(this,arguments),d&&this.M&&null===this.M()&&delete c.eventPhase;return f};S.prototype.qd=function(a){for(var b,c=this;c&&(b=c.M())&&b!==a;)c=b;b||c.Sa(a)};S.prototype.setRootParentEventTarget=S.prototype.qd;function T(a){a=a||{};var b=a.callback;this.rb=a.label;Ua(b)&&(this.callback=b);this.cb=!!a.disabled;T.Z.constructor.call(this)}Fa(T,S);r("H.util.ContextItem",T);T.prototype.Hc=function(){return this.rb};T.prototype.getLabel=T.prototype.Hc;T.prototype.pd=function(a){this.rb!==a&&(this.rb=a,this.dispatchEvent("update"));return this};T.prototype.setLabel=T.prototype.pd;T.prototype.Xc=function(){return this.cb};T.prototype.isDisabled=T.prototype.Xc;\nT.prototype.od=function(a){a!==this.cb&&(this.cb=a,this.dispatchEvent("update"));return this};T.prototype.setDisabled=T.prototype.od;var $c=new T;T.SEPARATOR=$c;function ad(a,b){this.$c=100;this.rc=a;this.md=b;this.Qa=0;this.Ma=null}ad.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};ad.prototype.put=function(a){this.md(a);this.Qa<this.$c&&(this.Qa++,a.next=this.Ma,this.Ma=a)};function bd(a){p.setTimeout(function(){throw a;},0)};function cd(){var a=document;var b="IFRAME";"application/xhtml+xml"===a.contentType&&(b=b.toLowerCase());return a.createElement(b)};var dd;\nfunction ed(){var a=p.MessageChannel;"undefined"===typeof a&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&!wc(O,"Presto")&&(a=function(){var e=cd();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 fd(){this.Ya=this.ja=null}fd.prototype.add=function(a,b){var c=gd.get();c.set(a,b);this.Ya?this.Ya.next=c:this.ja=c;this.Ya=c};fd.prototype.remove=function(){var a=null;this.ja&&(a=this.ja,this.ja=this.ja.next,this.ja||(this.Ya=null),a.next=null);return a};var gd=new ad(function(){return new hd},function(a){return a.reset()});function hd(){this.next=this.scope=this.hb=null}hd.prototype.set=function(a,b){this.hb=a;this.scope=b;this.next=null};\nhd.prototype.reset=function(){this.next=this.scope=this.hb=null};function id(a,b){jd||kd();ld||(jd(),ld=!0);md.add(a,b)}var jd;function kd(){if(p.Promise&&p.Promise.resolve){var a=p.Promise.resolve(void 0);jd=function(){a.then(nd)}}else jd=function(){var b=nd;"function"!==typeof p.setImmediate||p.Window&&p.Window.prototype&&!wc(O,"Edge")&&p.Window.prototype.setImmediate==p.setImmediate?(dd||(dd=ed()),dd(b)):p.setImmediate(b)}}var ld=!1,md=new fd;function nd(){for(var a;a=md.remove();){try{a.hb.call(a.scope)}catch(b){bd(b)}gd.put(a)}ld=!1};function od(a){this.u=pd;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){qd(b,rd,c)},function(c){qd(b,sd,c)})}catch(c){qd(this,sd,c)}}var pd=0,rd=2,sd=3;function td(){this.next=this.context=this.ha=this.ua=this.R=null;this.Fa=!1}td.prototype.reset=function(){this.context=this.ha=this.ua=this.R=null;this.Fa=!1};var ud=new ad(function(){return new td},function(a){a.reset()});\nfunction vd(a,b,c){var d=ud.get();d.ua=a;d.ha=b;d.context=c;return d}function wd(a,b,c){xd(a,b,c,null)||id(Da(b,a))}function yd(a){return new od(function(b,c){var d=a.length,e=[];
2if(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],wd(k,Da(f,h),g);else b(e)})}function zd(){var a,b,c=new od(function(d,e){a=d;b=e});return new Ad(c,a,b)}od.prototype.then=function(a,b,c){return Bd(this,"function"===typeof a?a:null,"function"===typeof b?b:null,c)};\nod.prototype.$goog_Thenable=!0;od.prototype.cancel=function(a){if(this.u==pd){var b=new Cd(a);id(function(){Dd(this,b)},this)}};function Dd(a,b){if(a.u==pd)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==pd&&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,sd,b)))}a.W=null}else qd(a,sd,b)}function Gd(a,b){a.I||a.u!=rd&&a.u!=sd||Hd(a);a.ba?a.ba.next=b:a.I=b;a.ba=b}\nfunction Bd(a,b,c,d){var e=vd(null,null,null);e.R=new od(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}
2od.prototype.td=function(a){this.u=pd;qd(this,rd,a)};od.prototype.ud=function(a){this.u=pd;qd(this,sd,a)};\nfunction qd(a,b,c){a.u==pd&&(a===c&&(b=sd,c=new TypeError("Promise cannot resolve to itself")),a.u=1,xd(c,a.td,a.ud,a)||(a.Zb=c,a.u=b,a.W=null,Hd(a),b!=sd||c instanceof Cd||Id(a,c)))}function xd(a,b,c,d){if(a instanceof od)return Gd(a,vd(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,id(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}od.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==sd&&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)}ud.put(b)}function Kd(a,b,c){b==rd?a.ua.call(a.context,c):a.ha&&a.ha.call(a.context,c)}function Id(a,b){a.Ka=!0;id(function(){a.Ka&&Ld.call(null,b)})}var Ld=bd;function Cd(a){Ga.call(this,a)}Fa(Cd,Ga);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;function Nd(a,b,c){this.type=a;this.data=b;this.O=zd();this.resolve=Na(this.resolve,this);this.reject=Na(this.reject,this);this.priority=Od;c!==t&&(this.priority=c);this.Gc().add(this)}var Od=1,Pd={zd:0,Ad:Od,yd:2};l=Nd.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)};\nNd.prototype.cancel=Nd.prototype.cancel;function Qd(a){var b;this.Y={};for(b in Pd)this.Y[Pd[b]]=[];this.Ba=a;this.Ba.addEventListener("allocatable",Na(this.Lb,this))}r("H.util.JobManager",Qd);var Rd=Object.keys(Pd).map(function(a){return Pd[a]}).sort().reverse();Qd.prototype.add=function(a){Ta(a,Nd,this.add,0);this.Y[a.priority].push(a);this.Lb()};Qd.prototype.contains=function(a){return-1<this.Y[a.priority].indexOf(a)};\nQd.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};Qd.prototype.Lb=function(){Rd.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 Sd(a,b,c){Sd.Z.constructor.call(this,a,c);this.data=b}Fa(Sd,Q);r("H.util.DataEvent",Sd);function Td(a,b,c){Td.Z.constructor.call(this,a,c);this.message=b}Fa(Td,Q);r("H.util.ErrorEvent",Td);function Ud(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,Ud.prototype);return d}Fa(Ud,Error);r("H.lang.OutOfRangeError",Ud);Ud.prototype.name="OutOfRangeError";function Vd(a){if(globalThis.document){var b=document.createElement("canvas");b.width=b.height=1;b.getContext("2d",{willReadFrequently: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 Xd(){this.v=0}\nXd.prototype.next=function(a){if(9007199254740992===this.v)throw new Ud(a,this.v,[0,9007199254740991]);return this.v++};var Yd=new Xd;Na(Yd.next,Yd);var Zd=Pa([]);Pa({});Vd(!0);Vd(!1);function U(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",U);l=U.prototype;l.ub=t;l.P=t;l.ca=t;l.ab=t;l.nb=function(){return this.ub};U.prototype.getMeta=U.prototype.nb;U.prototype.ob=function(){return this.P?this.P.length:0};U.prototype.getRowCount=U.prototype.ob;U.prototype.Ja=function(a){var b=this.P;return b&&b[a]?new rc(this,a):t};\nU.prototype.getRow=U.prototype.Ja;U.prototype.L=function(){return this.ca||Zd};U.prototype.getColumnNames=U.prototype.L;U.prototype.lb=function(a){return this.ab[a]?new tc(this,a):t};U.prototype.getColumn=U.prototype.lb;U.prototype.o=function(a,b){var c=this.P;return(a=c&&this.ab[b]&&c[a])&&a[b]};U.prototype.getCell=U.prototype.o;\nU.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 U))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 U(e,this.ca,this.ub)};U.prototype.concat=U.prototype.concat;function $d(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=ae(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",$d);\nfunction ae(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 be(a,b,c){a=ce(a,!0);b=ce(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 de(b.x,b.y,null,ee(b));a.ma=new de(a.x,a.y,null,ee(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=fe(g.next);var m=fe(d.next);if(e=ge(g,k,d,m,f)){e=f.ic;var n=f.jc;var q=f.wd;var u=f.xd;e=new de(q,u,null,null,null,null,!0,0,0,e);he(e,g,k);k=new de(q,u,null,null,null,null,!0,0,0,n);he(k,d,m);e.vb=k;\nk.vb=e}}f=Yb(b,ie(a));c&&(f=!f);for(g=b;g;g=g.next)g.F&&(g.qb=f,f=!f);f=Yb(a,ie(b));h&&(f=!f);for(d=a;d.next;d=d.next)d.F&&(d.qb=f,f=!f);je(b);for(je(a);(a=ke(b))!=b;){for(c=null;!a.Wa;a=a.vb){for(f=a.qb;;){c=new de(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",be);\nfunction de(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 fe(a){for(;a&&a.F;)a=a.next;return a}function ee(a){if(a)for(;a.next;)a=a.next;return a}function ke(a){var b=a;if(b){do b=b.next;while(b!=a&&(!b.F||b.F&&b.Wa))}return b}function je(a){var b=ee(a);b.B.next=a;a.B=b.B}\nfunction ge(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),ge(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 ie(a){for(var b=[];a;)b.push(a.x,a.y),a=a.next;return b}\nfunction he(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 ce(a,b){for(var c,d=null,e=0,f=a.length;e<f;e++){c=new de(a[e].x,a[e].y,d);c.Rb=b;if(c.next=d)d.B=c;d=c}return d};function le(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 me=1/Math.pow(10,10);function ne(a,b){var c=[],d=a.Nb();a=a.Mb();var e;180==a.lng&&(a.lng-=me);d=le(d,b);a=le(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 oe(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]);pe.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 pe=/^-?0\\d/;\nfunction qe(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 X(){}r("H.util.ICache",X);X.prototype.add=function(){};X.prototype.add=X.prototype.add;X.prototype.get=function(){};X.prototype.get=X.prototype.get;X.prototype.fb=function(){};X.prototype.drop=X.prototype.fb;X.prototype.forEach=function(){};X.prototype.forEach=X.prototype.forEach;X.prototype.ia=function(){};X.prototype.removeAll=X.prototype.ia;X.prototype.ya=function(){};X.prototype.registerOnDrop=X.prototype.ya;X.prototype.bb=function(){};X.prototype.deRegisterOnDrop=X.prototype.bb;function Y(a,b,c){this.ta=[];b&&this.ya(b);if(c&&!Ua(c))throw new x(Y,2,c);this.J=0;this.filter=c;this.s={};this.qa=this.ea=null;this.zb(a)}r("H.util.Cache",Y);Y.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&&re
2(this,d),this.J+=c-d.size,d.size=c,d.data=b,se(this,d)):this.s[a]=te(this,{id:a,data:b,size:c,v:null,N:null},this.ea),ue(this);return e};Y.prototype.add=Y.prototype.add;\nY.prototype.ya=function(a){if(!Ua(a))throw new x(this.ya,0,a);this.ta.push(a)};Y.prototype.registerOnDrop=Y.prototype.ya;Y.prototype.bb=function(a){this.ta=this.ta.filter(function(b){return b!==a})};Y.prototype.deRegisterOnDrop=Y.prototype.bb;Y.prototype.get=function(a,b){return(a=b?this.s[a]:se(this,this.s[a]))&&a.data};Y.prototype.get=Y.prototype.get;Y.prototype.fb=function(a){var b;(b=this.s[a])&&ve(this,b,!0)};Y.prototype.drop=Y.prototype.fb;\nY.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)}};Y.prototype.forEach=Y.prototype.forEach;Y.prototype.ia=function(a){var b;for(b in this.s){var c=this.s[b];(a?a(b,c.data,c.size):1)&&ve(this,this.s[b],!0)}};Y.prototype.removeAll=Y.prototype.ia;Y.prototype.zb=function(a){if(!(0<+a))throw new x(Y.prototype.zb,0,a);this.Tb=+a;ue(this);return this};Y.prototype.setMaxSize=Y.prototype.zb;Y.prototype.Jc=function(){return this.Tb};\nY.prototype.getMaxSize=Y.prototype.Jc;Y.prototype.Ec=function(){return this.J};Y.prototype.getCurrentSize=Y.prototype.Ec;function se(a,b){b&&(a.ea=te(a,b,a.ea));return b}function ue(a){for(;a.J>a.Tb&&a.qa;)ve(a,a.qa,!0)}function te(a,b,c){if(c!==b){(b.v||b.N)&&ve(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 ve(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],re(a,b));b.v=b.N=null}\nfunction re(a,b){for(var c=a.ta.length;c--;)a.ta[c].call(a,b.id,b.data,b.size)};function we(a,b,c,d){this.key="";this.x=a;this.y=b;this.Sb=c;this.ra=d;this.O=zd()}we.prototype.then=function(a,b,c){return this.O.promise.then(a,b,c)};we.prototype.resolve=function(a){this.O.resolve(a)};we.prototype.reject=function(a){this.O.reject(a)};we.prototype.cancel=function(){this.O.promise.cancel()};we.prototype.cancel=we.prototype.cancel;function E(a,b,c,d){xe(this,$b(a,E,0),ac(b,E,1),$b(c,E,2),ac(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 xe(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,ye(this.g,this.U())));return this.$a};E.prototype.getCenter=E.prototype.T;E.prototype.U=function(){return ze(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=$b(a,this.Ha,0),b=ac(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||cc(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=$b(a)))throw new x(this.V,0,a);if(Ya(b=ac(b)))throw new x(this.V,1,b);}return Ae(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||cc(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 Ae(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=$b(a,this.sa,0),b=ac(b,this.sa,1),c=$b(c,this.sa,2),d=ac(d,this.sa,3));return Ae(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 ze(a,b){a=b-a;return a+(0>a?360:0)}function ye(a,b){a+=b/2;return a-(180<a?360:0)}\nfunction Ae(a,b,c,d,e,f,g,h,k){c=vb(c,g);a=wb(a,e);e=ze(b,d);var m=ye(b,e);g=ze(f,h);var n=ye(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?xe(k,a,m,c,q):new E(a,m,c,q)}E.merge=Ae;function Be(a,b,c){c||(cc(a,Be,0),cc(b,Be,1));return new E(a.lat,a.lng,b.lat,b.lng)}E.fromPoints=Be;\nfunction Ce(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(Ce,0,a);if(0<d)for(f=a[0],e=Be(f,f,b);c<d;c++)f=a[c],e.V(f.lat,f.lng,b,e);return e}E.coverPoints=Ce;function De(a,b){var c=3,d=a.length,e;if(!(b||a&&null!=a.length))throw new x(De,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=De;\nfunction Ee(a,b){var c=1,d=a.length,e;if(b&&(!a||null==a.length))throw new x(Ee,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=Ee;\nE.prototype.Yb=function(a,b){var c=this.g,d=this.l,e=this.i,f=this.j,g=this.T().lng;cc(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?xe(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]};r("H.util.Disposable",M);M.prototype.aa=M.prototype.aa;M.prototype.addOnDisposeCallback=M.prototype.aa;
2r("H.util.dispose",function(a){a&&"function"==typeof a.C&&a.C()});M.prototype.C=M.prototype.C;M.prototype.dispose=M.prototype.C;M.prototype.K=M.prototype.K;M.prototype.disposeInternal=M.prototype.K;function Fe(a,b,c,d){if(!a||!b||!c)throw new x(Fe,t,"Must specify name, version and revision parameter");this.name=a;this.version=b;this.revision=c;d&&Ma(this,d)}r("H.util.BuildInfo",Fe);Fe.prototype.toString=function(){var a,b=[];for(a in this)Xa(this[a])&&b.push(this[a]);return b.join(";")};var Ge={};function He(a,b,c,d){if(!a)throw new x(He,1,"Must specify a name parameter");return Ge[a]||(Ge[a]=new Fe(a,b,c,d))}Fe.get=He;function Z(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(Z,t,\'Parameters "scheme" and "host" must be specified\');}r("H.service.Url",Z);\nfunction Ie(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=Z;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):"")}Z.parse=Ie;Z.prototype.clone=function(){var a={},b;for(b in this.A)a[b]=this.A[b];return new Z(this.yb,this.Na,this.X,a,this.wa,this.la)};Z.prototype.clone=Z.prototype.clone;\nZ.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};Z.prototype.setScheme=Z.prototype.Cb;Z.prototype.Oc=function(){return this.yb};Z.prototype.getScheme=Z.prototype.Oc;Z.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};\nZ.prototype.setHost=Z.prototype.Ra;Z.prototype.Fc=function(){return this.Na};Z.prototype.getHost=Z.prototype.Fc;Z.prototype.Ab=function(a){this.X=a||void 0;return this};Z.prototype.setPath=Z.prototype.Ab;Z.prototype.Lc=function(){return this.X};Z.prototype.getPath=Z.prototype.Lc;Z.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};Z.prototype.setQuery=Z.prototype.Ta;Z.prototype.Sc=function(){return!Je(this)};\nZ.prototype.hasQuery=Z.prototype.Sc;Z.prototype.getQuery=function(){return this.A};Z.prototype.getQuery=Z.prototype.getQuery;Z.prototype.Bb=function(a){if(void 0===a)this.wa=a;else{var b=Ub(+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};Z.prototype.setPort=Z.prototype.Bb;Z.prototype.Mc=function(){return this.wa};Z.prototype.getPort=Z.prototype.Mc;Z.prototype.ac=function(a){this.la=a||void 0;return this};\nZ.prototype.setAnchor=Z.prototype.ac;Z.prototype.Bc=function(){return this.la};Z.prototype.getAnchor=Z.prototype.Bc;Z.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};Z.prototype.mergeQuery=Z.prototype.ga;\nZ.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)};Z.prototype.addSubDomain=Z.prototype.Gb;Z.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)};Z.prototype.addSubPath=Z.prototype.Hb;\nZ.prototype.toString=function(){return[this.yb+"://",this.Na,this.wa?":"+this.wa:"",this.X||!Je(this)||this.la?"/":"",this.X?encodeURI(this.X):"",Ke(this),this.la?"#"+encodeURIComponent(this.la):""].join("")};Z.prototype.toString=Z.prototype.toString;function Le(a){return encodeURIComponent(a).replace(/[!\'()*]/g,function(b){return"%"+b.charCodeAt(0).toString(16)})}\nfunction Ke(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.$=Le(e);
2Ta(f,Me)?f.Va.forEach(function(g){return function(h){b.push(g.$+"="+Le(h))}}(d)):Ta(f,Ne)?b.push(d.$+"="+f.Va.map(function(g){return Le(g)}).join(f.tc)):b.push(void 0===f?d.$:d.$+"="+Le(f))}d={$:d.$}}return 0<b.length?"?"+b.join("&"):""}function Je(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 Oe(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 Me(a){this.Va=Oe(a,Me)}Z.MultiValueQueryParameter=Me;Me.prototype.Qc=function(){return this.Va};Me.prototype.getValues=Me.prototype.Qc;function Ne(a,b){this.Va=Oe(a,Ne);if(!/^[!\\$\\(\\)\\*\\+,;]$/.test(b))throw new x(Ne,1,\'Invalid delimiter "\'+b+\'"\');this.tc=b}\nZ.DelimitedQuerySubValues=Ne;function Pe(a,b){var c=a.tileSize||256;this.va={};this.$b=Ie(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,M);\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=ne(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 we(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 yd(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 U(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=oe(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(oe(R[v],P[v],"",N))}if(this.Xb){J=w;v=W;P=J.$$projected$$;R=0;if(!P){var aa=J.geometry;N=qe(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=qe(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=Sb;var Za=V=t;v=N[0];if(1===v.length){var nc=nc||(nc=Ye(g,b,h,e,!1));w=v[0];Xb(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=$d([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=be(a,b)){do{a=[];b=c;do a.push(b);while(b=b.next);d.push(a)}while(c=c.Vb)}else Yb(b[0],Zb(a))?d.push(b):Yb(a[0],Zb(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];
2if(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=vb(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=Ka(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=Ja[a];var g=function(h){e.postError(h.toString())};if(0===b)f||(Ja[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 Ja[a];Ia()&&cf.ia();break;default:e.postError("Unsupported command")}});\nvar cf=new Y(26214400),Ja=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',this.H=this.H||{},this.H.venues=function(t){function e(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}function r(t,e,i,r,n,o,s){try{var a=t[o](s),l=a.value}catch(t){return void i(t)}a.done?e(l):Promise.resolve(l).then(r,n)}function n(t){return function(){var e=this,i=arguments;return new Promise(function(n,o){var s=t.apply(e,i);function a(t){r(s,n,o,a,l,"next",t)}function l(t){r(s,n,o,a,l,"throw",t)}a(void 0)})}}function o(t,e,i){return e=p(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,m()?Reflect.construct(e,i||[],p(t).constructor):e.apply(t,i))}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e,i){if(m())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var n=new(t.bind.apply(t,r));return i&&v(n,i.prototype),n}function l(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,w(r.key),r)}}function c(t,e,i){return e&&l(t.prototype,e),i&&l(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function h(t,e,i){return(e=w(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function u(){return u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=p(t)););return t}(t,e);if(r){var n=Object.getOwnPropertyDescriptor(r,e);return n.get?n.get.call(arguments.length<3?t:i):n.value}},u.apply(null,arguments)}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function d(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}function m(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(m=function(){return!!t})()}function f(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,r)}return i}function g(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};
vendor: 4,789 bytes, line 2
2e%2?f(Object(i),!0).forEach(function(e){h(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):f(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function y(){y=function(){return e};var t,e={},i=Object.prototype,r=i.hasOwnProperty,n=Object.defineProperty||function(t,e,i){t[e]=i.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,i){return t[e]=i}}function h(t,e,i,r){var o=e&&e.prototype instanceof v?e:v,s=Object.create(o.prototype),a=new R(r||[]);return n(s,"_invoke",{value:A(t,i,a)}),s}function u(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var p="suspendedStart",d="suspendedYield",m="executing",f="completed",g={};function v(){}function _(){}function b(){}var x={};c(x,s,function(){return this});var w=Object.getPrototypeOf,S=w&&w(w(I([])));S&&S!==i&&r.call(S,s)&&(x=S);var T=b.prototype=v.prototype=Object.create(x);function E(t){["next","throw","return"].forEach(function(e){c(t,e,function(t){return this._invoke(e,t)})})}function M(t,e){function i(n,o,s,a){var l=u(t[n],t,o);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then(function(t){i("next",t,s,a)},function(t){i("throw",t,s,a)}):e.resolve(h).then(function(t){c.value=t,s(c)},function(t){return i("throw",t,s,a)})}a(l.arg)}var o;n(this,"_invoke",{value:function(t,r){function n(){return new e(function(e,n){i(t,r,e,n)})}return o=o?o.then(n,n):n()}})}function A(e,i,r){var n=p;return function(o,s){if(n===m)throw Error("Generator is already running");if(n===f){if("throw"===o)throw s;return{value:t,done:!0}}for(r.method=o,r.arg=s;;){var a=r.delegate;if(a){var l=C(a,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===p)throw n=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=m;var c=u(e,i,r);if("normal"===c.type){if(n=r.done?f:d,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=f,r.method="throw",r.arg=c.arg)}}}function C(e,i){var r=i.method,n=e.iterator[r];if(n===t)return i.delegate=null,"throw"===r&&e.iterator.return&&(i.method="return",i.arg=t,C(e,i),"throw"===i.method)||"return"!==r&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=u(n,e.iterator,i.arg);if("throw"===o.type)return i.method="throw",i.arg=o.arg,i.delegate=null,g;var s=o.arg;return s?s.done?(i[e.resultName]=s.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=t),i.delegate=null,g):s:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,g)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function I(e){if(e||""===e){var i=e[s];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function i(){for(;++n<e.length;)if(r.call(e,n))return i.value=e[n],i.done=!1,i;return i.value=t,i.done=!0,i};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return _.prototype=b,n(T,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:_,configurable:!0}),_.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(T),t},e.awrap=function(t){return{__await:t}},E(M.prototype),c(M.prototype,a,function(){return this}),e.AsyncIterator=M,e.async=function(t,i,r,n,o){void 0===o&&(o=Promise);var s=new M(h(t,i,r,n),o);return e.isGeneratorFunction(i)?s:s.next().then(function(t){return t.done?t.value:s.next()})},E(T),c(T,l,"Generator"),c(T,s,function(){return this}),c(T,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),i=[];for(var r in e)i.push(r);return i.reverse(),function t(){for(;i.length;){var r=i.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=I,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEac
vendor: 4,267 bytes, line 2
2h(L),!e)for(var i in this)"t"===i.charAt(0)&&r.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function n(r,n){return a.type="throw",a.arg=e,i.next=r,n&&(i.method="next",i.arg=t),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var l=r.call(s,"catchLoc"),c=r.call(s,"finallyLoc");if(l&&c){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),L(i),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var r=i.completion;if("throw"===r.type){var n=r.arg;L(i)}return n}}throw Error("illegal catch attempt")},delegateYield:function(e,i,r){return this.delegate={iterator:I(e),resultName:i,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function v(t,e){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},v(t,e)}function _(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var r,n,o,s,a=[],l=!0,c=!1;try{if(o=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(r=o.call(i)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(t){c=!0,n=t}finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(c)throw n}}return a}}(t,e)||T(t,e)||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(t,e,i,r){var n=u(p(1&r?t.prototype:t),e,i);return 2&r&&"function"==typeof n?function(t){return n.apply(i,t)}:n}function x(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||T(t)||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 w(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}function S(t){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function T(t,e){if(t){if("string"==typeof t)return i(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}e(".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 E=function(){function t(e){var i;return s(this,t),(i=o(this,t)).id=e.id,i.model=e,i}
2return d(t,H.map.Feature),c(t,[{key:"getData",value:function(){return this.model}},{key:"getAddress",value:function(){return this.model.getInternalAddress()}},{key:"getCenter",value:function(){var t=_(this.model.getCenter(),2),e=t[0],i=t[1];return new H.geo.Point(i,e)}},{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()}}])}(),M=function(){function t(e){var i;return s(this,t),(i=o(this,t)).id=e.id,i.model=e,i}return d(t,H.map.Feature),c(t,[{key:"getData",value:function(){return this.model}},{key:"getBoundingBox",value:function(){return a(H.geo.Rect,x(this.model.getBoundingBox()))}},{key:"getCenter",value:function(){var t=_(this.model.getCenter(),2),e=t[0],i=t[1];return new H.geo.Point(i,e)}},{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(t){return this.getLevels().find(function(e){return e.getIdentifier()===t})}},{key:"getLevels",value:function(){var t=this.getData().getLevels().map(function(t){return t.getIdentifier()});return this.getVenue().getLevels().filter(function(e){return-1!==t.indexOf(e.id)})}},{key:"getMainLevel",value:function(){return this.getLevel(this.model.getMainLevel().getIdentifier())}},{key:"getVenue",value:function(){return this.getParentEventTarget()}}])}(),A=function(){function t(e){var i;return s(this,t),(i=o(this,t)).id=e.id,i.model=e,i}
vendor: 4,481 bytes, line 2
2return d(t,H.map.Feature),c(t,[{key:"getGeometry",value:function(t){return this.getGeometries().find(function(e){return e.getIdentifier()===t})}},{key:"getGeometries",value:function(){var t=this.getData().getGeometries().map(function(t){return t.getIdentifier()});return this.getDrawing().getVenue().getGeometries().filter(function(e){return-1!==t.indexOf(e.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 C(t,e,i,r){for(var n,o=r,s=i-e>>1,a=i-e,l=t[e],c=t[e+1],h=t[i],u=t[i+1],p=e+3;p<i;p+=3){var d=P(t[p],t[p+1],l,c,h,u);if(d>o)n=p,o=d;else if(d===o){var m=Math.abs(p-s);m<a&&(n=p,a=m)}}o>r&&(n-e>3&&C(t,e,n,r),t[n+2]=o,i-n>3&&C(t,n,i,r))}function P(t,e,i,r,n,o){var s=n-i,a=o-r;if(0!==s||0!==a){var l=((t-i)*s+(e-r)*a)/(s*s+a*a);l>1?(i=n,r=o):l>0&&(i+=s*l,r+=a*l)}return(s=t-i)*s+(a=e-r)*a}function L(t,e,i,r){var n={id:void 0===t?null:t,type:e,geometry:i,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,i=t.type;if("Point"===i||"MultiPoint"===i||"LineString"===i)R(t,e);else if("Polygon"===i||"MultiLineString"===i)for(var r=0;r<e.length;r++)R(t,e[r]);else if("MultiPolygon"===i)for(r=0;r<e.length;r++)for(var n=0;n<e[r].length;n++)R(t,e[r][n])}(n),n}function R(t,e){for(var i=0;i<e.length;i+=3)t.minX=Math.min(t.minX,e[i]),t.minY=Math.min(t.minY,e[i+1]),t.maxX=Math.max(t.maxX,e[i]),t.maxY=Math.max(t.maxY,e[i+1])}function I(t,e,i,r){if(e.geometry){var n=e.geometry.coordinates,o=e.geometry.type,s=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2),a=[],l=e.id;if(i.promoteId?l=e.properties[i.promoteId]:i.generateId&&(l=r||0),"Point"===o)O(n,a);else if("MultiPoint"===o)for(var c=0;c<n.length;c++)O(n[c],a);else if("LineString"===o)D(n,a,s,!1);else if("MultiLineString"===o){if(i.lineMetrics){for(c=0;c<n.length;c++)a=[],D(n[c],a,s,!1),t.push(L(l,"LineString",a,e.properties));return}k(n,a,s,!1)}else if("Polygon"===o)k(n,a,s,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(c=0;c<e.geometry.geometries.length;c++)I(t,{id:l,geometry:e.geometry.geometries[c],properties:e.properties},i,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(c=0;c<n.length;c++){var h=[];k(n[c],h,s,!0),a.push(h)}}t.push(L(l,o,a,e.properties))}}function O(t,e){e.push(N(t[0])),e.push(F(t[1])),e.push(0)}function D(t,e,i,r){for(var n,o,s=0,a=0;a<t.length;a++){var l=N(t[a][0]),c=F(t[a][1]);e.push(l),e.push(c),e.push(0),a>0&&(s+=r?(n*c-l*o)/2:Math.sqrt(Math.pow(l-n,2)+Math.pow(c-o,2))),n=l,o=c}var h=e.length-3;e[2]=1,C(e,0,h,i),e[h+2]=1,e.size=Math.abs(s),e.start=0,e.end=e.size}function k(t,e,i,r){for(var n=0;n<t.length;n++){var o=[];D(t[n],o,i,r),e.push(o)}}function N(t){return t/360+.5}function F(t){var e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function U(t,e,i,r,n,o,s,a){if(r/=e,o>=(i/=e)&&s<r)return t;if(s<i||o>=r)return null;for(var l=[],c=0;c<t.length;c++){var h=t[c],u=h.geometry,p=h.type,d=0===n?h.minX:h.minY,m=0===n?h.maxX:h.maxY;if(d>=i&&m<r)l.push(h);else if(!(m<i||d>=r)){var f=[];if("Point"===p||"MultiPoint"===p)z(u,f,i,r,n);else if("LineString"===p)j(u,f,i,r,n,!1,a.lineMetrics);else if("MultiLineString"===p)V(u,f,i,r,n,!1);else if("Polygon"===p)V(u,f,i,r,n,!0);else if("MultiPolygon"===p)for(var g=0;g<u.length;g++){var y=[];V(u[g],y,i,r,n,!0),y.length&&f.push(y)}if(f.length){if(a.lineMetrics&&"LineString"===p){for(g=0;g<f.length;g++)l.push(L(h.id,p,f[g],h.tags));continue}"LineString"!==p&&"MultiLineString"!==p||(1===f.length?(p="LineString",f=f[0]):p="MultiLineString"),"Point"!==p&&"MultiPoint"!==p||(p=3===f.length?"Point":"MultiPoint"),l.push(L(h.id,p,f,h.tags))}}}return l.length?l:null}function z(t,e,i,r,n){for(var o=0;o<t.length;o+=3){var s=t[o+n];s>=i&&s<=r&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function j(t,e,i,r,n,o,s){for(var a,l,c=B(t),h=0===n?q:W,u=t.start,p=0;p<t.length-3;p+=3){var d=t[p],m=t[p+1],f=t[p+2],g=t[p+3],y=t[p+4],v=0===n?d:m,_=0===n?g
vendor: 4,842 bytes, line 2
2:y,b=!1;s&&(a=Math.sqrt(Math.pow(d-g,2)+Math.pow(m-y,2))),v<i?_>i&&(l=h(c,d,m,g,y,i),s&&(c.start=u+a*l)):v>r?_<r&&(l=h(c,d,m,g,y,r),s&&(c.start=u+a*l)):G(c,d,m,f),_<i&&v>=i&&(l=h(c,d,m,g,y,i),b=!0),_>r&&v<=r&&(l=h(c,d,m,g,y,r),b=!0),!o&&b&&(s&&(c.end=u+a*l),e.push(c),c=B(t)),s&&(u+=a)}var x=t.length-3;d=t[x],m=t[x+1],f=t[x+2],(v=0===n?d:m)>=i&&v<=r&&G(c,d,m,f),x=c.length-3,o&&x>=3&&(c[x]!==c[0]||c[x+1]!==c[1])&&G(c,c[0],c[1],c[2]),c.length&&e.push(c)}function B(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function V(t,e,i,r,n,o){for(var s=0;s<t.length;s++)j(t[s],e,i,r,n,o,!1)}function G(t,e,i,r){t.push(e),t.push(i),t.push(r)}function q(t,e,i,r,n,o){var s=(o-e)/(r-e);return t.push(o),t.push(i+(n-i)*s),t.push(1),s}function W(t,e,i,r,n,o){var s=(o-i)/(n-i);return t.push(e+(r-e)*s),t.push(o),t.push(1),s}function X(t,e){for(var i=[],r=0;r<t.length;r++){var n,o=t[r],s=o.type;if("Point"===s||"MultiPoint"===s||"LineString"===s)n=Y(o.geometry,e);else if("MultiLineString"===s||"Polygon"===s){n=[];for(var a=0;a<o.geometry.length;a++)n.push(Y(o.geometry[a],e))}else if("MultiPolygon"===s)for(n=[],a=0;a<o.geometry.length;a++){for(var l=[],c=0;c<o.geometry[a].length;c++)l.push(Y(o.geometry[a][c],e));n.push(l)}i.push(L(o.id,s,n,o.tags))}return i}function Y(t,e){var i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);for(var r=0;r<t.length;r+=3)i.push(t[r]+e,t[r+1],t[r+2]);return i}function K(t,e){if(t.transformed)return t;var i,r,n,o=1<<t.z,s=t.x,a=t.y;for(i=0;i<t.features.length;i++){var l=t.features[i],c=l.geometry,h=l.type;if(l.geometry=[],1===h)for(r=0;r<c.length;r+=2)l.geometry.push(Z(c[r],c[r+1],e,o,s,a));else for(r=0;r<c.length;r++){var u=[];for(n=0;n<c[r].length;n+=2)u.push(Z(c[r][n],c[r][n+1],e,o,s,a));l.geometry.push(u)}}return t.transformed=!0,t}function Z(t,e,i,r,n,o){return[Math.round(i*(t*r-n)),Math.round(i*(e*r-o))]}function $(t,e,i,r,n){for(var o=e===n.maxZoom?0:n.tolerance/((1<<e)*n.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:i,y:r,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},a=0;a<t.length;a++){s.numFeatures++,J(s,t[a],o,n);var l=t[a].minX,c=t[a].minY,h=t[a].maxX,u=t[a].maxY;l<s.minX&&(s.minX=l),c<s.minY&&(s.minY=c),h>s.maxX&&(s.maxX=h),u>s.maxY&&(s.maxY=u)}return s}function J(t,e,i,r){var n=e.geometry,o=e.type,s=[];if("Point"===o||"MultiPoint"===o)for(var a=0;a<n.length;a+=3)s.push(n[a]),s.push(n[a+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)Q(s,n,t,i,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(a=0;a<n.length;a++)Q(s,n[a],t,i,"Polygon"===o,0===a);else if("MultiPolygon"===o)for(var l=0;l<n.length;l++){var c=n[l];for(a=0;a<c.length;a++)Q(s,c[a],t,i,!0,0===a)}if(s.length){var h=e.tags||null;if("LineString"===o&&r.lineMetrics){for(var u in h={},e.tags)h[u]=e.tags[u];h.mapbox_clip_start=n.start/n.size,h.mapbox_clip_end=n.end/n.size}var p={geometry:s,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:h};null!==e.id&&(p.id=e.id),t.features.push(p)}}function Q(t,e,i,r,n,o){var s=r*r;if(r>0&&e.size<(n?s:r))i.numPoints+=e.length/3;else{for(var a=[],l=0;l<e.length;l+=3)(0===r||e[l+2]>s)&&(i.numSimplified++,a.push(e[l]),a.push(e[l+1])),i.numPoints++;n&&function(t,e){for(var i=0,r=0,n=t.length,o=n-2;r<n;o=r,r+=2)i+=(t[r]-t[o])*(t[r+1]+t[o+1]);if(i>0===e)for(r=0,n=t.length;r<n/2;r+=2){var s=t[r],a=t[r+1];t[r]=t[n-2-r],t[r+1]=t[n-1-r],t[n-2-r]=s,t[n-1-r]=a}}(a,o),t.push(a)}}function tt(t,e){var i=(e=this.options=function(t,e){for(var i in e)t[i]=e[i];return t}(Object.create(this.options),e)).debug;if(i&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var r=function(t,e){var i=[];if("FeatureCollection"===t.type)for(var r=0;r<t.features.length;r++)I(i,t.features[r],e,r);else"Feature"===t.type?I(i,t,e):I(i,{geometry:t},e);return i}(t,e);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),r=function(t,e){var i=e.buffer/e.extent,r=t,n=U(t,1,-1-i,i,0,-1,2,e),o=U(t,1,1-i,2+i,0,-1,2,e);return(n||o)&&(r=U(t,1,-i,1+i,0,-1,2,e)||[],n&&(r=X(n,1).concat(r)),o&&(r=r.concat(X(o,-1)))),r}(r,e),r.length&&this.splitTile(r,0,0,0),i&&(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 et(t,e,i){return 32*((1<<t)*i+e)+t}tt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0}
2,tt.prototype.splitTile=function(t,e,i,r,n,o,s){for(var a=[t,e,i,r],l=this.options,c=l.debug;a.length;){r=a.pop(),i=a.pop(),e=a.pop(),t=a.pop();var h=1<<e,u=et(e,i,r),p=this.tiles[u];if(!p&&(c>1&&console.time("creation"),p=this.tiles[u]=$(t,e,i,r,l),this.tileCoords.push({z:e,x:i,y:r}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,i,r,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var d="z"+e;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(p.source=t,n){if(e===l.maxZoom||e===n)continue;var m=1<<n-e;if(i!==Math.floor(o/m)||r!==Math.floor(s/m))continue}else if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue;if(p.source=null,0!==t.length){c>1&&console.time("clipping");var f,g,y,v,_,b,x=.5*l.buffer/l.extent,w=.5-x,S=.5+x,T=1+x;f=g=y=v=null,_=U(t,h,i-x,i+S,0,p.minX,p.maxX,l),b=U(t,h,i+w,i+T,0,p.minX,p.maxX,l),t=null,_&&(f=U(_,h,r-x,r+S,1,p.minY,p.maxY,l),g=U(_,h,r+w,r+T,1,p.minY,p.maxY,l),_=null),b&&(y=U(b,h,r-x,r+S,1,p.minY,p.maxY,l),v=U(b,h,r+w,r+T,1,p.minY,p.maxY,l),b=null),c>1&&console.timeEnd("clipping"),a.push(f||[],e+1,2*i,2*r),a.push(g||[],e+1,2*i,2*r+1),a.push(y||[],e+1,2*i+1,2*r),a.push(v||[],e+1,2*i+1,2*r+1)}}},tt.prototype.getTile=function(t,e,i){var r=this.options,n=r.extent,o=r.debug;if(t<0||t>24)return null;var s=1<<t,a=et(t,e=(e%s+s)%s,i);if(this.tiles[a])return K(this.tiles[a],n);o>1&&console.log("drilling down to z%d-%d-%d",t,e,i);for(var l,c=t,h=e,u=i;!l&&c>0;)c--,h=Math.floor(h/2),u=Math.floor(u/2),l=this.tiles[et(c,h,u)];return l&&l.source?(o>1&&console.log("found parent tile z%d-%d-%d",c,h,u),o>1&&console.time("drilling down"),this.splitTile(l.source,c,h,u,t,e,i),o>1&&console.timeEnd("drilling down"),this.tiles[a]?K(this.tiles[a],n):null):null};var it="Point",rt="Polygon",nt="MultiLineString",ot="MultiPolygon",st="#e0e0e0",at="#829DB4",lt=1,ct={fillColor:"#F2F285",outlineColor:"#0088BF",outlineWidth:1.2},ht={FOOTPRINT:"FOOTPRINT",ICON:"ICON",TEXT:"TEXT",VECTOR:"VECTOR"},ut=Object.freeze({v1:1,v2:2}),pt=function(t){var e=function(t){for(var e=0,i=t.length,r=0;r<i-1;r+=1){var n=t[r],o=t[r+1];e+=n[0]*o[1]-o[0]*n[1]}return e+(t[i-1][0]*t[0][1]-t[0][0]*t[i-1][1])}(t);return e>0?"CW":e<0?"CCW":void 0},dt=function(t){for(var e,i=[],r=[],n=0,o=t.coordinates.length;n<o;n+=1){var s=t.coordinates[n],a=pt(s);null!==a&&(a===(e=e||a)&&r.length&&(i.push(r),r=[]),r.push(s))}return r.length>0&&i.push(r),1===i.length?(t.type=rt,t.coordinates=i[0]):i.length>1?(t.type=ot,t.coordinates=i):t=null,t},mt=function(t,e,i,r,n){var o,s,a,l,c,h,u=function(t,e,i,r,n){var o=1<<e,s=[];return s[0]=(t[0]/n+i)/o,s[1]=(t[1]/n+r)/o,{x:s[0],y:s[1]}}(t,e,i,r,n);return s=(o=u).x,a=o.y,l=360*(s-.5),c=Math.exp(Math.PI*(.5-a)/.25)-1,h=Math.exp(Math.PI*(.5-a)/.25)+1,[l,180*Math.asin(c/h)/Math.PI]};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==__webpack_require__.g?__webpack_require__.g:"undefined"!=typeof self&&self;var ft,gt,yt,vt=(ft=function(t,e){t.exports=function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==S(t)&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(r,n,function(e){return t[e]}.bind(null,n));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e,i){function r(t){return(r="function"==typeof Symbol&&"symbol"==S(Symbol.iterator)?function(t){return S(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":S(t)})(t)}var n=i(1),o=i(7),s=o.get,a=(o.deepValue,o.isArray),l=function(){function t(e,i){var r=i.location,n=void 0===r?0:r,o=i.distance,a=void 0===o?100:o,l=i.threshold,c=void 0===l?.6:l,h=i.maxPatternLength,u=void 0===h?32:h,p=i.caseSensitive,d=void 0!==p&&p,m=i.tokenSeparator,f=void 0===m?/ +/g:m,g=i.findAllMatches,y=void 0!==g&&g,v=i.minMatchCharLength,_=void 0===v?1:v,b=i.id,x=void 0===b?null:b,w=i.keys,S=void 0===w?[]:w,T=i.shouldSort,E=void 0===T||T,M=i.getFn,A=void 0===M?s:M,C=i.sortFn,P=void 0===C?function(t,e){return t.score-e.score}:C,L=i.tokenize,R=void 0!==L&&L,I=i.matchAllTokens,O=void 0!==I&&I,D=i.includeMatches,k=void 0!==D&&D,N=i.includeScore,F=void 0!==N&&N,U=i.verbose,z=void 0!==U&&U;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options={location:n,distance:a,threshold:c,maxPatternLength:u,isCaseSensitive:d,tokenSeparator:f,findAllMatches:y,minMatchCharLength:_,id:x,keys:S,includeMatches:k,includeScore:F,shouldSort:E,getFn:A,sortFn:P,verbose:z,tokenize:R,matchAllTokens:O},this.setCollection(e),this._processKeys(S)}var e;return(e=[{key:"setCollection",value:function(t){return this.list=t,t}},{key:"_processKeys",value:function(t){if(this._keyWeights={},this._keyNames=[],t.length&&"string"==typeof t[0])for(var e=0,i=t.length;e<i;e+=1){var r=t[e];this._keyWeights[r]=1,this._keyNames.push(r)}else{for(var n=null,o=null,s=0,a=0,l=t.length;a<l;a+=1){var c=t[a];if(!c.hasOwnProperty("name"))throw new Error('Missing "name" property in key object');var h=c.name;if(this._keyNames.push(h),!c.hasOwnProperty("weight"))throw new Error('Missing "weight" property in key object');var u=c.weight;if(u<0||u>1)throw new Error('"weight" property in key must bein the range of [0, 1)');o=null==o?u:Math.max(o,u),n=null==n?u:Math.min(n,u),this._keyWeights[h]=u,s+=u}if(s>1)throw new Error("Total of weights cannot exceed 1")}}},{key:"search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{limit:!1};this._log('---------\nSearch pattern: "'.concat(t,'"'));var i=this._prepareSearchers(t),r=i.tokenSearchers,n=i.fullSearcher,o=this._search(r,n);
2return this._computeScore(o),this.options.shouldSort&&this._sort(o),e.limit&&"number"==typeof e.limit&&(o=o.slice(0,e.limit)),this._format(o)}},{key:"_prepareSearchers",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=[];if(this.options.tokenize)for(var i=t.split(this.options.tokenSeparator),r=0,o=i.length;r<o;r+=1)e.push(new n(i[r],this.options));return{tokenSearchers:e,fullSearcher:new n(t,this.options)}}},{key:"_search",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,i=this.list,r={},n=[];if("string"==typeof i[0]){for(var o=0,s=i.length;o<s;o+=1)this._analyze({key:"",value:i[o],record:o,index:o},{resultMap:r,results:n,tokenSearchers:t,fullSearcher:e});return n}for(var a=0,l=i.length;a<l;a+=1)for(var c=i[a],h=0,u=this._keyNames.length;h<u;h+=1){var p=this._keyNames[h];this._analyze({key:p,value:this.options.getFn(c,p),record:c,index:a},{resultMap:r,results:n,tokenSearchers:t,fullSearcher:e})}return n}},{key:"_analyze",value:function(t,e){var i=this,r=t.key,n=t.arrayIndex,o=void 0===n?-1:n,s=t.value,l=t.record,c=t.index,h=e.tokenSearchers,u=void 0===h?[]:h,p=e.fullSearcher,d=e.resultMap,m=void 0===d?{}:d,f=e.results,g=void 0===f?[]:f;!function t(e,n,o,s){if(null!=n)if("string"==typeof n){var l=!1,c=-1,h=0;i._log("\nKey: ".concat(""===r?"--":r));var d=p.search(n);if(i._log('Full text: "'.concat(n,'", score: ').concat(d.score)),i.options.tokenize){for(var f=n.split(i.options.tokenSeparator),y=f.length,v=[],_=0,b=u.length;_<b;_+=1){var x=u[_];i._log('\nPattern: "'.concat(x.pattern,'"'));for(var w=!1,S=0;S<y;S+=1){var T=f[S],E=x.search(T),M={};E.isMatch?(M[T]=E.score,l=!0,w=!0,v.push(E.score)):(M[T]=1,i.options.matchAllTokens||v.push(1)),i._log('Token: "'.concat(T,'", score: ').concat(M[T]))}w&&(h+=1)}c=v[0];for(var A=v.length,C=1;C<A;C+=1)c+=v[C];c/=A,i._log("Token score average:",c)}var P=d.score;c>-1&&(P=(P+c)/2),i._log("Score average:",P);var L=!i.options.tokenize||!i.options.matchAllTokens||h>=u.length;if(i._log("\nCheck Matches: ".concat(L)),(l||d.isMatch)&&L){var R={key:r,arrayIndex:e,value:n,score:P};i.options.includeMatches&&(R.matchedIndices=d.matchedIndices);var I=m[s];I?I.output.push(R):(m[s]={item:o,output:[R]},g.push(m[s]))}}else if(a(n))for(var O=0,D=n.length;O<D;O+=1)t(O,n[O],o,s)}(o,s,l,c)}},{key:"_computeScore",value:function(t){this._log("\n\nComputing score:\n");for(var e=this._keyWeights,i=!!Object.keys(e).length,r=0,n=t.length;r<n;r+=1){for(var o=t[r],s=o.output,a=s.length,l=1,c=0;c<a;c+=1){var h=s[c],u=h.key,p=i?e[u]:1,d=0===h.score&&e&&e[u]>0?Number.EPSILON:h.score;l*=Math.pow(d,p)}o.score=l,this._log(o)}}},{key:"_sort",value:function(t){this._log("\n\nSorting...."),t.sort(this.options.sortFn)}},{key:"_format",value:function(t){var e=[];if(this.options.verbose){var i=[];this._log("\n\nOutput:\n\n",JSON.stringify(t,function(t,e){if("object"===r(e)&&null!==e){if(-1!==i.indexOf(e))return;i.push(e)}return e},2)),i=null}var n=[];this.options.includeMatches&&n.push(function(t,e){var i=t.output;e.matches=[];for(var r=0,n=i.length;r<n;r+=1){var o=i[r];if(0!==o.matchedIndices.length){var s={indices:o.matchedIndices,value:o.value};o.key&&(s.key=o.key),o.hasOwnProperty("arrayIndex")&&o.arrayIndex>-1&&(s.arrayIndex=o.arrayIndex),e.matches.push(s)}}}),this.options.includeScore&&n.push(function(t,e){e.score=t.score});for(var o=0,s=t.length;o<s;o+=1){var a=t[o];if(this.options.id&&(a.item=this.options.getFn(a.item,this.options.id)[0]),n.length){for(var l={item:a.item},c=0,h=n.length;c<h;c+=1)n[c](a,l);e.push(l)}else e.push(a.item)}return e}},{key:"_log",value:function(){var t;this.options.verbose&&(t=console).log.apply(t,arguments)}}])&&function(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(t.prototype,e),t}();t.exports=l},function(t,e,i){var r=i(2),n=i(3),o=i(6),s=function(){function t(e,i){var r=i.location,n=void 0===r?0:r,s=i.distance,a=void 0===s?100:s,l=i.threshold,c=void 0===l?.6:l,h=i.maxPatternLength,u=void 0===h?32:h,p=i.isCaseSensitive,d=void 0!==p&&p,m=i.tokenSeparator,f=void 0===m?/ +/g:m,g=i.findAllMatches,y=void 0!==g&&g,v=i.minMatchCharLength,_=void 0===v?1:v,b=i.includeMatches,x=void 0!==b&&b;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options={location:n,distance:a,threshold:c,maxPatternLength:u,isCaseSensitive:d,tokenSeparator:f,findAllMatches:y,includeMatches:x,minMatchCharLength:_},this.pattern=d?e:e.toLowerCase(),this.pattern.length<=u&&(this.patternAlphabet=o(this.pattern))}var e;return(e=[{key:"search",value:function(t){var e=this.options,i=e.isCaseSensitive,o=e.includeMatches;if(i||(t=t.toLowerCase()),this.pattern===t){var s={isMatch:!0,score:0};return o&&(s.matchedIndices=[[0,t.length-1]]),s}var a=this.options,l=a.maxPatternLength,c=a.tokenSeparator;if(this.pattern.length>l)return r(t,this.pattern,c);var h=this.options,u=h.location,p=h.distance,d=h.threshold,m=h.findAllMatches,f=h.minMatchCharLength;return n(t,this.pattern,this.patternAlphabet,{location:u,distance:p,threshold:d,findAllMatches:m,minMatchCharLength:f,includeMatches:o})}}])&&function(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(t.prototype,e),t}();t.exports=s},function(t,e){var i=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:/ +/g,n=new RegExp(e.replace(i,"\\$&").replace(r,"|")),o=t.match(n),s=!!o,a=[];if(s)for(var l=0,c=o.length;l<c;l+=1){var h=o[l];a.push([t.indexOf(h),h.length-1])}return{score:s?.5:1,isMatch:s,matchedIndices:a}}}
2,function(t,e,i){var r=i(4),n=i(5);t.exports=function(t,e,i,o){for(var s=o.location,a=void 0===s?0:s,l=o.distance,c=void 0===l?100:l,h=o.threshold,u=void 0===h?.6:h,p=o.findAllMatches,d=void 0!==p&&p,m=o.minMatchCharLength,f=void 0===m?1:m,g=o.includeMatches,y=void 0!==g&&g,v=a,_=t.length,b=u,x=t.indexOf(e,v),w=e.length,S=[],T=0;T<_;T+=1)S[T]=0;if(-1!==x){var E=r(e,{errors:0,currentLocation:x,expectedLocation:v,distance:c});if(b=Math.min(E,b),-1!==(x=t.lastIndexOf(e,v+w))){var M=r(e,{errors:0,currentLocation:x,expectedLocation:v,distance:c});b=Math.min(M,b)}}x=-1;for(var A=[],C=1,P=w+_,L=1<<(w<=31?w-1:30),R=0;R<w;R+=1){for(var I=0,O=P;I<O;)r(e,{errors:R,currentLocation:v+O,expectedLocation:v,distance:c})<=b?I=O:P=O,O=Math.floor((P-I)/2+I);P=O;var D=Math.max(1,v-O+1),k=d?_:Math.min(v+O,_)+w,N=Array(k+2);N[k+1]=(1<<R)-1;for(var F=k;F>=D;F-=1){var U=F-1,z=i[t.charAt(U)];if(z&&(S[U]=1),N[F]=(N[F+1]<<1|1)&z,0!==R&&(N[F]|=(A[F+1]|A[F])<<1|1|A[F+1]),N[F]&L&&(C=r(e,{errors:R,currentLocation:U,expectedLocation:v,distance:c}))<=b){if(b=C,(x=U)<=v)break;D=Math.max(1,2*v-x)}}if(r(e,{errors:R+1,currentLocation:v,expectedLocation:v,distance:c})>b)break;A=N}var j={isMatch:x>=0,score:0===C?.001:C};return y&&(j.matchedIndices=n(S,f)),j}},function(t,e){t.exports=function(t,e){var i=e.errors,r=void 0===i?0:i,n=e.currentLocation,o=void 0===n?0:n,s=e.expectedLocation,a=void 0===s?0:s,l=e.distance,c=void 0===l?100:l,h=r/t.length,u=Math.abs(a-o);return c?h+u/c:u?1:h}},function(t,e){t.exports=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=[],r=-1,n=-1,o=0,s=t.length;o<s;o+=1){var a=t[o];a&&-1===r?r=o:a||-1===r||((n=o-1)-r+1>=e&&i.push([r,n]),r=-1)}return t[o-1]&&o-r>=e&&i.push([r,o-1]),i}},function(t,e){t.exports=function(t){for(var e={},i=t.length,r=0;r<i;r+=1)e[t.charAt(r)]=0;for(var n=0;n<i;n+=1)e[t.charAt(n)]|=1<<i-n-1;return e}},function(t,e){var i=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)},r=function(t){return null==t?"":function(t){if("string"==typeof t)return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(t)},n=function(t){return"string"==typeof t},o=function(t){return"number"==typeof t};t.exports={get:function(t,e){var s=[];return function t(e,a){if(a){var l=a.indexOf("."),c=a,h=null;-1!==l&&(c=a.slice(0,l),h=a.slice(l+1));var u=e[c];if(null!=u)if(h||!n(u)&&!o(u))if(i(u))for(var p=0,d=u.length;p<d;p+=1)t(u[p],h);else h&&t(u,h);else s.push(r(u))}else s.push(e)}(t,e),s},isArray:i,isString:n,isNum:o,toString:r}}])},ft(gt={exports:{}}),gt.exports),_t=(yt=vt)&&yt.__esModule&&Object.prototype.hasOwnProperty.call(yt,"default")?yt.default:yt;vt.Fuse;var bt,xt=c(function t(e){var i=e.addressList,r=void 0===i?[]:i,n=e.geometries,o=void 0===n?[]:n,a=e.entity,l=void 0===a?null:a,c=e.name,h=void 0===c?"":c,u=e.icon,p=void 0===u?"":u;s(this,t),this.addressList=r,this.geometries=o,this.icon=p,this.entity=l,this.name=h}),wt={keys:[{name:"name",weight:.6},{name:"addressList",weight:.4}],threshold:.2},St=c(function t(e){s(this,t),this.fuseSearch=null,this.levels_=null,this.searchListEntities_=[],this.searchListIcons_=[],this.searchList_=[],this.venueModel=e,this.init()},[{key:"init",value:function(){var t=this.venueModel.getGeometries().reduce(function(t,e){var i=t;return i[e.getId()]=e,i},{});this.initEntityList(this.venueModel.getOccupant()),this.initIconList(t),this.levels_=this.venueModel.getLevels().map(function(t){return{levelId:t.getId(),levelName:t.getName(),drawingId:t.getDrawing().getId(),drawingName:t.getDrawing().getName()}});var e=[].concat(x(this.searchListEntities_),x(this.searchListIcons_));this.searchList_=e.sort(function(t,e){return t.name.localeCompare(e.name)}),this.fuseSearch_=new _t(this.searchList_,wt)}},{key:"initEntityList",value:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(function(t){return t.spaceIds?new xt({geometries:t.space,addressList:t.spaceIds||[],name:t.properties.name||"",entity:t}):null}).filter(function(t){return null!==t});this.searchListEntities_=t}},{key:"initIconList",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.searchListIcons_=Object.values(t).filter(function(t){return t.isIcon()}).map(function(t){var e=t.getIcon();return new xt({geometries:[t],icon:e,name:t.properties.name||""})})}},{key:"all",value:function(){return this.searchList_}},{key:"allIconTypes",value:function(){var t=this.searchListIcons_.reduce(function(t,e){var i=t;return i[e.name]=e.name,i},{});return Object.keys(t)}},{key:"find",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return""===t?this.searchList_:this.fuseSearch_.search(t)}}]),Tt=Object.freeze({SITE:"SITE",IMAGES:"IMAGES",THEME:"THEME"}),Et={SITE:"indoor.Site",STRUCTURE:"indoor.Structure",OCCUPANT:"indoor.Occupant",SPACE:"indoor.Space",SPACEGROUPS:"indo
2or.SpaceGroups",TOPOLOGY:"Topology",ADDRESS:"Address",LEVEL:"indoor.Level",LEVELCONNECTOR:"indoor.LevelConnector",ENTRANCE:"indoor.Entrance"},Mt="SPACE_TYPE_NAME",At="SPACE_CATEGORY_NAME",Ct="Point",Pt="LineString",Lt="Polygon",Rt="MultiPoint",It="MultiLineString",Ot="MultiPolygon",Dt=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"}),kt="9999999999999",Nt="https://interactive.data.api.platform.here.com/interactive/v1/catalogs",Ft=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(h(h(h(h({},Ft.THEME,"themeUrls"),Ft.THEME_MAP,"themeMapUrl"),Ft.PRESETS,"presetsUrl"),Ft.SDK_STRINGS,"stringsUrl")),Object.freeze(h(h(h(h(h({},Ft.THEME,"themeOverrides"),Ft.THEME_MAP,"themeMapOverrides"),Ft.PRESETS,"presetOverrides"),Ft.SDK_STRINGS,"stringsOverrides"),Ft.INPUT_COLORS,"inputColorOverrides")),Object.freeze(h(h(h(h(h(h({},Ft.THEME,["Modern","Standard","Factory","Navteq","TheBase","Westfield_noLabels","Westfield","TDM_noLabel"]),Ft.SDK_STRINGS,["Standard","SDK","sdk/standard"]),Ft.V4_THEME_FAMILY,["modern","standard"]),Ft.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"]),Ft.NAV_THEME,["Factory","MapEditor"]),Ft.ICON,["Multicolor","Standard","TheBase","Factory"])),Object.freeze((h(h(h(h(h(h(h(h(h(h(bt={},Ft.THEME,"Modern"),Ft.THEME_MAP,"Standard"),Ft.PRESETS,"Standard"),Ft.SDK_STRINGS,"Standard"),Ft.ICON_FILE,"Standard"),Ft.INPUT_COLORS,"Standard"),Ft.BASE_MAP_INFO,"Standard"),Ft.CONFIG_PROFILE,"factory"),Ft.NAV_THEME,"Factory"),Ft.NAV_NAME_THEME,"FactoryName"),h(h(h(h(h(h(h(h(bt,Ft.NAV_PROP_MAP,"Standard"),Ft.NAV_STRINGS,"Standard"),Ft.NAV_THEME_MAP,"Standard"),Ft.NAV_NAME_THEME_MAP,"StandardName"),Ft.V4_THEME_FAMILY,"Standard"),Ft.V4_MAPTYPE_THEME,"Standard"),Ft.ICON,"Multicolor"),Ft.MARKER,"Standard")));var Ut=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(h({},Ut.GEO_JSON,{COMMUNITY_MAP:"COMMUNITY_MAP",COMMUNITY_ENTITY:"COMMUNITY_ENTITY",PATH_LEVEL_GEOMETRY:"PATH_LEVEL_GEOMETRY",GEOJSON_LEVEL_GEOMETRY:"GEOJSON_LEVEL_GEOMETRY"}));var zt,jt=Object.freeze({ACCOUNT_API:"ACCOUNT_API",DEFAULT_COLLECTION:"DEFAULT_COLLECTION",CATALOG_LAYER:"CATALOG_LAYER"}),Bt=Object.freeze(h(h(h({},jt.ACCOUNT_API,{BASE_URL:"https://account.api.here.com/authorization/v1.1/projects/me"}),jt.DEFAULT_COLLECTION,{BASE_URL:"https://config.data.api.platform.here.com/config/v1/catalogs",PARAMS:{CREATED:"created",COLLECTION:"-collection",VERBOSE:"true"}}),jt.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"}}})),Vt=Object.freeze({isIconsEnabled:!0,isMetaEnabled:!0,metaOptions:{},iconOptions:{}}),Gt=Object.freeze({GET:"GET",POST:"POST",PUT:"PUT",DELETE:"DELETE",PATCH:"PATCH",OPTIONS:"OPTIONS",HEAD:"HEAD"}),Ht=Object.freeze({DEV:"dev",SIT:"sit",PRD:"prd"}),qt=Object.freeze(h(h(h({},Ht.DEV,"https://indoor-routing-dev.indoor.sit.api.here.com"),Ht.SIT,"https://indoor-routing-sit.indoor.sit.api.here.com"),Ht.PRD,"https://indoor-routing.indoor.api.here.com")),Wt="object"===("undefined"==typeof Reflect?"undefined":S(Reflect))?Reflect:null,Xt=Wt&&"function"==typeof Wt.apply?Wt.apply:function(t,e,
vendor: 4,228 bytes, line 2
2i){return Function.prototype.apply.call(t,e,i)};zt=Wt&&"function"==typeof Wt.ownKeys?Wt.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var Yt=Number.isNaN||function(t){return t!=t};function Kt(){Kt.init.call(this)}var Zt=Kt;Kt.EventEmitter=Kt,Kt.prototype._events=void 0,Kt.prototype._eventsCount=0,Kt.prototype._maxListeners=void 0;var $t=10;function Jt(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+S(t))}function Qt(t){return void 0===t._maxListeners?Kt.defaultMaxListeners:t._maxListeners}function te(t,e,i,r){var n,o,s,a;if(Jt(i),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),o=t._events),s=o[e]),void 0===s)s=o[e]=i,++t._eventsCount;else if("function"==typeof s?s=o[e]=r?[i,s]:[s,i]:r?s.unshift(i):s.push(i),(n=Qt(t))>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,a=l,console&&console.warn&&console.warn(a)}return t}function ee(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function ie(t,e,i){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},n=ee.bind(r);return n.listener=i,r.wrapFn=n,n}function re(t,e,i){var r=t._events;if(void 0===r)return[];var n=r[e];return void 0===n?[]:"function"==typeof n?i?[n.listener||n]:[n]:i?function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(n):oe(n,n.length)}function ne(t){var e=this._events;if(void 0!==e){var i=e[t];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function oe(t,e){for(var i=new Array(e),r=0;r<e;++r)i[r]=t[r];return i}function se(t,e,i,r){if("function"==typeof t.on)r.once?t.once(e,i):t.on(e,i);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+S(t));t.addEventListener(e,function n(o){r.once&&t.removeEventListener(e,n),i(o)})}}Object.defineProperty(Kt,"defaultMaxListeners",{enumerable:!0,get:function(){return $t},set:function(t){if("number"!=typeof t||t<0||Yt(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");$t=t}}),Kt.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Kt.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||Yt(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},Kt.prototype.getMaxListeners=function(){return Qt(this)},Kt.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var r="error"===t,n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=n[t];if(void 0===a)return!1;if("function"==typeof a)Xt(a,this,e);else{var l=a.length,c=oe(a,l);for(i=0;i<l;++i)Xt(c[i],this,e)}return!0},Kt.prototype.addListener=function(t,e){return te(this,t,e,!1)},Kt.prototype.on=Kt.prototype.addListener,Kt.prototype.prependListener=function(t,e){return te(this,t,e,!0)},Kt.prototype.once=function(t,e){return Jt(e),this.on(t,ie(this,t,e)),this},Kt.prototype.prependOnceListener=function(t,e){return Jt(e),this.prependListener(t,ie(this,t,e)),this},Kt.prototype.removeListener=function(t,e){var i,r,n,o,s;if(Jt(e),void 0===(r=this._events))return this;if(void 0===(i=r[t]))return this;if(i===e||i.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit
2("removeListener",t,i.listener||e));else if("function"!=typeof i){for(n=-1,o=i.length-1;o>=0;o--)if(i[o]===e||i[o].listener===e){s=i[o].listener,n=o;break}if(n<0)return this;0===n?i.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(i,n),1===i.length&&(r[t]=i[0]),void 0!==r.removeListener&&this.emit("removeListener",t,s||e)}return this},Kt.prototype.off=Kt.prototype.removeListener,Kt.prototype.removeAllListeners=function(t){var e,i,r;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[t]),this;if(0===arguments.length){var n,o=Object.keys(i);for(r=0;r<o.length;++r)"removeListener"!==(n=o[r])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},Kt.prototype.listeners=function(t){return re(this,t,!0)},Kt.prototype.rawListeners=function(t){return re(this,t,!1)},Kt.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):ne.call(t,e)},Kt.prototype.listenerCount=ne,Kt.prototype.eventNames=function(){return this._eventsCount>0?zt(this._events):[]},Zt.once=function(t,e){return new Promise(function(i,r){function n(i){t.removeListener(e,o),r(i)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),i([].slice.call(arguments))}se(t,e,o,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&se(t,"error",e,{once:!0})}(t,n)})};var ae="venues-ui-button--active",le="venues-ui-button",ce="venues-ui__drawings",he="data-drawing",ue=c(function t(e,i,r){var n=this;s(this,t),this.clickHandler=r,this.containerDiv=document.createElement("div"),this.containerDiv.setAttribute("class",ce);var o=document.createElement("div");o.setAttribute("class","trigger ".concat(le));var a=document.createElement("div");a.setAttribute("class","arrow arrow--down"),o.appendChild(a),o.addEventListener("click",function(){o.classList.toggle(ae),n.containerButtons.classList.toggle("drawings--open")}),this.containerDiv.appendChild(o),this.containerButtons=document.createElement("div"),this.containerButtons.setAttribute("class","drawings"),this.containerDiv.appendChild(this.containerButtons),i&&this.update(i),e.appendChild(this.containerDiv)},[{key:"drawButton",value:function(t,e,i){var r=this,n=document.createElement("div"),o=Number(i)===Number(t);n.setAttribute("class",o?"".concat(le," ").concat(ae):le),n.innerHTML=e,n.setAttribute(he,t),n.addEventListener("click",function(){r.switch(t),r.clickHandler(t)}),this.containerButtons.appendChild(n)}},{key:"switch",value:function(t){this.containerButtons.querySelectorAll(".".concat(ce," .").concat(ae)).forEac
2h(function(t){return t.setAttribute("class",le)});var e=this.containerButtons.querySelector("[".concat(he,"='").concat(t,"']"));e&&e.setAttribute("class","".concat(le," ").concat(ae))}},{key:"update",value:function(t){var e=this;this.containerButtons.innerHTML="";var i=function(t){var e=t.getDrawings();return new Map(e.map(function(t){var e=t.getDisplayName()||t.getName();return[t.getId(),e]}))}(t);i.size>0&&i.forEach(function(i,r){return e.drawButton(r,i,t.getRootDrawing().getId())})}}]),pe="venues-ui-button--active",de="venues-ui-button",me="data-level",fe="venues-ui__levels",ge=c(function t(e,i,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4;s(this,t),this.clickHandler=n,this.levelButtonCount=o,this.currentScrollIndex=0,this.containerUI=document.createElement("div"),this.containerUI.setAttribute("class","".concat(fe)),this.containerButtons=document.createElement("div"),this.containerButtons.setAttribute("class","levels"),this.containerUI.appendChild(this.containerButtons),i&&this.update(i,r),e.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(t,e){var i=this,r=document.createElement("div");r.innerHTML=e,r.style.fontSize="".concat(Math.max(Math.min(28.8/e.length,11.52),10),"px"),r.style.display="block",r.setAttribute("class",de),r.setAttribute(me,t),r.addEventListener("click",function(){i.switch(t),i.clickHandler(t)}),this.containerButtons.appendChild(r)}},{key:"drawScrollButtons",value:function(){var t=this;this.buttonScrollUp=document.createElement("div"),this.buttonScrollUp.setAttribute("class","".concat(de," ").concat(de,"--up"));var e=document.createElement("div");e.setAttribute("class","arrow arrow--up"),this.buttonScrollUp.appendChild(e),this.buttonScrollUp.addEventListener("click",function(){return t.scroll(1)}),this.containerUI.insertBefore(this.buttonScrollUp,this.containerButtons),this.buttonScrollDown=document.createElement("div"),this.buttonScrollDown.setAttribute("class","".concat(de," ").concat(de,"--down"));var i=document.createElement("div");i.setAttribute("class","arrow arrow--down"),this.buttonScrollDown.appendChild(i),this.buttonScrollDown.addEventListener("click",function(){return t.scroll(-1)}),this.containerUI.appendChild(this.buttonScrollDown)}},{key:"scroll",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=Array.from(this.containerButtons.querySelectorAll(".".concat(de))).reverse(),i=[];if(t>=0){this.currentScrollIndex=Math.min(this.currentScrollIndex+t,e.length-this.levelButtonCount);var r=Math.min(this.currentScrollIndex,e.length-this.levelButtonCount),n=Math.min(this.currentScrollIndex+this.levelButtonCount,e.length);i=e.slice(r,n)}else if(t<0){this.currentScrollIndex=Math.max(this.currentScrollIndex+t,0);var o=Math.max(0,this.currentScrollIndex),s=Math.min(e.length,this.currentScrollIndex+this.levelButtonCount);i=e.slice(o,s)}e.forEach(function(t){-1!==i.indexOf(t)?t.style.display="block":t.style.display="none"}),this.buttonScrollDown&&(0===this.currentScrollIndex?this.buttonScrollDown.setAttribute("disabled","disabled"):this.buttonScrollDown.removeAttribute("disabled")),this.buttonScrollUp&&(this.currentScrollIndex===e.length-this.levelButtonCount?this.buttonScrollUp.setAttribute("disabled","disabled"):this.buttonScrollUp.removeAttribute("disabled"))}},{key:"switch",value:function(t){this.containerButtons.querySelectorAll(".".concat(pe)).forEach(function(t){return t.setAttribute("class",de)});var e=this.containerButtons.querySelector(".".concat(fe," [").concat(me,"='").concat(t,"']"));if(e){var i=Array.from(this.containerButtons.querySelectorAll(".".concat(de))).reverse();e.setAttribute("class","".concat(de," ").concat(pe));var r=i.indexOf(e);(r<this.currentScrollIndex||r>=this.currentScrollIndex+4)&&this.scroll(r-this.currentScrollIndex)}}},{key:"update",value:function(t,e){var i=this,r=function(){return new Map((arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(function(t){return[t.getZIndex(),t.getShortName()||t.getDisplayName()||t.getName()]}))}(function(t,e){if(e===Dt.FLATTEN){var i=t.getVenueModel().getLevelMapFlattenedByZIndex_();return Object.values(i).map(function(t){return t[0]})}return t.getLevels()}(t,e).sort(function(t,e){return e.getZIndex()-t.getZIndex()})),n=t.getMainLevel().getZIndex();this.clear(),r.forEach(function(t,e){return i.drawLevelButton(e,t)}),r.size>this.levelButtonCount&&(r.size>this.levelButtonCount+1?this.currentScrollIndex=Math.min(Array.from(r).reverse().findIndex(function(t){return t[0]===n}),r.size-this.levelButtonCount):this.currentScrollIndex=0,this.drawScrollButtons(),this.scroll(0)),this.switch(n)}}]),ye=c(function t(e,i){s(this,t),this.baseTheme=e,this.metaInformation=i,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 t=0,e=Object.entries(this.baseTheme.spaceRules);t<e.length;t++){var i=_(e[t],2),r=i[0],n=i[1],o=n.properties.behavioralAppearance.default.styleProperties,s=n.properties.behavioralAppearance.default.textLabelStyleProperties;if(this.styleMap[r]=o,this.labelStyleMap[r]=s,n.spaceTypes)for(var a=0,l=Object.entries(n.spaceTypes);a<l.length;a++){var c=_(l[a],2),h=c[0],u=c[1],p=u.behavioralAppearance.default.styleProperties,d=u.behavioralAppearance.default.textLabelStyleProperties;this.styleMap["".concat(r,"_").concat(h)]=p&&0!==Object.keys(p)?p:o,this.labelStyleMap["".concat(r,"_").concat(h)]=d&&0!==Object.keys(d)?d:s}}}},{key:"getBaseTheme",value:function(){return this.baseTheme}},{key:"getStyleMap",value:function(){return this.styleMap}},{key:"getGeometryStyle",value:function(t){return this.styleMap&&Object.getOwnPropertyNames(this.styleMap)?this.styleMap[t]:null}},{key:"getLabelStyle",value:function(t){return this.labelStyleMap&&Object.getOwnPropertyNames(this.labelStyleMap)?this.labelStyleMap[t]: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}}}]),ve=c(function t(){s(this,t),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(t){var e,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.getTheme(),n=ye.getGeometryDefaultStyle(),o=t.properties.spaceType,s=t.properties.spaceCategory,a=s;return o&&(a="".concat(s,"_").concat(o)),(e=r.getGeometryStyle(a))&&!i||(e=n),{m:e.fill&&e.fill.toLowerCase()||"#fff",w:e.strokeWidth/10||.1,o:e.stroke&&e.stroke.toLowerCase()||"#fff",l:"Dark"}||void 0}},{key:"getLabelStyle",value:function(t){this.getTheme();var e=ye.getLabelDefaultStyle();return{fill:e.stroke,zmin:e.zmin}}}]),_e=Math.PI/180,be=180/Math.PI,xe=function(){function t(){s(this,t)}return c(t,null,[{key:"toRadians",value:function(t){return t*_e}},{key:"toDegrees",value:function(t){return t*be}},{key:"getBoundingBox",value:function(e,i){var r=[];switch(e){case Ct:r=[i,i];break;case Rt:case Pt:r=i;break;case It:case Lt:r=i.reduce(function(t,e){return t.concat(e)},[]);break;case Ot:r=i.reduce(function(t,e){return t.concat(e)},[]).reduce(function(t,e){return t.concat(e)},[])}return t.getBoundingBoxVertices(r)}},{key:"getInverseTransform",value:function(t){var e=t[0]*t[3]-t[1]*t[2],i=[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,0,0];return i[4]=-(i[0]*t[4]+i[2]*t[5]),i[5]=-(i[1]*t[4]+i[3]*t[5]),i}},{key:"applyTransformToPoint",value:function(t,e){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}},{key:"transformProduct",value:function(t,e){var i=[0,0,0,0,0,0];return i[0]=e[0]*t[0]+e[2]*t[1],i[1]=e[1]*t[0]+e[3]*t[1],i[2]=e[0]*t[2]+e[2]*t[3],i[3]=e[1]*t[2]+e[3]*t[3],i[4]=e[0]*t[4]+e[2]*t[5]+e[4],i[5]=e[1]*t[4]+e[3]*t[5]+e[5],i}},{key:"convertLonLatToMerc",value:function(t){var e=t[0]*_e,i=t[1]*_e,r=Math.sin(i);return[.5+e/(2*Math.PI),.5-Math.log((1+r)/(1-r))/(4*Math.PI)]}},{key:"convertMercToLatLon",value:function(t){var e=2*Math.PI*(t[0]-.5),i=Math.atan(Math.sinh(2*Math.PI*(.5-t[1])));return[e/_e,i/_e]}},{key:"getTransformScale",value:function(t){return Math.sqrt(t[0]*t[3]-t[1]*t[2])}},{key:"getLonLatToMercTransform",value:function(e){var i=[1/360,0,0,-1/(360*Math.cos(e[1]*_e)),0,0],r=t.applyTransformToPoint(i,e),n=t.convertLonLatToMerc(e);return i[4]=n[0]-r[0],i[5]=n[1]-r[1],i}},{key:"getNatToMercTransform",value:function(e){var i=[e[4],e[5]],r=t.getLonLatToMercTransform(i);return t.transformProduct(e,r)}},{key:"convertMxMy2LonLat",value:function(e,i){return e.length&&i.length?t.applyTransformToPoint(e,i):[]}},{key:"convertLonLat2MxMy",value:function(e,i){if(!e.length||!i.length)return[];var r=t.getInverseTransform(e);return t.applyTransformToPoint(r,i)}}
2,{key:"getFlattenedQuadraticBezierCurve",value:function(t,e,i){var r=[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;n<1&&(n=6);for(var o=0;o<=n;o+=1){var s=o/n,a=(1-s)*(1-s),l=2*s*(1-s),c=s*s,h=a*t[0]+l*e[0]+c*i[0],u=a*t[1]+l*e[1]+c*i[1];r.push([h,u])}return r}},{key:"getFlattenedCubicBezierCurve",value:function(t,e,i,r){var n=[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10;o<1&&(o=6);for(var s=0;s<=o;s+=1){var a=s/o,l=(1-a)*(1-a)*(1-a),c=3*a*(1-a)*(1-a),h=3*a*a*(1-a),u=a*a*a,p=l*t[0]+c*e[0]+h*i[0]+u*r[0],d=l*t[1]+c*e[1]+h*i[1]+u*r[1];n.push([p,d])}return n}},{key:"getRectangularCoordinatesOfLabelArea",value:function(e,i){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=_(e,6),o=n[0],s=n[1],a=n[2],l=n[3],c=n[5],h=t.getDeltaLonLatForMeterAtGivenLonLat(o,s),u=e[4];return r?(c&&(u*=-1),null!=i&&(u=(u+=i<0?2*Math.PI+i:i)<0?2*Math.PI+u:u)):u=0,t.getRectVerticesFromSignatureRectRepresentation([o,s],{xLength:a,yLength:l},u,h)}},{key:"getRotatedPoint",value:function(t,e){var i,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[0,0],o=Math.cos(e),s=Math.sin(e),a=t[0]-n[0],l=t[1]-n[1];return[(i=r?[a*o+l*s,l*o-a*s]:[a*o-l*s,l*o+a*s])[0]+n[0],i[1]+n[1]]}},{key:"getRectVerticesFromSignatureRectRepresentation",value:function(e,i,r,n){var o=i.xLength,s=i.yLength,a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],l=_(e,2),c=l[0],h=l[1],u=o/2,p=s/2,d=_(n,2),m=d[0],f=d[1];return[[1,1],[-1,1],[-1,-1],[1,-1]].map(function(t){return[t[0]*u,t[1]*p]}).map(function(e){return t.getRotatedPoint(e,r,a)}).map(function(t){return[t[0]*m,t[1]*f]}).map(function(t){return[t[0]+c,t[1]+h]})}},{key:"getScaleFactorForRectInSpace",value:function(t,e,i,r){var n=t/i,o=e/r;return n>o?o:n}},{key:"getDeltaLonLatForMeterAtGivenLonLat",value:function(t,e){var i=6371e3;return[1/i*(180/Math.PI)/Math.cos(e*Math.PI/180),1/i*(180/Math.PI)]}},{key:"getBoundingBoxVertices",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY]];return t.reduce(function(t,e){return[[Math.min(e[0],t[0][0]),Math.min(e[1],t[0][1])],[Math.max(e[0],t[1][0]),Math.max(e[1],t[1][1])]]},e)}},{key:"isPointInBoundingBox",value:function(t,e){if(t&&e){var i=_(t,2),r=i[0],n=i[1],o=_(e,2),s=_(o[0],2),a=s[0],l=s[1],c=_(o[1],2),h=c[0],u=c[1];return r<=h&&r>=a&&n<=u&&n>=l}}},{key:"isPointOnLineSegment",value:function(t,e,i){var r=_(t,2),n=r[0],o=r[1],s=_(e,2),a=s[0],l=s[1],c=_(i,2),h=c[0],u=c[1],p=(l-o)*(u-o)<=0;return a===h?a===n&&p:!(o-u!=(u-l)/(h-a)*(n-h)||!p)}},{key:"rayIntersectLineSegment",value:function(t,e,i){var r=_(t,2),n=r[0],o=r[1],s=_(e,2),a=s[0],l=s[1],c=_(i,2),h=c[0],u=c[1];if(a===h)return!1;var p=(n-a)/(h-a);return p>=0&&p<1&&(u-l)*p+l>o}},{key:"isPointInPolygon",value:function(e,i){var r=_(e,2),n=r[0],o=r[1],s=i.length;if(s<3)return!1;var a=0,l=i[s-1];return i.forEach(function(e){t.rayIntersectLineSegment([n,o],l,e)&&(a+=1),l=e}),a%2!=0}},{key:"isPointOnLineString",value:function(e,i){var r=_(e,2),n=r[0],o=r[1],s=i.length;if(s<2)return!1;for(var a=i[s-1],l=0;l<s;l+=1){var c=i[l];if(t.isPointOnLineSegment([n,o],a,c))return!0;a=i[l]}return!1}},{key:"getAreaOfPolygon",value:function(t){var e=t.length;if(e<3)return null;var i=0,r=t[e-1];return t.forEach(function(t){var e,n,o,s,a,l;i+=.5*(e=t,o=(n=_(r,2))[0],s=n[1],l=(a=_(e,2))[0],o*a[1]-s*l),r=t}),i}},{key:"getDistanceBetweenPoints",value:function(t,e){var i=_(t,2),r=i[0],n=i[1],o=_(e,2),s=r-o[0],a=n-o[1];return Math.sqrt(s*s+a*a)}}])}(),we=c(function t(){s(this,t),this.spaceRules={}},null,[{key:"getDataEntriesOne",value:function(t,e){var i=[t,""];if(null!==e&&Array.isArray(e))i[1]=e.toString();else if(null!==e&&"object"===S(e)){var r=Object.entries(e);if(r.length>0){var n=this.getDataEntriesOne(r[0][0],r[0][1]);i[0]="".concat(i[0],".").concat(n[0]),i[1]=n[1]}}else i[1]=e;return i}},{key:"getDataEntriesAll",value:function(t){for(var e=[],i=0,r=Object.entries(t);i<r.length;i++){var n=_(r[i],2),o=n[0],s=n[1],a=this.getDataEntriesOne(o,s);e.push(a)}return e}},{key:"doFindComboMatch",value:function(t,e){var i="";if(t&&t.configuration&&t.configuration.combinations)for(var r=this.getDataEntriesAll(e),n=Object.entries(t.configuration.combinations),o=0,s=function(){var t=l[a],e=Object.keys(t[1]).filter(function(e){return r.some(function(i){return e===i[0]&&t[1][e]===i[1]})});e.length===Object.keys(t[1]).length&&e.length>
2o&&(i=t[0],o=e.length)},a=0,l=n;a<l.length;a++)s();return i}},{key:"getIconFromCombinations",value:function(t,e){if(t&&t.configuration.combinations&&e&&Object.keys(e).length>0&&t.behavioralAppearance.combinations&&Object.keys(t.behavioralAppearance.combinations).length>0){var i=this.doFindComboMatch(t,e);if(""===i||!t.behavioralAppearance.combinations[i].labelIcon)return"";if(t.behavioralAppearance.combinations&&t.behavioralAppearance.combinations[i]&&t.behavioralAppearance.combinations[i].labelIcon)return t.behavioralAppearance.combinations[i].labelIcon.referenceUri}return""}},{key:"findSpace",value:function(t,e){if(e.spaceTypes&&e.spaceTypes[t])return e.spaceTypes[t]}},{key:"findCategory",value:function(t){if(this.spaceRules[t])return this.spaceRules[t]}},{key:"setSpaceRules",value:function(t){this.spaceRules=t}},{key:"getSpaceIcon",value:function(t,e,i){var r="",n=this.findCategory(e);if(n){var o=this.findSpace(t,n);if(o){var s="";i&&(s=this.getIconFromCombinations(o,i)),s&&""!==s?r=s:o.behavioralAppearance.default.labelIcon?r=o.behavioralAppearance.default.labelIcon.referenceUri:n.properties.behavioralAppearance.default.labelIcon&&(r=n.properties.behavioralAppearance.default.labelIcon.referenceUri)}}return r}}]),Se=c(function t(){s(this,t)},null,[{key:"getFormattedIndoorMapId",value:function(t){var e=/^\d{5}$/.test(t),i="string"==typeof t&&t.includes("indoormap");return e||!i?"indoormap-00000000-0000-4000-a000-".concat(t.toString().padStart(12,"0")):t}},{key:"validateIsMicelloId",value:function(t){return new RegExp(/^indoormap-00000000-0000-4000-[a-f]000-[0-9]{12}$/).test(t)}}]),Te=c(function t(){s(this,t),this.themeRule={},this.svgList={},this.defaultLang="ENG"},null,[{key:"getNumberFromAlphaNumeric",value:function(t){try{var e=t.split("").reverse().join("").replace(/[^0-9]/g,"").substr(0,6);return parseInt(e,10)}catch(t){return null}}},{key:"extractNumFromSting",value:function(t){try{var e=t.replace(/[^0-9]/g,"");return parseInt(e,10)}catch(e){return console.warn("Exception in converting string to Id"),this.getNumberFromAlphaNumeric(t)}}},{key:"getVenueId",value:function(t){if("number"!=typeof t){var e=t.substr(t.length-6);return parseInt(e,10)}return t}},{key:"setSite",value:function(t,e){var i=this.getName(t),r={id:Se.getFormattedIndoorMapId(e),location:t.referencePoint,properties:g({},t.properties),geometry:t.geometry,identifier:this.getVenueId(e),obj_type:"CommunityMap"},n=t.properties.indoorSiteMetadata,o=void 0===n?{}:n;return o.legacyVersion&&o.legacyVersion.mapVersion&&(r.map_version=o.legacyVersion.mapVersion),r.properties.name=i,r.properties.display_name=i,r}},{key:"setEntrance",value:function(t){var e=this.themeRule.entranceRules.default.labelIcon.referenceUri,i=this.extractNumFromSting(t.id),r=this.getName(t),n=t.properties;return n.icon=!0,n.svg=this.svgList[e.toLowerCase()],n.name=r||"entrance",n.display_name=r||"entrance",n.level={id:t.properties.level.id},{id:t.id,levelId:t.properties.level.id,momType:Et.ENTRANCE,geometry:t.geometry,location:t.geometry,properties:n,identifier:i,label_area:[t.referencePoint.coordinates[0],t.referencePoint.coordinates[1],50,50,180]}}},{key:"setStructure",value:function(t){var e=this.extractNumFromSting(t.id),i=this.getName(t),r=t.properties;return r.is_root=0===t.properties.drawOrder,r.display_name=i,r.map_type=t.properties.structureType,r.name=i,{id:t.id,obj_type:"Drawing",identifier:e,properties:r}}},{key:"getNameByPriority",value:function(t,e){for(var i=this,r="",n=function(t){return"OFFICIAL"===t.nameType&&t.languageCode&&t.languageCode===i.defaultLang||"OFFICIAL"===t.nameType},o=0;o<t.length;o++){var s=t[o];if(n(s)&&(e&&e===s.nameType||!e)){r=s.name;break}if("ABBREVIATION"===s.nameType&&(e&&e===s.nameType||!e)){r=s.name;break}if("UNCLASSIFIED"===s.nameType&&(e&&e===s.nameType||!e)){r=s.name;break}if(!s.nameType&&s.name){r=s.name;break}}return r}},{key:"getName",value:function(t,e){return t.properties&&t.properties.names?this.getNameByPriority(t.properties.names,e):t.properties.placeProperties&&t.properties.placeProperties&&t.properties.placeProperties.names?this.getNameByPriority(t.properties.placeProperties.names,e):t.properties.locationDetail
2s&&t.properties.locationDetails[0]&&t.properties.locationDetails[0].names?this.getNameByPriority(t.properties.locationDetails[0].names,e):""}},{key:"setLevel",value:function(t){var e=this.extractNumFromSting(t.id),i=t.properties.names,r=t.properties,n=t.geometry;return r["short name"]=this.getNameByPriority(i,i&&1!==i.length?"ABBREVIATION":""),r.name=this.getNameByPriority(i,i&&1!==i.length?"ABBREVIATION":""),{id:t.id,obj_type:"Level",identifier:e,properties:r,geometry:n}}},{key:"setLevelConnector",value:function(t){var e=this.extractNumFromSting(t.id);return{id:t.id,obj_type:"LevelConnector",properties:t.properties,geometry:t.geometry,identifier:e,location:t.geometry}}},{key:"setOccupant",value:function(t){var e=this.getName(t),i=this.extractNumFromSting(t.id),r=t.properties;return r.occupantName=e,r.email=t.properties.placeProperties&&t.properties.placeProperties.contacts&&t.properties.placeProperties.contacts.find(function(t){return"EMAIL"===t.contactType})&&t.properties.placeProperties.contacts.find(function(t){return"EMAIL"===t.contactType}).value,r.name=e,r.tags=t.properties.attributes&&t.properties.attributes.tags,{geometry:t.geometry,id:t.id,obj_type:"Geometry",properties:r,identifier:i,spaceIds:t.properties.spaces?t.properties.spaces:[],type:"Feature",momType:Et.OCCUPANT}}},{key:"getIcon",value:function(t){var e=!1,i="";return this.svgList[t]&&(e=!0,i=this.svgList[t]),{icon:e,svg:i}}},{key:"setSpace",value:function(t){var e=we.getSpaceIcon(t.properties.spaceType,t.properties.spaceCategory,t.properties.spaceTypeProperties),i=this.getName(t),r=this.getIcon(e),n=r.icon,o=r.svg,s=this.extractNumFromSting(t.id),a=t.properties.level.id,l=t.properties;l.spaceName=i,l[t.properties.spaceCategory]=t.properties.spaceType,l.spaceType=t.properties.spaceType,l.spaceCategory=t.properties.spaceCategory,l.icon=n,l.svg=o;var c={geometry:t.geometry,id:t.id,levelId:a,label_area:[t.referencePoint.coordinates[0],t.referencePoint.coordinates[1],50,50,180],location:t.referencePoint,obj_type:"Geometry",identifier:s,properties:l,momType:Et.SPACE,type:"Feature"};return t.properties.spaceAddress&&t.properties.spaceAddress.id&&(c.addressId=t.properties.spaceAddress.id),c}},{key:"setSpaceGroups",value:function(t){var e=this.extractNumFromSting(t.id);return{id:t.id,obj_type:"SpaceGroups",properties:t.properties,geometry:t.geometry,location:t.referencePoint,identifier:e}}},{key:"setTopology",value:function(t){var e=this.extractNumFromSting(t.id);return{id:t.id,obj_type:"Topology",properties:t.properties,geometry:t.geometry,identifier:e}}},{key:"setAddress",value:function(t){var e=this.extractNumFromSting(t.id),i=this.getName(t),r=t.properties;return r.addressName=i,r.name=i,{id:t.id,properties:r,obj_type:"Address",identifier:e}}},{key:"manageSvgDimensions",value:function(t){for(var e={},i=0,r=Object.entries(t);i<r.length;i++){var n=_(r[i],2),o=n[0],s=n[1];if("string"==typeof s){var a=-1!==s.indexOf("<g")&&s.indexOf("<g")||s.indexOf("<p"),l=s.indexOf("</s");if(a&&l){var c=s.substring(a-1,l-1);e[o]="<svg width='64' height='64' viewBox='0 0 24 32' fill='none' xmlns='http://www.w3.org/2000/svg'>".concat(c,"</svg>")}}}return e}},{key:"getSiteBoundingBox",value:function(t){if(t){var e=_(xe.getBoundingBox(t.geometry.type,t.geometry.coordinates),2),i=e[0],r=e[1];if(i)return"".concat(i[0],",").concat(i[1],",").concat(r[0],",").concat(r[1])}return"null, null, null, null"}}]),Ee=function(){return c(function t(){s(this,t)},null,[{key:"get",value:function(t){return fetch(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{method:"GET"}).then(function(e){return e.ok?e.json():Promise.reject(new Error("Call failed for ".concat(t," : ").concat(e.status," ").concat(e.statusText)))})}},{key:"getConfigUrl",value:function(t,e,i){var r=i.apiKey,n=i.url,o=i.token,s=i.hrn,a={method:"GET",mode:"cors",cache:"default"},l="".concat(n||Nt,"/").concat(s),c="";return e===Tt.SITE&&(c="".concat(l,"/layers/").concat(kt,"/search?p.featureType=indoor.Site&p.indoorMapId='").concat(Se.getFormattedIndoorMapId(t),"'")),e===Tt.IMAGES&&(c="".concat(l,"/layers/").concat("icons","/features/svg")),e===Tt.Theme&&(c="".concat(l,"/layers/").concat("config","/features/indoorMapRules")),o?a.headers={Authorization:"Bearer ".concat(o)}:c=c.concat("".concat(e===Tt.SITE?"&":"?","apiKey=").concat(r)),this.get(c,a)}},{key:"getMomData",value:function(t,e){var i=e.apiKey,r=e.url,n=e.token,o=e.hrn,s={method:"GET",mode:"cors",cache:"default"},a="".concat(r||Nt,"/").concat(o),l=t&&t.features&&t.features.find(function(t){return t.momType===Et.SITE}),c=Te.getSiteBoundingBox(l),h=[Et.TOPOLOGY,Et.LEVELCONNECTOR],u=Object.values(Et).filter(function(t){return!h.includes(t)}).join(),p="".concat(a,"/layers/").concat(kt,"/bbox?bbox=").concat(c,"&limit=100000&f.momType=").concat(u);return n?s.headers={Authorization:"Bearer ".concat(n)}:p=p.concat("&apiKey=".concat(i)),{mom:this.get(p,s),site:l}}},{key:"getIndoorMapsCollectionList",value:(t=n(y().mark(function t(e){var i,r,n,o,s,a,l,c,h,u,p;return y().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.token,r=Bt[jt.DEFAULT_COLLECTION],n=r.PARAMS,o=r.BASE_URL,s=encodeURI("".concat(o,"?sortBy=").concat(n.CREATED,"&verbose=").concat(n.
2VERBOSE)),a=s,!i){t.next=23;break}return l={method:"GET",headers:{Authorization:"Bearer ".concat(i)}},t.prev=6,t.next=9,this.get(a,l);case 9:if((c=t.sent).results&&0!==c.results.items.length){t.next=12;break}return t.abrupt("return",Promise.reject(new Error("empty catalogs, no result found")));case 12:if(h=c.results.items,u=/^indoormap.*-collection$/,p=h.filter(function(t){return u.test(t.id)}),!(Array.isArray(p)&&p.length<1)){t.next=17;break}return t.abrupt("return",Promise.reject(new Error("No indoormap collections found")));case 17:return t.abrupt("return",p);case 20:return t.prev=20,t.t0=t.catch(6),t.abrupt("return",Promise.reject(new Error("Error while accessing default collection")));case 23:return t.abrupt("return",Promise.reject(new Error("Please provide valid token")));case 24:case"end":return t.stop()}},t,this,[[6,20]])})),function(e){return t.apply(this,arguments)})},{key:"getProjectAccountDetails",value:function(t){var e=t.token,i=Bt[jt.ACCOUNT_API].BASE_URL;if(e){var r={method:"GET",mode:"cors",headers:{Authorization:"Bearer ".concat(e)}};return this.get(i,r)}return Promise.reject(new Error("Please provide valid token"))}},{key:"fetchIndoorMapList",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.hrn,i=t.url,r=Bt[jt.CATALOG_LAYER],n=r.PARAMS,o=r.COLLECTION_LAYER;if(e){var s=encodeURI("".concat(i||Nt,"/").concat(e,"/").concat(o,"?").concat(n.FEATURE_TYPE.KEY,"=").concat(n.FEATURE_TYPE.VALUE)),a=this.createBaseUrl(s,Gt.GET,{},t),l=a.URL,c=a.options;return this.get(l,c)}return Promise.reject(new Error("Please provide valid hrn"))}},{key:"createBaseUrl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gt.GET,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=r.token,o=r.apiKey,s=t,a={method:e,mode:"cors"};return n?a.headers=g({Authorization:"Bearer ".concat(n)},i):s=t.concat("&apiKey=".concat(o)),{URL:s,options:a}}}]);var t}(),Me=function(){function t(){s(this,t)}return c(t,null,[{key:"isPointOnGeoJSONLineString",value:function(t,e){var i=!1;if(e&&e.length>1)for(var r=0,n=0,o=1;o<e.length;o+=1)if(r=e[o-1],n=e[o],xe.isPointOnLineSegment(t,r,n)){i=!0;break}return i}},{key:"isPointOnGeoJSONMultiLineString",value:function(e,i){for(var r=!1,n=0;n<i.length;n+=1)if(t.isPointOnGeoJSONLineString(e,i[n])){r=!0;break}return r}},{key:"isPointInsideGeoJSONPolygon",value:function(t,e){var i=!1;if(xe.isPointInPolygon(t,e[0])&&(i=!0),i)for(var r=1;r<e.length;r+=1)if(xe.isPointInPolygon(t,e[r])){i=!1;break}return i}},{key:"isPointInsideGeoJSONMultiPolygon",value:function(e,i){for(var r=i.length,n=0;n<r;n+=1)if(t.isPointInsideGeoJSONPolygon(e,i[n]))return!0;return!1}},{key:"getGeometriesByLonLat",value:function(t,e){for(var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],n=e.filter(function(e){return xe.isPointInBoundingBox(t,e.getBoundingBox())}),o=0;o<n.length;o+=1){var s=n[o];if(s.isPointInsideGeometry(t,!0)&&(r.push(s),!i))break}return r.sort(function(t,e){return e.getZIndex()-t.getZIndex()})}}])}(),Ae=c(function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;s(this,t),this.id=e.id,this.properties=e.properties||{},this.labelArea=e.label_area||[],this.geometry=e.geometry||{},this.location=e.location||{},this.address=e.address||{},this.level=i,this.zIndex=r,this.spaceId=e.spaceId,this.state_={isHighlighted:!1,highlightedStyle:{}},this.geometryData=e},[{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 t=this.getType(),e=this.getCoordinates(),i=[];switch(t){case Ct:i=[e,e];break;case Rt:case Pt:i=e;break;case It:case Lt:i=e.reduce(function(t,e){return t.concat(e)},[]);break;case Ot:i=e.reduce(function(t,e){return t.concat(e)},[]).reduce(function(t,e){return t.concat(e)},[])}return xe.getBoundingBoxVertices(i)}},{key:"isIcon",value:function(){return!!this.properties.icon}},{key:"isPointInsideGeometry",value:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!1;switch(this.getType()){case Ct:e=this.getLabelArea()&&xe.getRectangularCoordinatesOfLabelArea(this.getLabelArea()),r=xe.isPointInPolygon(t,e);break;case Rt:break;case Pt:r=i&&Me.isPointOnGeoJSONLineString(t,this.getCoordinates());break;case It:r=i&&Me.isPointOnGeoJSONMultiLineString(t,this.getCoordinates());break;case Lt:r=Me.isPointInsideGeoJSONPolygon(t,this.getCoordinates());break;case Ot:r=Me.isPointInsideGeoJSONMultiPolygon(t,this.getCoordinates())}return r}},{key:"highlight",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;this.state_.isHighlighted=t,this.state_.highlightedStyle=t?e:{}}},{key:"isHighlighted",value:function(){return Boolean(this.state_.isHighlighted)}},{key:"getHighlightedStyle",value:function(){return this.state_.highlightedStyle||{}}},{key:"toJSON",value:function(){return g({},this.geometry)}},{key:"getMetaInformation_",value:function(){return this.getLevel()?this.getLevel().getDrawing().getVenueModel().metaInformation_:null}}]),Ce=c(function t(e,i){var r=this;s(this,t),this.id=e&&e.id,this.properties=e&&e.properties,this.zIndexCount=0,this.geometries=e&&e.features&&Object.values(e.features).reduce(function(t,e){return t[[e.id]]=new Ae(e,r,e.properties.drawOrder),t},{}),this.drawing=i,this.levelData=e},[{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(t){return t.toJSON()})}},{key:"getGeometryById",value:function(t){return this.geometries[t]}},{key:"getGeometries",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this.geometries&&Object.values(this.geometries).sort(function(t,e){return e.getZIndex()-t.getZIndex()}):this.geometries&&Object.values(this.geometries).sort(function(t,e){return t.getZIndex()-e.getZIndex()})}},{key:"getGeometriesByAddress",value:function(t){return Object.values(this.geometries).filter(function(e){return e.address&&e.address.properties&&e.address.properties.name&&e.address.properties.name===t})}},{key:"isMain",value:function(){return Boolean(this.properties.isMain)}}]),Pe=c(function t(e){var i=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3?arguments[3]:void 0;s(this,t),this.venueModel=o,this.levels=n.map(function(t){return new Ce(t,i)}),this.structure=e,this.id=e&&e.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 t=_(xe.getBoundingBox(this.structure.geometry.type,this.structure.geometry.coordinates),2),e=t[0],i=t[1];if(e)return[i[1],e[0],e[1],i[0]]}
2return[null,null,null,null]}},{key:"getCenter",value:function(){return this.structure&&this.structure.location&&this.structure.location.coordinates}},{key:"getGeometryById",value:function(t){return this.getGeometries().find(function(e){return e.getId()===t||e.getIdentifier()===t})}},{key:"getGeometries",value:function(){return this.levels.flatMap(function(t){return t.getGeometries()})}},{key:"getLevelById",value:function(t){return this.levels.find(function(e){return e.getId()===t||e.getIdentifier()===t})}},{key:"getLevelByZIndex",value:function(t){return this.levels.find(function(e){return e.getZIndex()===t})}},{key:"getLevels",value:function(){return this.levels}},{key:"getMainLevel",value:function(){return this.levels.find(function(t){return t.isMain()})}},{key:"getVenueModel",value:function(){return this.venueModel}}]),Le=Dt.STANDARD,Re=c(function t(e){var i=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ve;s(this,t),this.metaInformation_=r,this.momStructure=e,this.id=e&&e.site&&e.site.id,this.location=e&&e.site&&e.site.location||{},this.properties=e&&e.site&&g({},e.site.properties),this.drawings=e&&e.structure&&Object.values(e.structure).map(function(t){var r=e.getStructureWiseGeometry(t.id);return new Pe(t,t.properties,Object.values(r),i)})},[{key:"getDisplaySettings",value:function(){return(this.metaInformation_.releaseSettings_?this.metaInformation_.releaseSettings_.displayOptions:"").display||Le}},{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 t=_(xe.getBoundingBox(this.momStructure.site.geometry.type,this.momStructure.site.geometry.coordinates),2),e=t[0],i=t[1];if(e)return[i[1],e[0],e[1],i[0]]}return[null,null,null,null]}},{key:"getCenter",value:function(){return this.location.coordinates}},{key:"getGeometryById",value:function(t){return this.getGeometries().find(function(e){return e.getId()===t||e.getIdentifier()===t})}},{key:"getGeometries",value:function(){return this.getLevels().sort(function(t,e){return t.getZIndex()-e.getZIndex()}).flatMap(function(t){return t.getGeometries()})}},{key:"getGeometriesByLonLat",value:function(t){var e=this,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).map(function(t){return e.getLevelById(t)});return 0===r.length&&(r=this.drawings.filter(function(e){var i=e.getBoundingBox();return xe.isPointInBoundingBox(t,i)}).flatMap(function(t){return t.getLevels()})),Me.getGeometriesByLonLat(t,r.flatMap(function(t){return t.getGeometries(!0)}),i)}},{key:"getDrawingById",value:function(t){return this.drawings.find(function(e){return e.getId()===t||e.getIdentifier()===t})}},{key:"getDrawings",value:function(){return this.drawings}},{key:"getRootDrawing",value:function(){return this.drawings.find(function(t){return t.isRoot()})}},{key:"getLevelById",value:function(t){return this.getLevels().find(function(e){return e.getId()===t||e.getIdentifier()===t})}},{key:"getLevelsByZIndex",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.getLevels().filter(function(e){return Number(e.getZIndex())===Number(t)})}},{key:"getLevels",value:function(){return this.drawings.flatMap(function(t){return t.getLevels()})}},{key:"getMomStructure",value:function(){return this.momStructure}},{key:"getLevelMapFlattenedByZIndex_",value:function(){var t=this.getLevels().reduce(function(t,e){var i=e.getZIndex(),r=t;return r[i]||(r[i]=[]),r[i].push(e),r},{});return t}},{key:"getOccupant",value:function(){var t=this.momStructure.occupant;return Object.values(t)}}]),Ie=c(function t(e){s(this,t),this.theme=e&&e.theme,this.level=e&&e.level,this.site=e&&e.site,this.spaces=e&&e.spaces,this.address=e&&e.address,this.levelConnector=e&&e.levelConnector,this.topology=e&&e.topology,this.entrance=e&&e.entrance,this.occupant=e&&e.occupant,this.structure=e&&e.structure,this.spaceGroups=e&&e.spaceGroups,this.levelWiseGeometry={},this.levelStructureMapping=e&&e.levelStructureMapping,this.outdoorLevelMapping=e&&e.outdoorLevelMapping||{},this.labelTextPreference=e&&e.labelTextPreference||null},[{key:"setSpaceWithLevel",value:function(){var t=this;
2this.spaces&&Object.values(this.spaces).forEach(function(e){var i="";e.addressId&&(i=t.address&&t.address[e.addressId]&&t.address[e.addressId].properties.addressName);var r=e.properties;r.addressName=i;var n=t.getLabelAsPerPreference(g(g({},e),{},{properties:r})),o=e.properties;o.name=n,o.display_name=n,e.properties.icon&&(o.name=e.id,o.display_name=e.id);var s=e;s.properties=o,s.address=t.address[e.addressId],t.spaces[e.id]=e;var a=e.levelId;t.outdoorLevelMapping[a]&&(a=t.outdoorLevelMapping[a]),t.levelWiseGeometry[a]||(t.levelWiseGeometry[a]={}),t.levelWiseGeometry[a][s.id]=s})}},{key:"setOccupantWithLevel",value:function(){var t=this;this.occupant&&Object.values(this.occupant).forEach(function(e){if(e.spaceIds&&e.properties.occupantName){var i=[],r=[];e.spaceIds.forEach(function(n){var o=n.id,s=t.spaces[o],a=null;t.spaceGroups&&Object.values(t.spaceGroups).forEach(function(t){t.properties.spaceGroups&&t.properties.spaceGroups&&t.properties.spaceGroups.forEach(function(t){t.mainSpace&&t.mainSpace.id===n.id&&(a=t.spaces.map(function(t){return t.id}))})});var l=function(n){var o=!1;t.labelTextPreference&&t.labelTextPreference.length&&(o=-1!==t.labelTextPreference.indexOf("OCCUPANT_NAMES"));var s=null===t.labelTextPreference||o,a=n,l=n.properties;l.name=n.properties.icon||!s?n.properties.name:e.properties.occupantName,l.display_name=n.properties.icon||!s?n.properties.display_name:e.properties.occupantName,l.address=n.address,l.occupantName=e.properties.occupantName;var c=n.levelId;t.outdoorLevelMapping[c]&&(c=t.outdoorLevelMapping[c]),t.levelWiseGeometry[c]||(t.levelWiseGeometry[c]={}),t.levelWiseGeometry[c][n.id]=a,i.push(a),r.push(n.id)};a&&a.length>0&&a.forEach(function(e){l(t.spaces[e])}),s&&l(s)}),t.occupant[e.id]=e,t.occupant[e.id].space=i,t.occupant[e.id].spaceIds=r}})}},{key:"setEntrance",value:function(){var t=this;this.entrance&&Object.values(this.entrance).forEach(function(e){var i=e.properties.level.id;t.levelWiseGeometry[i]||(t.levelWiseGeometry[e.properties.level.id]={}),t.outdoorLevelMapping[i]&&(i=t.outdoorLevelMapping[i]),t.levelWiseGeometry[i][e.id]=e})}},{key:"setLevelWiseGeometry",value:function(){var t=this;this.level&&Object.keys(this.level).forEach(function(e){t.levelWiseGeometry[e]={}}),this.setSpaceWithLevel(),this.setOccupantWithLevel(),this.setEntrance()}},{key:"getStructureWiseGeometry",value:function(t){for(var e={},i=0,r=Object.entries(this.levelWiseGeometry);i<r.length;i++){var n=_(r[i],2),o=n[0],s=n[1];t===this.levelStructureMapping[o]&&(e[o]=this.level[o],e[o].features=s)}return e}},{key:"getLabelAsPerPreference",value:function(t){var e=t.properties,i=e.spaceType,r=e.occupantName,n=e.spaceName,o=e.addressName,s=e.spaceCategory,a=h(h(h(h(h(h(h({},"OCCUPANT_NAMES",r),"SPACE_NAME",n),Mt,i?i.charAt(0).toUpperCase()+i.slice(1).toLowerCase():""),At,s?s.charAt(0).toUpperCase()+s.slice(1).toLowerCase():""),"INTERNAL_ADDRESS_SHORT",o),"INTERNAL_ADDRESS",o),"INTERNAL_ADDRESS_LONG",o),l=this.theme.spaceRules,c="",u=s&&i&&l[s]&&l[s].spaceTypes&&l[s].spaceTypes[i].behavioralAppearance.default.labelType;if("NONE"===u){if(!this.labelTextPreference)return"";a[Mt]=""}var p=s&&i&&l[s]&&l[s].properties&&l[s].properties.behavioralAppearance&&l[s].properties.behavioralAppearance.default&&l[s].properties.behavioralAppearance.default.labelType;if(("NONE"===p||void 0===p)&&void 0===u){if(!this.labelTextPreference)return"";a[Mt]="",a[At]=""}var d=s&&i&&l[s]&&l[s].properties&&l[s].properties.behavioralAppearance&&l[s].properties.behavioralAppearance.default&&l[s].properties.behavioralAppearance.default.labelTextPreference,m=d&&this.labelTextPreference?this.labelTextPreference:d;if(m)for(var f=0;f<m.length;f++)if(a[m[f]]){c=a[m[f]];break}return c}}]),Oe=function(){return c(function t(e){var i=e.apiKey,r=e.baseUrl,n=e.token,o=e.hrn;s(this,t);var a={apiKey:i,url:r,token:n,hrn:o};this.hostOptions_=a,this.momData=[],this.theme={},this.loadOptions={}},[{key:"setHostOptions",value:function(t){0===Object.keys(t).length||(this.hostOptions_=g(g({},this.hostOptions_),t))}},{key:"getToken",value:function(){return this.hostOptions_.token}},{key:"getHrn",value:function(){return this.hostOptions_.hrn}},{key:"load",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.loadOptions=g(g(g({},Vt),i),{},{venueId:t}),this.hostOptions_.mapData=i.mapData,this.hostOptions_.themeRule=i.themeRule,this.hostOptions_.svgList=i.svgList,this.hostOptions_.labelTextPreference=i.labelTextPreferenceOverride,this.getHrn()?this.getVenueModalInstance():this.getToken()?this.getDefaultCollectionWithToken().then(function(){return e.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 t=this;return Promise.resolve().then(function(){return t.loadOptions.isMetaEnabled?t.getMeta_(t.loadOptions.isIconsEnabled).catch(function(t){return console.warn(t),Promise.resolve()}):Promise.reject()}).then(function(e){return t.getVenue_(e)}).then(function(t){return t}).catch(function(t){console.debug("Captured event VENUE_ERROR_STATE",t)})}},{key:"initializeMomStructure",value:function(){return{site:{},structure:{},level:{},levelConnector:{},occupant:{},spaces:{},spaceGroups:{},topology:{},address:{},outdoorLevelMapping:{},entrance:{},levelStructureMapping:{}}}},{key:"createMomStructure",value:function(){var t=this,e=this.initializeMomStructure();return this.momData.forEach(function(i){var r=Se.getFormattedIndoorMapId(t.loadOptions.venueId),n=i.id;if(i.momType===Et.ADDRESS||t.hostOptions_.mapData||i.properties.indoorMapId==t.loadOptions.venueId||i.properties.indoorMapId===r)if(i.momType===Et.SITE)e.site=Te.setSite(i,t.loadOptions.venueId);else if(i.momType===Et.STRUCTURE)e.structure[n]=Te.setStructure(i);else if(i.momType!==Et.LEVEL||i.properties.isOutdoor&&(!i.properties.isOutdoor||i.properties.parentIndoorLevel)){if(i.momType===Et.ENTRANCE)e.entrance[n]=Te.setEntrance(i);else if(i.momType===Et.OCCUPANT)e.occupant[n]=Te.setOccupant(i);else if(i.momType===Et.SPACE)e.spaces[n]=Te.setSpace(i);else if(i.momType===Et.SPACEGROUPS)e.spaceGroups[n]=Te.setSpaceGroups(i);else if(i.momType===Et.ADDRESS)e.address[n]=Te.setAddress(i);else if(i.momType===Et.LEVEL&&i.properties.isOutdoor&&i.properties.parentIndoorLevel){var o=i.properties.parentIndoorLevel.
2id;e.outdoorLevelMapping[i.id]=o}}else e.level[n]=Te.setLevel(i),e.levelStructureMapping[n]=i.properties.structure.id}),e.theme=this.theme,e.labelTextPreference=this.hostOptions_.labelTextPreference,new Ie(e)}},{key:"getVenue_",value:function(t){this.momData=t.getMomData();var e=this.createMomStructure();return e.setLevelWiseGeometry(),new Re(e,t)}},{key:"setConfigData",value:function(t){var e=t.themeRule,i=t.svgList,r=t.defaultLang;we.setSpaceRules(e.spaceRules),Te.svgList=i,Te.themeRule=e,Te.defaultLang=r,this.theme=e}},{key:"getMeta_",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=new ve,r=this.hostOptions_.mapData?{}:this.getMetaConfig_(this.loadOptions.venueId,Tt.SITE),n=this.hostOptions_.themeRule||this.getMetaConfig_(this.loadOptions.venueId,Tt.Theme),o=[];return e&&(o=this.hostOptions_.svgList||this.getMetaConfig_(this.loadOptions.venueId,Tt.IMAGES)),new Promise(function(s){Promise.all([r,n,o]).then(function(r){var n=_(r,3),o=n[0],a=n[1],l=n[2],c=t.hostOptions_.mapData?{mom:new Promise(function(e){return e(t.hostOptions_.mapData)}),site:t.hostOptions_.mapData.features.find(function(t){return t.momType===Et.SITE})}:Ee.getMomData(o,t.hostOptions_);c.mom.then(function(r){var n=a.properties;i.imageCache=e?Te.manageSvgDimensions(l.properties):[],t.setConfigData({themeRule:n,svgList:i.imageCache,defaultLang:c&&c.site&&c.site.properties.defaultLanguageCode}),i.releaseSettings_={displayOptions:{display:n.entranceRules.default.displayName||Dt.STANDARD},mom:r.features},i.theme=new ye(n,i),s(i)})})})}},{key:"getMetaConfig_",value:function(t,e){return Ee.getConfigUrl(t,e,this.hostOptions_)}},{key:"fetchCollections",value:function(){return Ee.getIndoorMapsCollectionList(this.hostOptions_)}},{key:"fetchUserProjects",value:function(){return Ee.getProjectAccountDetails(this.hostOptions_)}},{key:"getDefaultCollectionWithToken",value:(t=n(y().mark(function t(){var e=this;return y().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Promise.all([this.fetchCollections(),this.fetchUserProjects()]).then(function(t){var i=_(t,2),r=i[0],n=i[1],o=e.getDefaultCollection(r,n);if(o.hrn){var s={hrn:o.hrn};return e.setHostOptions(s),Promise.resolve()}return Promise.reject()}).catch(function(t){return Promise.reject(t)}));case 1:case"end":return t.stop()}},t,this)})),function(){return t.apply(this,arguments)})},{key:"getDefaultCollection",value:function(t,e){if(Array.isArray(t)&&t.length){var i=this.getProjectRealm(e);return t.find(function(t){return t.hrn.includes(i)})}return Promise.reject(new Error("Error while accessing default collection"))}},{key:"getProjectRealm",value:function(t){if(Array.isArray(t.items)&&t.items.length&&t.items[0].id.includes("indoor-")){var e=t.items[0].hrn;return this.getRealmNameFromHrn(e)}return""}},{key:"getRealmNameFromHrn",value:function(t){if(t){var e=t.split(":");return e.length&&e[4]}return""}},{key:"getSupportedMapList",value:function(){var t=this,e=this.hostOptions_,i=e.hrn,r=e.token;return i?this.fetchMapInfoList():r?this.getDefaultCollectionWithToken().then(function(){return t.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 t=this;return Ee.fetchIndoorMapList(this.hostOptions_).then(function(e){var i=e.features;return i.length>0?i.map(function(e){var i=e.properties,r=i.placeProperties,n=i.indoorMapId,o=n;if(Se.validateIsMicelloId(n)){var s=n.split("-").pop();o=parseInt(s.substring(s.length-Math.min(s.length,5)),10).toString()}return{mapIdentifier:n,mapName:t.getMapName(r.names).name,mapId:o}}):[]}).catch(function(t){Promise.reject(new Error("".concat(t,": Error while fetching map list")))})}},{key:"getMapName",value:function(t){return Array.isArray(t)&&t.length>0?t.find(function(t){return"OFFICIAL"===t.nameType}):{}}}]);var t}(),De=["origin","destination"],ke=qt[Ht.DEV],Ne=c(function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(s(this,t),!e.token)throw new Error("Token is mandatory in order to initialize the indoor routing service");this.config_=g({baseUrl:ke},e)},[{key:"calculateRoute",value:function(t){var e=t.origin,i=void 0===e?{}:e,r=t.destination,n=void 0===r?{}:r,o=function(t,e){if(null==t)return{};var i,r,n=function(t,e){if(null==t)return{};var i={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;i[r]=t[r]}return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)i=o[r],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}(t,De),s={method:"GET"};if(!i.coordinates||!n.coordinates)throw new Error("Waypoint coordinates are missing");if(!i.venueId||!n.levelId)throw new Error("venueId or levelId are missing");var a=function(t){var e=t.coordinates,i=t.venueId,r=t.levelId,n=e.join(",");return i&&r?n.concat(";indoorMapId=",i,";levelId=",r):n},l=new URL("".concat(this.config_.baseUrl,"/v1/routes")),c=new URLSearchParams({origin:a(i),destination:a(n)});return this.config_.token&&(s.headers={Authorization:"Bearer ".concat(this.config_.token)}
2),Object.entries(o).forEach(function(t){var e=_(t,2),i=e[0],r=e[1];c.append(i,"object"===S(r)?JSON.stringify(r):r)}),l.search=c,Ee.get(l,s)}}]),Fe={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(h(h(h(h(h(h(h(h(h({},Fe.VENUE_DATA_LOADED,{description:"event fired when all requested files along with metadata & overrides are loaded",emitTemplate:{}}),Fe.VENUE_MAP_DATA_LOADED,{description:"event fired when requested levels, drawings & community files are loaded",emitTemplate:{}}),Fe.VENUE_ENTITY_DATA_LOADED,{description:"event fired when requested entity data is loaded",emitTemplate:{}}),Fe.VENUE_DATA_MODEL_LOADED,{description:"event fired when a map file is loaded",emitTemplate:{}}),Fe.VENUE_NAV_DATA_LOADED,{description:"event fired when requested navigation product is loaded",emitTemplate:{}}),Fe.META_DATA_LOADED,{description:"event fired when all requested meta files are loaded except icon & marker",emitTemplate:{}}),Fe.META_DATA_MODEL_LOADED,{description:"event fired when a specific model is loaded except icon & marker",emitTemplate:{}}),Fe.META_DATA_MODEL_UPDATED,{description:"event fired when a specific meta override is added or removed",emitTemplate:{}}),Fe.VENUE_ICONS_LOADED,{description:"event fired when all icons of venue are loaded",emitTemplate:{}}));var Ue=new Zt;Ue.EVENT_NAME=Fe,Ue.on("newListener",function(t){Fe[t]||console.warn("subscribing for un-registered/documented event")});var ze=function(){function t(e){var i;if(s(this,t),i=o(this,t),!(e instanceof Re))throw new Error("It is mandatory to provide valid instance of venueModel");return i.venueModel=e,i.search_=new St(e),i.status_={activeDrawingId:e.getRootDrawing().getIdentifier(),activeLevelIndex:e.getRootDrawing().getMainLevel().getZIndex()},i.mapObjectStore_=i.getDefaultMapObjectsStore_(),i.drawings=e.getDrawings().map(function(t){var e=new M(t);return e.setParentEventTarget(i),e}),i.levels=e.getLevels().map(function(t){var e=new A(t);return e.setParentEventTarget(i.drawings.find(function(t){return t.getIdentifier()===e.getData().getDrawing().getIdentifier()})),e}),i.geometries=e.getGeometries().map(function(t){var e=new E(t);return e.setParentEventTarget(i.levels.find(function(t){return t.getIdentifier()===e.getData().getLevel().getIdentifier()})),e}),i.mutualExclusiveHighlight_=!1,i}
2return d(t,H.map.Feature),c(t,[{key:"getData",value:function(){return this.venueModel}},{key:"getBoundingBox",value:function(){return a(H.geo.Rect,x(this.venueModel.getBoundingBox()))}},{key:"getCenter",value:function(){var t=_(this.venueModel.getCenter(),2),e=t[0],i=t[1];return new H.geo.Point(i,e)}},{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(t){return this.drawings.find(function(e){return e.getIdentifier()===t})}},{key:"getDrawings",value:function(){return this.drawings}},{key:"getLevel",value:function(t){return this.levels.find(function(e){return e.getIdentifier()===t})}},{key:"getLevels",value:function(){return this.levels}},{key:"getGeometry",value:function(t){return this.getGeometries().find(function(e){return e.getIdentifier()===t})}},{key:"getGeometries",value:function(){return this.geometries}},{key:"getActiveLevels",value:function(){var t=this;return this.getData().getDisplaySettings()===Dt.FLATTEN?this.venueModel.getLevelsByZIndex(this.status_.activeLevelIndex).map(function(e){return t.getLevel(e.getIdentifier())}):[this.venueModel.getDrawingById(this.status_.activeDrawingId).getLevelByZIndex(this.status_.activeLevelIndex)].map(function(e){return t.getLevel(e.getIdentifier())})}},{key:"getActiveDrawing",value:function(){return this.getDrawing(this.status_.activeDrawingId)}},{key:"setActiveDrawing",value:function(e){if(this.status_.activeDrawingId!==e){var i=this.venueModel.getDrawingById(e);if(!i)throw new Error("Drawing ".concat(e," was not found"));var r=this.status_.activeDrawingId;this.status_.activeDrawingId=i.id,this.setActiveLevelIndex(i.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 i=this.status_.activeLevelIndex;this.status_.activeLevelIndex=e,this.dispatchEvent(new H.util.ChangeEvent(t.EVENTS.LEVEL_CHANGE,e,i))}}},{key:"isActive",value:function(){var t=this.getParentEventTarget();return!!t&&this===t.activeVenue}},{key:"getHighlightedGeometries",value:function(){var t=this;return this.venueModel.getGeometries().filter(function(t){return t.isHighlighted()}).map(function(e){return t.getGeometry(e.getIdentifier())})}},{key:"setHighlightedGeometries",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=g(g({},ct),r),s=o.fillColor,a=o.outlineColor,l=o.outlineWidth;this.mutualExclusiveHighlight_=!!n,this.mutualExclusiveHighlight_&&this.getHighlightedGeometries().forEach(function(t){t.getData().highlight(!1)}
2),i.forEach(function(t){t.getData().highlight(e,{m:s,o:a,w:l})}),this.dispatchEvent(t.EVENTS.GEOMETRY_HIGHLIGHT)}},{key:"getMapObjects",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getActiveLevelIndex(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getActiveDrawing();return this.mapObjectStore_[t][e.getIdentifier()]}},{key:"setMapObjects",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getActiveLevelIndex(),i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.getActiveDrawing();this.mapObjectStore_[e]&&this.mapObjectStore_[e][i.getIdentifier()]&&(this.mapObjectStore_[e][i.getIdentifier()]=x(t)),this.updateMapObjectsVisibility_()}},{key:"search",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.search_.find(e).flatMap(function(e){return e.geometries.map(function(e){return t.getGeometry(e.id)})})}},{key:"updateMapObjectsVisibility_",value:function(){Object.values(this.mapObjectStore_).forEach(function(t){Object.values(t).forEach(function(t){return t.forEach(function(t){return t.setVisibility(!1)})})}),this.isActive()&&this.mapObjectStore_[this.getActiveLevelIndex()][this.getActiveDrawing().getIdentifier()].forEach(function(t){return t.setVisibility(!0)})}},{key:"getDefaultMapObjectsStore_",value:function(){var t=this,e=this.getData().getDisplaySettings()===Dt.FLATTEN;return this.venueModel.getLevels().reduce(function(i,r){var n=r.getZIndex(),o=g({},i);return o[n]||(o[n]={}),o[n][r.getDrawing().getIdentifier()]=[],e&&(o[n][t.venueModel.getRootDrawing().getIdentifier()]=[]),o},{})}}])}();ze.EVENTS={ACTIVE_VENUE_CHANGE:"activevenuechange",DRAWING_CHANGE:"drawingchange",LEVEL_CHANGE:"levelchange",GEOMETRY_HIGHLIGHT:"geometryhighlight"};var je=c(function t(){s(this,t)},null,[{key:"getIconLayer",value:function(){return{type:"FeatureCollection",features:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).flatMap(function(t){return t.getData().getGeometries()}).filter(function(t){return t.isIcon()&&t.getIcon()}).map(function(t){var e=_(t.getLabelArea(),2),i=e[0],r=e[1],n=t.getLevel(),o=t.getIcon(),s=t.properties.spaceType||t.properties.spaceCategory||t.getDisplayName();return{type:"Feature",properties:{id:t.getIdentifier(),geometryId:t.getIdentifier(),levelId:n.getIdentifier(),name:s,venueId:n.getDrawing().getVenueModel().getIdentifier(),url:o?"data:image/svg+xml;utf8,".concat(encodeURIComponent(o)):""},geometry:{type:it,coordinates:[i,r]}}})}}},{key:"getLabelLayer",value:function(){return{type:"FeatureCollection",features:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).flatMap(function(t){return t.getData().getGeometries()}).filter(function(t){return t.getDisplayName()&&!t.isIcon()}).map(function(t){var e=_(t.getLabelArea(),2),i=e[0],r=e[1],n=t.getLabelStyle(),o=n.fill,s=n.zmin,a=t.getLevel();return{type:"Feature",properties:{id:t.getIdentifier(),geometryId:t.getIdentifier(),levelId:a.getIdentifier(),venueId:a.getDrawing().getVenueModel().getIdentifier(),name:t.getDisplayName(),minZoom:s||15,textFillColor:o.toLowerCase()},geometry:{type:it,coordinates:[i,r]}}})}}},{key:"getGeometryLayer",value:function(){return{type:"FeatureCollection",features:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).flatMap(function(t){return t.getData().getGeometries()}).filter(function(t){return t.getType()!==it}).map(function(t){var e=t.getHighlightedStyle()||{},i=e.m,r=e.o,n=e.w,o=g({},t.getStyle()),s=o.m,a=o.o,l=o.w,c=st,h=at,u=lt,p=t.getLevel();return{type:"Feature",properties:{id:t.getIdentifier(),fillColor:(i||s||c).toLowerCase(),geometryId:t.getIdentifier(),levelId:p.getIdentifier(),venueId:p.getDrawing().getVenueModel().getIdentifier(),outlineColor:(r||a||h).toLowerCase(),outlineWidth:Number(((n||l||u)/3).toFixed(2)),zIndex:t.getZIndex()},geometry:{type:t.getType(),coordinates:t.getCoordinates()}}})}}},{key:"getFootprintLayer",value:function(t){return{type:"FeatureCollection",features:t.flatMap(function(t){return t.getData().getLevels().map(function(e){var i=e.getGeometries().map(function(t){return t.zIndex}).filter(function(t){return void 0!==t}),r=e.getGeometries().map(function(t){return t.properties.stackIndex}).filter(function(t){return void 0!==t}),n=Math.max.apply(Math,x(r))||1,o=Math.max.apply(Math,x(i))||1,s=e.getIdentifier(),a=t.getLevel(s).getData().levelData.geometry;return{type:"Feature",properties:{isFootprint:!0,levelId:s,venueId:t.getIdentifier(),zIndex:o+1,priority:n+1},geometry:{type:"MultiPolygon",coordinates:a.coordinates}}})})}}}]),Be=c(function t(){s(this,t)},null,[{key:"getStyle",value:function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e={styles:[{dataLayer:ht.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:["get","zIndex"]},{dataLayer:ht.FOOTPRINT,when:["==",["geometry-type"],"Point"],technique:"text",color:"black",size:16,text:["get","venueName"],priority:["get","priority"]},{dataLayer:ht.VECTOR,when:["==",["geometry-type"],"Polygon"],technique:"polygon",color:["get","fillColor"],renderOrder:["get","zIndex"]},{dataLayer:ht.VECTOR,technique:"solid-line",color:["get","outlineColor"],width:["get","outlineWidth"],renderOrder:["get","zIndex"]},{dataLayer:ht.TEXT,minZoomLevel:["get","minZoom"],technique:"text",color:["get","textFillColor"],size:13,text:["get","name"],priority:60},{dataLayer:ht.ICON,minZoomLevel:16,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}],assets:{}};return(arguments.length>
20&&void 0!==arguments[0]?arguments[0]:[]).forEach(function(t){var i="texture"+t.properties.name;e.assets[i]||(e.assets[i]={url:t.properties.url,preload:!0})}),t.forEach(function(t){var i,r=t.getData().getHighlightedStyle(),n=r.m,o=r.o,s=r.w;(i=e.styles).push.apply(i,[{dataLayer:ht.VECTOR,when:["==",["get","id"],t.id],technique:"polygon",color:n,renderOrder:["get","zIndex"]},{dataLayer:ht.VECTOR,when:["==",["get","id"],t.id],technique:"solid-line",color:o,width:s,renderOrder:["get","zIndex"]}])}),new H.map.render.harp.Style(e)}}]),Ve=function(){function t(){s(this,t)}return c(t,null,[{key:"getIconsTextures",value:function(){var t={},e={},i=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(function(t,e){var i=e.properties.name;return t[i]||(t[i]=[]),t[i].push(e),t},{});return Object.keys(i).forEach(function(r){var n="texture".concat(r),o="sprite".concat(r),s=i[r][0].properties.url;t[n]={url:s,sprites:h({},o,[0,0,50,50])},i[r].forEach(function(t){var i=t.properties;e["icon".concat(i.name)]={filter:{name:i.name,$zoom:{min:16}},draw:{points:{interactive:!0,priority:1,size:[[15,"50%"],[16,"55%"],[17,"60%"],[18,"65%"],[19,"75%"],[20,"80%"],[21,"100%"]],texture:n,sprite:o}}}})}),{textures:t,iconLayers:e}}},{key:"getFootprintLayer",value:function(){return{data:{source:"venues",layer:ht.FOOTPRINT},draw:{lines:{color:"#4E5663",width:[[0,"1px"],[6,"1px"],[7,"2px"],[18,"2px"],[19,"4px"],[24,"4px"]],order:"function() { return feature.zIndex }"},points:{color:"[0, 0, 0, 0]",size:"0px",order:3,priority:"function() { return feature.priority }",text:{anchor:"center",collide:!1,font:{fill:"black",size:"16px"},text_source:"function() { return feature.venueName }"}}}}}},{key:"getGeometryLayer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e={};if(t.length){var i=t[0].getData().getHighlightedStyle(),r=i.m,n=i.o,o=i.w;e={filter:{id:t.map(function(t){return t.id})},draw:{polygons:{interactive:!0,color:r},lines:{color:n,width:o}}}}return{data:{source:"venues",layer:ht.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:e}}},{key:"getTextLayer",value:function(){return{filter:{$zoom:{min:18}},data:{source:"venues",layer:ht.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:13},text_source:"function() { return feature.name }"}}}}}},{key:"getIconLayer",value:function(t){return g({data:{source:"venues",layer:ht.ICON}},t)}},{key:"getStyle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=t.getIconsTextures(e),n=r.textures,o=r.iconLayers,s={venue_footprints:t.getFootprintLayer(),venue_geometries:t.getGeometryLayer(i),venue_labels:t.getTextLayer(),venue_icons:t.getIconLayer(o)},a=H.gl.yaml.dump({sources:{venues:{max_zoom:24,type:"GeoJSONTileSource"}},layers:s,textures:n});return new H.map.render.webgl.Style(a)}}])}(),Ge={type:"FeatureCollection",features:[]}
2,He={extent:4096,indexMaxZoom:0,maxZoom:24,tolerance:3},qe=function(){function t(e){var i;return s(this,t),(i=o(this,t,[e])).venues=[],i.activeVenue=null,i.dataLayers_={},i.tileIndexes_={},i.addEventListener(ze.EVENTS.ACTIVE_VENUE_CHANGE,i.activeVenueChangeHandler_,void 0,i),i}return d(t,H.map.provider.RemoteTileProvider),c(t,[{key:"setStyle",value:function(t){return this.setStyleInternal(t)}},{key:"getStyle",value:function(){return this.getStyleInternal()}},{key:"isFeatureVisible_",value:function(t){var e=t.properties;return!!this.activeVenue.getActiveLevels().some(function(t){return t.id===e.levelId})}},{key:"requestInternal",value:function(t,e,i,r){var n=this,o=function(r){for(var n=0;n<r.length;n+=1)r[n]=r[n].map(function(r){return mt(r,i,t,e,He.extent)})},s={};return Object.keys(this.tileIndexes_).forEach(function(r){var a=n.tileIndexes_[r].getTile(i,t,e);s[r]=a?function(t){var e=[],i=t&&t.features;if(i)for(var r=0,n=i.length;r<n;r+=1){var o=i[r],s=o.type,a=void 0,l=!1;switch(s){case 1:a={type:"MultiPoint",coordinates:o.geometry.map(function(t){return t.slice()})};break;case 2:case 3:a={type:nt,coordinates:o.geometry.map(function(t){return t.map(function(t){return t.slice()})})},3===s&&null==(a=dt(a))&&(l=!0);break;default:l=!0}l||e.push({geometry:a,id:o.id,properties:o.tags,type:"Feature"})}return{type:"FeatureCollection",features:e}}(a):Ge,s[r].features=s[r].features.filter(function(t){return n.isFeatureVisible_(t)});for(var l=0;l<s[r].features.length;l+=1){var c=s[r].features[l],h=c.geometry.type;if(h===rt||h===nt)o(c.geometry.coordinates);else if(h===ot)c.geometry.coordinates.map(o);else for(var u=c.geometry.coordinates,p=0;p<u.length;p+=1)u[p]=mt(u[p],i,t,e,He.extent)}}),r(s),{cancel:function(){}}}},{key:"getActiveVenue",value:function(){return this.activeVenue}},{key:"getVenue",value:function(t){return t?this.venues.find(function(e){return e.getIdentifier()===t}):this.activeVenue}},{key:"setActiveVenue",value:function(t){var e=this.activeVenue;this.activeVenue=t,this.dispatchEvent(new H.util.ChangeEvent(ze.EVENTS.ACTIVE_VENUE_CHANGE,t,e)),this.reload()}},{key:"addVenue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(t instanceof ze))throw new Error("Invalid argument");var i=t.getIdentifier();if(this.getVenue(i))throw new Error("Please invoke provider.removeVenue to remove old instance of venue ".concat(i," before adding new"));t.setParentEventTarget(this),this.venues.push(t),e||(this.reloadData_(),this.reloadStyle_())}},{key:"addVenues",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.length>0&&(e.forEach(function(e){e instanceof ze&&t.addVenue(e,!0)}),this.reloadData_(),this.reloadStyle_())}},{key:"removeVenue",value:function(t){if(t instanceof ze&&this.venues.indexOf(t)>-1){var e=t.getIdentifier();this.activeVenue&&this.activeVenue.getIdentifier()===e&&this.setActiveVenue(null),this.venues.splice(this.venues.indexOf(t),1),this.reloadData_(),this.reloadStyle_(),this.reload()}}},{key:"getFeatureProxy",value:function(t,e,i){var r=t.geometryId,n=t.venueId,o=this.getVenue(n);return r?i(o.getGeometries().find(function(t){return t.id===r})):o&&i(o),!0}},{key:"addVenueEventListeners_",value:function(t){t&&(t.addEventListener(ze.EVENTS.GEOMETRY_HIGHLIGHT,this.geometryHighlightHandler_,void 0,this),t.addEventListener(ze.EVENTS.LEVEL_CHANGE,this.levelChangeHandler_,void 0,this),t.addEventListener(ze.EVENTS.DRAWING_CHANGE,this.drawingChangeHandler_,void 0,this))}},{key:"removeVenueEventListeners_",value:function(t){t&&(t.removeEventListener(ze.EVENTS.GEOMETRY_HIGHLIGHT,this.geometryHighlightHandler_,void 0,this),t.removeEventListener(ze.EVENTS.LEVEL_CHANGE,this.levelChangeHandler_,void 0,this),t.removeEventListener(ze.EVENTS.DRAWING_CHANGE,this.drawingChangeHandler_,void 0,this))}},{key:"activeVenueChangeHandler_",value:function(t){var e=t.oldValue,i=t.newValue;e&&(this.removeVenueEventListeners_(e),e.updateMapObjectsVisibility_()),i&&(this.addVenueEventListeners_(i),i.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 t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.keys(ht),i=ht.FOOTPRINT,r=ht.ICON,n=ht.TEXT,o=ht.VECTOR;e.forEach(function(e){switch(e){case o:t.dataLayers_[o]=je.getGeometryLayer(t.venues);break;case i:t.dataLayers_[i]=je.getFootprintLayer(t.venues);break;case r:t.dataLayers_[r]=je.getIconLayer(t.venues);break;case n:t.dataLayers_[n]=je.getLabelLayer(t.venues);break;default:throw new Error("Unsupported Layer ".concat(e))}})}},{key:"createTileIndexes_",value:function(){var t=this;(arguments.length>
20&&void 0!==arguments[0]?arguments[0]:Object.keys(ht)).forEach(function(e){t.tileIndexes_[e]=new tt(t.dataLayers_[e],He)})}},{key:"reloadData_",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.keys(ht);this.createDataLayers_(t),this.createTileIndexes_(t)}},{key:"reloadStyle_",value:function(t){var e=this.dataLayers_[ht.ICON]?this.dataLayers_[ht.ICON].features:[];this.getEngineType()===H.Map.EngineType.WEBGL?this.setStyle(Ve.getStyle(e,t)):this.getEngineType()===H.Map.EngineType.HARP&&this.setStyle(Be.getStyle(e,t))}},{key:"providesGeoJSON",value:function(){return!0}}])}(),We=new H.map.SpatialStyle({strokeColor:"#1ab4bf",lineWidth:3}),Xe=new H.map.SpatialStyle({strokeColor:"#1ab4bf",lineWidth:3}),Ye=new H.map.Icon("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI1MCIgdmlld0JveD0iMCAwIDQwIDUwIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHBhdGggaWQ9ImIiIGQ9Ik0zNC4yNSAzMS42NTJBMTkuMDE1IDE5LjAxNSAwIDAgMCAzOSAxOS4wNkMzOSA4LjU0OSAzMC40NzggMCAyMCAwUzEgOC41NSAxIDE5LjA1OWMwIDQuODIzIDEuNzk1IDkuMjMzIDQuNzUgMTIuNTkzTDE5Ljk3NSA0NiAzNC4yNSAzMS42NTJ6Ii8+PHBhdGggaWQ9ImEiIGQ9Ik0zNC4yNSAzMS42NTJBMTkuMDE1IDE5LjAxNSAwIDAgMCAzOSAxOS4wNkMzOSA4LjU0OSAzMC40NzggMCAyMCAwUzEgOC41NSAxIDE5LjA1OWMwIDQuODIzIDEuNzk1IDkuMjMzIDQuNzUgMTIuNTkzTDE5Ljk3NSA0NiAzNC4yNSAzMS42NTJ6Ii8+PG1hc2sgaWQ9ImMiIHdpZHRoPSIzOCIgaGVpZ2h0PSI0NiIgeD0iMCIgeT0iMCIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYSIvPjwvbWFzaz48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48ZWxsaXBzZSBjeD0iMjAiIGN5PSI0NS4xNiIgZmlsbD0iI0ZGRiIgc3Ryb2tlPSIjOTc5Nzk3IiBzdHJva2Utd2lkdGg9Ii4yNSIgcng9IjMuNSIgcnk9IjMuNSIvPjx1c2UgZmlsbD0iIzAxQjZCMiIgeGxpbms6aHJlZj0iI2IiLz48cGF0aCBmaWxsPSIjMzIzMjMyIiBmaWxsLW9wYWNpdHk9Ii41IiBkPSJNMTEuODEgMzcuNjZoMTYuMzhsLTguMiA4eiIvPjx1c2Ugc3Ryb2tlPSIjNDE2QTg2IiBzdHJva2Utd2lkdGg9Ii41IiBtYXNrPSJ1cmwoI2MpIiB4bGluazpocmVmPSIjYSIvPjxlbGxpcHNlIGN4PSIxOS44MSIgY3k9IjE5LjE5IiBmaWxsPSIjRkZGIiByeD0iNC44MSIgcnk9IjQuODEiLz48L2c+PC9zdmc+"),Ke=new H.map.Icon("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI1MCIgdmlld0JveD0iMCAwIDQwIDUwIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0zNC4yNSAzMS42NTJBMTkuMDE1IDE5LjAxNSAwIDAgMCAzOSAxOS4wNkMzOSA4LjU0OSAzMC40NzggMCAyMCAwUzEgOC41NSAxIDE5LjA1OWMwIDQuODIzIDEuNzk1IDkuMjMzIDQuNzUgMTIuNTkzTDE5Ljk3NSA0NiAzMi44MyAzMy4xMDRjLjQwNy0uMzc0IDEuNDE5LTEuNDUyIDEuNDE5LTEuNDUyeiIvPjxtYXNrIGlkPSJjIiB3aWR0aD0iMzgiIGhlaWdodD0iNDYiIHg9IjAiIHk9IjAiIGZpbGw9IiNmZmYiPjx1c2UgeGxpbms6aHJlZj0iI2EiLz48L21hc2s+PGVsbGlwc2UgaWQ9ImIiIGN4PSIxOS44MDciIGN5PSIxOS4xNjgiIHJ4PSIxMi4zNjMiIHJ5PSIxMi4xOTciLz48bWFzayBpZD0iZCIgd2lkdGg9IjI1LjcyNSIgaGVpZ2h0PSIyNS4zOTQiIHg9Ii0uNSIgeT0iLS41Ij48cGF0aCBmaWxsPSIjZmZmIiBkPSJNNi45NDQgNi40NzFoMjUuNzI1djI1LjM5NEg2Ljk0NHoiLz48dXNlIHhsaW5rOmhyZWY9IiNiIi8+PC9tYXNrPjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxlbGxpcHNlIGN4PSIyMCIgY3k9IjQ1LjE2IiBmaWxsPSIjRkZGIiBzdHJva2U9IiM5Nzk3OTciIHN0cm9rZS13aWR0aD0iLjI1IiByeD0iMy41IiByeT0iMy41Ii8+PHVzZSBmaWxsPSIjMzIzMjMyIiB4bGluazpocmVmPSIjYSIvPjxwYXRoIGZpbGw9IiM3RDdEN0QiIGQ9Ik0xMi4wMTEgMzcuODA1aDE1Ljk3OGwtNy45MTYgOHoiLz48dXNlIHN0cm9rZT0iIzdDN0M3QyIgc3Ryb2tlLXdpZHRoPSIuNSIgbWFzaz0idXJsKCNlKSIgeGxpbms6aHJlZj0iI2EiLz48dXNlIHN0cm9rZT0iI0ZGRiIgc3Ryb2tlLXdpZHRoPSIuNSIgbWFzaz0idXJsKCNjKSIgeGxpbms6aHJlZj0iI2EiLz48ZWxsaXBzZSBmaWxsPSIjRkZGIiBjeD0iMTkuODA3IiBjeT0iMTkuMTY4IiByeD0iMTIuMzYzIiByeT0iMTIuMTk3Ii8+PHBhdGggZmlsbD0iIzMyMzIzMiIgZD0iTTYuODEyIDYuOTQ4aDYuNDV2Ni4zNjRoLTYuNDV6bTAgMTIuNzI3aDYuNDV2Ni4zNjRoLTYuNDV6bTYuNDUtNi4zNjNoNi40NXY2LjM2NGgtNi40NXptMCAxMi43MjdoNi40NXY2LjM2NGgtNi40NXptNi40NS0xOS4wOTFoNi40NXY2LjM2NGgtNi40NXptMCAxMi43MjdoNi40NXY2LjM2NGgtNi40NXptNi40NS02LjM2M2g2LjQ1djYuMzY0aC02LjQ1em0wIDEyLjcyN2g2LjQ1djYuMzY0aC02LjQ1eiIvPjx1c2Ugc3Ryb2tlPSIjRkZGIiBtYXNrPSJ1cmwoI2QpIiB4bGluazpocmVmPSIjYiIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSIvPjwvZz48L3N2Zz4="),Ze=function(t,e,i){return i===$e.ObjectType.SEGMENT_START_MARKER?0===t?Ye:null:i===$e.ObjectType.SEGMENT_FINISH_MARKER?1===e.length||t===e.length-1?Ke:null:"indoor"===e[t].departure.place.type?We:Xe},$e=function(){function t(e,i){s(this,t),this.indoorMapObjects_=null,this.outdoorMapObjects_=null,this.createRouteObjects_(e,i)}return c(t,[{key:"createRouteObjects_",value:function(e){var i=this,r=e.sections,n=void 0===r?[]:r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ze;this.indoorMapObjects_={},this.outdoorMapObjects_=new H.map.Group;for(var s=function(){var e,r,s=n[a],l=s.departure.place,c=l.id,h=l.type,u=H.util.flexiblePolyline.decode(s.polyline).polyline,p=o(a,n,t.ObjectType.SEGMENT_START_MARKER);p&&(e=new H.map.Marker(s.departure.place.location,{icon:p}));var d=o(a,n,t.ObjectType.SEGMENT_FINISH_MARKER);d&&(r=new H.map.Marker(s.arrival.place.location,{icon:d}));var m=o(a,n,t.ObjectType.SEGMENT_POLYLINE);if("indoor"===h){var f=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=new Map,i=new H.geo.LineString,r=_(t[0],3)[2];return e.set(r,[i]),t.forEach(function(t){var n;t[2]!==r&&(r=t[2],i=new H.geo.LineString,e.has(r)?e.get(r).push(i):e.set(r,[i])),(n=i).pushLatLngAlt.apply(n,x(t))}),e}(u),y=Array.from(f.keys()).reduce(function(t,e){return t[e]||(t[e]=new H.map.Group),t},{});m&&f.forEach(function(t,e){t.forEach(function(t){if(t.getPointCount()>1){var i=new H.map.Polyline(t,{style:m});y[e].addObject(i)}})}),e&&y[s.departure.place.location.lvl].addObject(e),r&&y[s.arrival.place.location.lvl].addObject(r),i.indoorMapObjects_[c]=g(g({},i.indoorMapObjects_[c]||{}),y)}else{if(m){var v=new H.geo.LineString(u.flatMap(function(t){return[t[0],t[1],0]})),b=new H.map.Polyline(v,{style:m});i.outdoorMapObjects_.addObject(b)}e&&i.outdoorMapObjects_.addObject(e),r&&i.outdoorMapObjects_.addObject(r)}},a=0;a<n.length;a++)s()}},{key:"getIndoorObjects",value:function(){return this.indoorMapObjects_}},{key:"getOutdoorObjects",value:function(){return this.outdoorMapObjects_}}])}();$e.ObjectType={SEGMENT_START_MARKER:1,SEGMENT_FINISH_MARKER:2,SEGMENT_POLYLINE:3};var Je=function(){function t(e){var i;s(this,t),i=o(this,t,[t,g(g({},e),{},{baseUrl:void 0})]);var r={apiKey:e.apikey,baseUrl:e.baseUrl,token:e.token},n={apiKey:r.apiKey,token:r.token};r.apiKey||(r.apiKey=i.getUrl().getQuery().apikey);var a=e.useLegacy||!1;return i.venueService_=new Oe(r,a),n.apiKey||(n.apiKey=i.getUrl().getQuery().apikey),e.rout
2ingBaseUrl&&(n.baseUrl=e.routingBaseUrl),e.token&&(i.routingService_=new Ne(n)),i}return d(t,H.service.Service),c(t,[{key:"loadVenue",value:function(t){return console.warn("Venue service version 1 is no longer supported hence "+t+" could not be loaded"),Promise.resolve()}},{key:"calculateRoute",value:function(t){return console.warn("HERE Indoor Routing is deprecated and will be removed soon."),this.routingService_.calculateRoute(t)}}])}();Je.CONFIG_KEY="venues";var Qe=function(){function t(e){var i;s(this,t),i=o(this,t,[t,g(g({},e),{},{baseUrl:void 0})]);var r={apiKey:e.apikey,baseUrl:e.baseUrl,token:e.token,hrn:e.hrn};r.apiKey||(r.apiKey=i.getUrl().getQuery().apikey);var n=e.useLegacy||!1;return i.venueService_=new Oe(r,n),i}return d(t,H.service.Service),c(t,[{key:"loadVenue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.venueService_.load(t,e).then(function(t){return new ze(t)})}},{key:"getMapInfoList",value:function(){return this.venueService_.getSupportedMapList()}}])}();Qe.CONFIG_KEY="indoorMaps",H.service.Platform.prototype.getVenuesService=function(t,e){var i=Qe;return 1!==e&&e?e!==ut.v2||t.token||(t.hrn?t.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"),i=Je),this.createService(i,t)},Qe.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 ti=function(){function t(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,t),(i=o(this,t)).provider_=null,i.levelSelectorUI_=null,i.setAlignment(r&&r.alignment||H.ui.LayoutAlignment.RIGHT_BOTTOM),i.addClass("venues-ui"),e instanceof ze&&i.setVenue(e),i}return d(t,H.ui.Control),c(t,[{key:"renderInternal",value:function(e,i){b(t,"renderInternal",this,3)([e,i]),this.createLevelSelectorUI_(e),this.venue&&this.setVenue(this.venue)}},{key:"setVenue",value:function(t){t instanceof ze&&(this.removeEventListeners_(),this.venue=t,this.provider_=t.getParentEventTarget(),this.update_(),this.addEventListeners_())}},{key:"createLevelSelectorUI_",value:function(t){var e=this;t.innerHTML="",this.levelSelectorUI_=null,this.levelSelectorUI_=new ge(t,null,null,function(t){return e.venue.setActiveLevelIndex(t)})}},{key:"update_",value:function(){if(this.levelSelectorUI_){var t=this.venue.getActiveDrawing().getData(),e=this.venue.getData().getDisplaySettings();this.levelSelectorUI_.update(t,e),this.levelChangeHandler_()}}},{key:"addEventListeners_",value:function(){this.venue&&(this.venue.addEventListener(ze.EVENTS.LEVEL_CHANGE,this.levelChangeHandler_,void 0,this),this.venue.addEventListener(ze.EVENTS.DRAWING_CHANGE,this.drawingChangeHandler_,void 0,this)),this.provider_&&this.provider_.addEventListener(ze.EVENTS.ACTIVE_VENUE_CHANGE,this.activeVenueChangeHandler_,void 0,this)}},{key:"removeEventListeners_",value:function(){this.venue&&(this.venue.removeEventListener(ze.EVENTS.LEVEL_CHANGE,this.levelChangeHandler_,void 0,this),this.venue.removeEventListener(ze.EVENTS.DRAWING_CHANGE,this.drawingChangeHandler_,void 0,this)),this.provider_&&this.provider_.removeEventListener(ze.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(t){this.setVenue(t.newValue)}}])}(),ei=function(){function t(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,t),(i=o(this,t)).provider_=null,i.drawingSelectorUI_=null,i.addClass("venues-ui"),i.setAlignment(r&&r.alignment||H.ui.LayoutAlignment.RIGHT_BOTTOM),e instanceof ze&&i.setVenue(e),i}return d(t,H.ui.Control),c(t,[{key:"renderInternal",value:function(e,i){b(t,"renderInternal",this,3)([e,i]),this.createDrawingSelectorUI_(e),this.venue&&this.setVenue(this.venue)}},{key:"setVenue",value:function(t){t instanceof ze&&(this.removeEventListeners_(),this.venue=t,this.provider_=t.getParentEventTarget(),this.drawingSelectorUI_&&this.drawingSelectorUI_.update(t.getData()),this.addEventListeners_())}},{key:"createDrawingSelectorUI_",value:function(t){var e=this;t.innerHTML="",this.drawingSelectorUI_=null,this.drawingSelectorUI_=new ue(t,null,function(t){return e.venue.setActiveDrawing(t)})}},{key:"addEventListeners_",value:function(){this.venue&&this.venue.addEventListener(ze.EVENTS.DRAWING_CHANGE,this.drawingChangeHandler_,void 0,this),this.provider_&&this.provider_.addEventListener(ze.EVENTS.ACTIVE_VENUE_CHANGE,this.activeVenueChangeHandler_,void 0,this)}},{key:"removeEventListeners_",value:function(){this.venue&&this.venue.removeEventListener(ze.EVENTS.DRAWING_CHANGE,this.drawingChangeHandler_,void 0,this),this.provider_&&this.provider_.removeEventListener(ze.EVENTS.ACTIVE_VENUE_CHANGE,this.activeVenueChangeHandler_,void 0,this)}},{key:"drawingChangeHandler_",value:function(){this.drawingSelectorUI_.switch(this.venue.getActiveDrawing().id)}},{key:"activeVenueChangeHandler_",value:function(t){this.setVenue(t.newValue)}}])}(),ii=Object.freeze({__proto__:null,DrawingControl:ei,LevelControl:ti});return e(".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,
20.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;
2\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}"),t.Drawing=M,t.Geometry=E,t.Level=A,t.Provider=qe,t.Route=$e,t.Service=Je,t.Service2=Qe,t.Venue=ze,t.ui=ii,Object.defineProperty(t,"__esModule",{value:!0}),t}({}),H.__harp_worker_decoders__='(()=>{var __webpack_modules__={3577:(t,e,r)=>{"use strict";const i=r(5133);var n=r(5218),s=r(6918);s.util.Long=i,s.configure(),t.exports=n},5218:(t,e,r)=>{"use strict";var i,n,s,o=r(6918),a=o.Reader,u=o.util,l=o.roots.default||(o.roots.default={});l.com=((s={}).mapbox=((n={}).pb=((i={}).Tile=function(){function t(t){if(this.layers=[],t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}var e,r;return t.prototype.layers=u.emptyArray,t.decode=function(t,e){t instanceof a||(t=a.create(t));for(var r=void 0===e?t.len:t.pos+e,i=new l.com.mapbox.pb.Tile;t.pos<r;){var n=t.uint32();n>>>3==3?(i.layers&&i.layers.length||(i.layers=[]),i.layers.push(l.com.mapbox.pb.Tile.Layer.decode(t,t.uint32()))):t.skipType(7&n)}return i},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.fromObject=function(t){if(t instanceof l.com.mapbox.pb.Tile)return t;var e=new l.com.mapbox.pb.Tile;if(t.layers){if(!Array.isArray(t.layers))throw TypeError(".com.mapbox.pb.Tile.layers: array expected");e.layers=[];for(var r=0;r<t.layers.length;++r){if("object"!=typeof t.layers[r])throw TypeError(".com.mapbox.pb.Tile.layers: object expected");e.layers[r]=l.com.mapbox.pb.Tile.Layer.fromObject(t.layers[r])}}return e},t.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.layers=[]),t.layers&&t.layers.length){r.layers=[];for(var i=0;i<t.layers.length;++i)r.layers[i]=l.com.mapbox.pb.Tile.Layer.toObject(t.layers[i],e)}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},t.GeomType=(e={},(r=Object.create(e))[e[0]="UNKNOWN"]=0,r[e[1]="POINT"]=1,r[e[2]="LINESTRING"]=2,r[e[3]="POLYGON"]=3,r),t.Value=function(){function t(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}return t.prototype.stringValue="",t.prototype.floatValue=0,t.prototype.doubleValue=0,t.prototype.intValue=u.Long?u.Long.fromBits(0,0,!1):0,t.prototype.uintValue=u.Long?u.Long.fromBits(0,0,!0):0,t.prototype.sintValue=u.Long?u.Long.fromBits(0,0,!1):0,t.prototype.boolValue=!1,t.decode=function(t,e){t instanceof a||(t=a.create(t));for(var r=void 0===e?t.len:t.pos+e,i=new l.com.mapbox.pb.Tile.Value;t.pos<r;){var n=t.uint32();switch(n>>>3){case 1:i.stringValue=t.string();break;case 2:i.floatValue=t.float();break;case 3:i.doubleValue=t.double();break;case 4:i.intValue=t.int64();break;case 5:i.uintValue=t.uint64();break;case 6:i.sintValue=t.sint64();break;case 7:i.boolValue=t.bool();break;default:t.skipType(7&n)}}return i},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.fromObject=function(t){if(t instanceof l.com.mapbox.pb.Tile.Value)return t;var e=new l.com.mapbox.pb.Tile.Value;return null!=t.stringValue&&(e.stringValue=String(t.stringValue)),null!=t.floatValue&&(e.floatValue=Number(t.floatValue)),null!=t.doubleValue&&(e.doubleValue=Number(t.doubleValue)),null!=t.intValue&&(u.Long?(e.intValue=u.Long.fromValue(t.intValue)).unsigned=!1:"string"==typeof t.intValue?e.intValue=parseInt(t.intValue,10):"number"==typeof t.intValue?e.intValue=t.intValue:"object"==typeof t.intValue&&(e.intValue=new u.LongBits(t.intValue.low>>>0,t.intValue.high>>>0).toNumber())),null!=t.uintValue&&(u.Long?(e.uintValue=u.Long.fromValue(t.uintValue)).unsigned=!0:"string"==typeof t.uintValue?e.uintValue=parseInt(t.uintValue,10):"number"==typeof t.uintValue?e.uintValue=t.uintValue:"object"==typeof t.uintValue&&(e.uintValue=new u.LongBits(t.uintValue.low>>>0,t.uintValue.high>>>0).toNumber(!0))),null!=t.sintValue&&(u.Long?(e.sintValue=u.Long.fromValue(t.sintValue)).unsigned=!1:"string"==typeof t.sintValue?e.sintValue=parseInt(t.sintValue,10):"number"==typeof t.sintValue?e.sintValue=t.sintValue:"object"==typeof t.sintValue&&(e.sintValue=new u.LongBits(t.sintValue.low>>>0,t.sintValue.high>>>0).toNumber())),null!=t.boolValue&&(e.boolValue=Boolean(t.boolValue)),e},t.toObject=function(t,e){e||(e={});var r={};if(e.defaults){if(r.stringValue="",r.floatValue=0,r.doubleValue=0,u.Long){var i=new u.Long(0,0,!1);r.intValue=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.intValue=e.longs===String?"0":0;u.Long?(i=new u.Long(0,0,!0),r.uintValue=e.longs===String?i.toString():e.longs===Number?i.toNumber():i):r.uintValue=e.longs===String?"0":0,u.Long?(i=new u.Long(0,0,!1),r.sintValue=e.longs===String?i.toString():e.longs===Number?i.toNumber():i):r.sintValue=e.longs===String?"0":0,r.boolValue=!1}
vendor: 12,731 bytes, line 2
2return null!=t.stringValue&&t.hasOwnProperty("stringValue")&&(r.stringValue=t.stringValue),null!=t.floatValue&&t.hasOwnProperty("floatValue")&&(r.floatValue=e.json&&!isFinite(t.floatValue)?String(t.floatValue):t.floatValue),null!=t.doubleValue&&t.hasOwnProperty("doubleValue")&&(r.doubleValue=e.json&&!isFinite(t.doubleValue)?String(t.doubleValue):t.doubleValue),null!=t.intValue&&t.hasOwnProperty("intValue")&&("number"==typeof t.intValue?r.intValue=e.longs===String?String(t.intValue):t.intValue:r.intValue=e.longs===String?u.Long.prototype.toString.call(t.intValue):e.longs===Number?new u.LongBits(t.intValue.low>>>0,t.intValue.high>>>0).toNumber():t.intValue),null!=t.uintValue&&t.hasOwnProperty("uintValue")&&("number"==typeof t.uintValue?r.uintValue=e.longs===String?String(t.uintValue):t.uintValue:r.uintValue=e.longs===String?u.Long.prototype.toString.call(t.uintValue):e.longs===Number?new u.LongBits(t.uintValue.low>>>0,t.uintValue.high>>>0).toNumber(!0):t.uintValue),null!=t.sintValue&&t.hasOwnProperty("sintValue")&&("number"==typeof t.sintValue?r.sintValue=e.longs===String?String(t.sintValue):t.sintValue:r.sintValue=e.longs===String?u.Long.prototype.toString.call(t.sintValue):e.longs===Number?new u.LongBits(t.sintValue.low>>>0,t.sintValue.high>>>0).toNumber():t.sintValue),null!=t.boolValue&&t.hasOwnProperty("boolValue")&&(r.boolValue=t.boolValue),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},t}(),t.Feature=function(){function t(t){if(this.tags=[],this.geometry=[],t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}return t.prototype.id=u.Long?u.Long.fromBits(0,0,!0):0,t.prototype.tags=u.emptyArray,t.prototype.type=0,t.prototype.geometry=u.emptyArray,t.decode=function(t,e){t instanceof a||(t=a.create(t));for(var r=void 0===e?t.len:t.pos+e,i=new l.com.mapbox.pb.Tile.Feature;t.pos<r;){var n=t.uint32();switch(n>>>3){case 1:i.id=t.uint64();break;case 2:if(i.tags&&i.tags.length||(i.tags=[]),2==(7&n))for(var s=t.uint32()+t.pos;t.pos<s;)i.tags.push(t.uint32());else i.tags.push(t.uint32());break;case 3:i.type=t.int32();break;case 4:if(i.geometry&&i.geometry.length||(i.geometry=[]),2==(7&n))for(s=t.uint32()+t.pos;t.pos<s;)i.geometry.push(t.uint32());else i.geometry.push(t.uint32());break;default:t.skipType(7&n)}}return i},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.fromObject=function(t){if(t instanceof l.com.mapbox.pb.Tile.Feature)return t;var e=new l.com.mapbox.pb.Tile.Feature;if(null!=t.id&&(u.Long?(e.id=u.Long.fromValue(t.id)).unsigned=!0:"string"==typeof t.id?e.id=parseInt(t.id,10):"number"==typeof t.id?e.id=t.id:"object"==typeof t.id&&(e.id=new u.LongBits(t.id.low>>>0,t.id.high>>>0).toNumber(!0))),t.tags){if(!Array.isArray(t.tags))throw TypeError(".com.mapbox.pb.Tile.Feature.tags: array expected");e.tags=[];for(var r=0;r<t.tags.length;++r)e.tags[r]=t.tags[r]>>>0}switch(t.type){case"UNKNOWN":case 0:e.type=0;break;case"POINT":case 1:e.type=1;break;case"LINESTRING":case 2:e.type=2;break;case"POLYGON":case 3:e.type=3}if(t.geometry){if(!Array.isArray(t.geometry))throw TypeError(".com.mapbox.pb.Tile.Feature.geometry: array expected");for(e.geometry=[],r=0;r<t.geometry.length;++r)e.geometry[r]=t.geometry[r]>>>0}return e},t.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.tags=[],r.geometry=[]),e.defaults){if(u.Long){var i=new u.Long(0,0,!0);r.id=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.id=e.longs===String?"0":0;r.type=e.enums===String?"UNKNOWN":0}if(null!=t.id&&t.hasOwnProperty("id")&&("number"==typeof t.id?r.id=e.longs===String?String(t.id):t.id:r.id=e.longs===String?u.Long.prototype.toString.call(t.id):e.longs===Number?new u.LongBits(t.id.low>>>0,t.id.high>>>0).toNumber(!0):t.id),t.tags&&t.tags.length){r.tags=[];for(var n=0;n<t.tags.length;++n)r.tags[n]=t.tags[n]}if(null!=t.type&&t.hasOwnProperty("type")&&(r.type=e.enums===String?l.com.mapbox.pb.Tile.GeomType[t.type]:t.type),t.geometry&&t.geometry.length)for(r.geometry=[],n=0;n<t.geometry.length;++n)r.geometry[n]=t.geometry[n];return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},t}(),t.Layer=function(){function t(t){if(this.features=[],this.keys=[],this.values=[],t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}return t.prototype.version=1,t.prototype.name="",t.prototype.features=u.emptyArray,t.prototype.keys=u.emptyArray,t.prototype.values=u.emptyArray,t.prototype.extent=4096,t.decode=function(t,e){t instanceof a||(t=a.create(t));for(var r=void 0===e?t.len:t.pos+e,i=new l.com.mapbox.pb.Tile.Layer;t.pos<r;){var n=t.uint32();switch(n>>>3){case 15:i.version=t.uint32();break;case 1:i.name=t.string();break;case 2:i.features&&i.features.length||(i.features=[]),i.features.push(l.com.mapbox.pb.Tile.Feature.decode(t,t.uint32()));break;case 3:i.keys&&i.keys.length||(i.keys=[]),i.keys.push(t.string());break;case 4:i.values&&i.values.length||(i.values=[]),i.values.push(l.com.mapbox.pb.Tile.Value.decode(t,t.uint32()));break;case 5:i.extent=t.uint32();break;default:t.skipType(7&n)}}if(!i.hasOwnProperty("version"))throw u.ProtocolError("missing required \'version\'",{instance:i});if(!i.hasOwnProperty("name"))throw u.ProtocolError("missing required \'name\'",{instance:i});return i},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.fromObject=function(t){if(t instanceof l.com.mapbox.pb.Tile.Layer)return t;var e=new l.com.mapbox.pb.Tile.Layer;if(null!=t.version&&(e.version=t.version>>>0),null!=t.name&&(e.name=String(t.name)),t.features){if(!Array.isArray(t.features))throw TypeError(".com.mapbox.pb.Tile.Layer.features: array expected");e.features=[];for(var r=0;r<t.features.length;++r){if("object"!=typeof t.features[r])throw TypeError(".com.mapbox.pb.Tile.Layer.features: object expected");e.features[r]=l.com.mapbox.pb.Tile.Feature.fromObject(t.features[r])}}if(t.keys){if(!Array.isArray(t.keys))throw TypeError(".com.mapbox.pb.Tile.Layer.keys: array expected");for(e.keys=[],r=0;r<t.keys.length;++r)e.keys[r]=String(t.keys[r])}if(t.values){if(!Array.isArray(t.values))throw TypeError(".com.mapbox.pb.Tile.Layer.values: array expected");for(e.values=[],r=0;r<t.values.length;++r){if("object"!=typeof t.values[r])throw TypeError(".com.mapbox.pb.Tile.Layer.values: object expected");e.values[r]=l.com.mapbox.pb.Tile.Value.fromObject(t.values[r])}}return null!=t.extent&&(e.extent=t.extent>>>0),e},t.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.features=[],r.keys=[],r.values=[]),e.defaults&&(r.name="",r.extent=4096,r.version=1),null!=t.name&&t.hasOwnProperty("name")&&(r.name=t.name),t.features&&t.features.length){r.features=[];for(var i=0;i<t.features.length;++i)r.features[i]=l.com.mapbox.pb.Tile.Feature.toObject(t.features[i],e)}if(t.keys&&t.keys.length)for(r.keys=[],i=0;i<t.keys.length;++i)r.keys[i]=t.keys[i];if(t.values&&t.values.length)for(r.values=[],i=0;i<t.values.length;++i)r.values[i]=l.com.mapbox.pb.Tile.Value.toObject(t.values[i],e);return null!=t.extent&&t.hasOwnProperty("extent")&&(r.extent=t.extent),null!=t.version&&t.hasOwnProperty("version")&&(r.version=t.version),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},t}(),t}(),i),n),s),t.exports=l},7018:t=>{"use strict";t.exports=function(t,e){for(var r=new Array(arguments.length-1),i=0,n=2,s=!0;n<arguments.length;)r[i++]=arguments[n++];return new Promise((function(n,o){r[i]=function(t){if(s)if(s=!1,t)o(t);else{for(var e=new Array(arguments.length-1),r=0;r<e.length;)e[r++]=arguments[r];n.apply(null,e)}};try{t.apply(e||null,r)}catch(t){s&&(s=!1,o(t))}}))}},2647:(t,e)=>{"use strict";var r=e;r.length=function(t){var e=t.length;if(!e)return 0;for(var r=0;--e%4>1&&"="===t.charAt(e);)++r;return Math.ceil(3*t.length)/4-r};for(var i=new Array(64),n=new Array(123),s=0;s<64;)n[i[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;r.encode=function(t,e,r){for(var n,s=null,o=[],a=0,u=0;e<r;){var l=t[e++];switch(u){case 0:o[a++]=i[l>>2],n=(3&l)<<4,u=1;break;case 1:o[a++]=i[n|l>>4],n=(15&l)<<2,u=2;break;case 2:o[a++]=i[n|l>>6],o[a++]=i[63&l],u=0}a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0)}return u&&(o[a++]=i[n],o[a++]=61,1===u&&(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";r.decode=function(t,e,r){for(var i,s=r,a=0,u=0;u<t.length;){var l=t.charCodeAt(u++);if(61===l&&a>1)break;if(void 0===(l=n[l]))throw Error(o);switch(a){case 0:i=l,a=1;break;case 1:e[r++]=i<<2|(48&l)>>4,i=l,a=2;break;case 2:e[r++]=(15&i)<<4|(60&l)>>2,i=l,a=3;break;case 3:e[r++]=(3&i)<<6|l,a=0}}if(1===a)throw Error(o);return r-s},r.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},2922:t=>{"use strict";function e(){this._listeners={}}t.exports=e,e.prototype.on=function(t,e,r){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:r||this}),this},e.prototype.off=function(t,e){if(void 0===t)this._listeners={};else if(void 0===e)this._listeners[t]=[];else for(var r=this._listeners[t],i=0;i<r.length;)r[i].fn===e?r.splice(i,1):++i;return this},e.prototype.emit=function(t){var e=this._listeners[t];if(e){for(var r=[],i=1;i<arguments.length;)r.push(arguments[i++]);for(i=0;i<e.length;)e[i].fn.apply(e[i++].ctx,r)}return this}},7955:t=>{"use strict";function e(t){return"undefined"!=typeof Float32Array?function(){var e=new Float32Array([-0]),r=new Uint8Array(e.buffer),i=128===r[3];function n(t,i,n){e[0]=t,i[n]=r[0],i[n+1]=r[1],i[n+2]=r[2],i[n+3]=r[3]}function s(t,i,n){e[0]=t,i[n]=r[3],i[n+1]=r[2],i[n+2]=r[1],i[n+3]=r[0]}function o(t,i){return r[0]=t[i],r[1]=t[i+1],r[2]=t[i+2],r[3]=t[i+3],e[0]}function a(t,i){return r[3]=t[i],r[2]=t[i+1],r[1]=t[i+2],r[0]=t[i+3],e[0]}t.writeFloatLE=i?n:s,t.writeFloatBE=i?s:n,t.readFloatLE=i?o:a,t.readFloatBE=i?a:o}():function(){function e(t,e,r,i){var n=e<0?1:0;if(n&&(e=-e),0===e)t(1/e>0?0:2147483648,r,i);else if(isNaN(e))t(2143289344,r,i);else if(e>34028234663852886e22)t((n<<31|2139095040)>>>0,r,i);else if(e<11754943508222875e-54)t((n<<31|Math.round(e/1401298464324817e-60))>>>0,r,i);else{var s=Math.floor(Math.log(e)/Math.LN2);t((n<<31|s+127<<23|8388607&Math.round(e*Math.pow(2,-s)*8388608))>>>0,r,i)}}function o(t,e,r){var i=t(e,r),n=2*(i>>31)+1,s=i>>>23&255,o=8388607&i;return 255===s?o?NaN:n*(1/0):0===s?1401298464324817e-60*n*o:n*Math.pow(2,s-150)*(o+8388608)}t.writeFloatLE=e.bind(null,r),t.writeFloatBE=e.bind(null,i),t.readFloatLE=o.bind(null,n),t.readFloatBE=o.bind(null,s)}(),"undefined"!=typeof Float64Array?function(){var e=new Float64Array([-0]),r=new Uint8Array(e.buffer),i=128===r[7];function n(t,i,n){e[0]=t,i[n]=r[0],i[n+1]=r[1],i[n+2]=r[2],i[n+3]=r[3],i[n+4]=r[4],i[n+5]=r[5],i[n+6]=r[6],i[n+7]=r[7]}function s(t,i,n){e[0]=t,i[n]=r[7],i[n+1]=r[6],i[n+2]=r[5],i[n+3]=r[4],i[n+4]=r[3],i[n+5]=r[2],i[n+6]=r[1],i[n+7]=r[0]}function o(t,i){return r[0]=t[i],r[1]=t[i+1],r[2]=t[i+2],r[3]=t[i+3],r[4]=t[i+4],r[5]=t[i+5],r[6]=t[i+6],r[7]=t[i+7],e[0]}function a(t,i){return r[7]=t[i],r[6]=t[i+1],r[5]=t[i+2],r[4]=t[i+3],r[3]=t[i+4],r[2]=t[i+5],r[1]=t[i+6],r[0]=t[i+7],e[0]}t.writeDoubleLE=i?n:s,t.writeDoubleBE=i?s:n,t.readDoubleLE=i?o:a,t.readDoubleBE=i?a:o}():function(){function e(t,e,r,i,n,s){var o=i<0?1:0;if(o&&(i=-i),0===i)t(0,n,s+e),t(1/i>0?0:2147483648,n,s+r);else if(isNaN(i))t(0,n,s+e),t(2146959360,n,s+r);else if(i>17976931348623157e292)t(0,n,s+e),t((o<<31|2146435072)>>>0,n,s+r);else{var a;if(i<22250738585072014e-324)t((a=i/5e-324)>>>0,n,s+e),t((o<<31|a/4294967296)>>>0,n,s+r);else{var u=Math.floor(Math.log(i)/Math.LN2);1024===u&&(u=1023),t(4503599627370496*(a=i*Math.pow(2,-u))>>>0,n,s+e),t((o<<31|u+1023<<20|1048576*a&1048575)>>>0,n,s+r)}}}function o(t,e,r,i,n){var s=t(i,n+e),o=t(i,n+r),a=2*(o>>31)+1,u=o>>>20&2047,l=4294967296*(1048575&o)+s;return 2047===u?l?NaN:a*(1/0):0===u?5e-324*a*l:a*Math.pow(2,u-1075)*(l+4503599627370496)}t.writeDoubleLE=e.bind(null,r,0,4),t.writeDoubleBE=e.bind(null,i,4,0),t.readDoubleLE=o.bind(null,n,0,4),t.readDoubleBE=o.bind(null,s,4,0)}(),t}function r(t,e,r){e[r]=255&t,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function i(t,e,r){e[r]=t>>>24,e[r+1]=t>>>16&255,e[r+2]=t>>>8&255,e[r+3]=255&t}function n(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function s(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}t.exports=e(e)},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(t){}return null}module.exports=inquire},5374:t=>{"use strict";
2t.exports=function(t,e,r){var i=r||8192,n=i>>>1,s=null,o=i;return function(r){if(r<1||r>n)return t(r);o+r>i&&(s=t(i),o=0);var a=e.call(s,o,o+=r);return 7&o&&(o=1+(7|o)),a}}},5226:(t,e)=>{"use strict";var r=e;r.length=function(t){for(var e=0,r=0,i=0;i<t.length;++i)(r=t.charCodeAt(i))<128?e+=1:r<2048?e+=2:55296==(64512&r)&&56320==(64512&t.charCodeAt(i+1))?(++i,e+=4):e+=3;return e},r.read=function(t,e,r){if(r-e<1)return"";for(var i,n=null,s=[],o=0;e<r;)(i=t[e++])<128?s[o++]=i:i>191&&i<224?s[o++]=(31&i)<<6|63&t[e++]:i>239&&i<365?(i=((7&i)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++])-65536,s[o++]=55296+(i>>10),s[o++]=56320+(1023&i)):s[o++]=(15&i)<<12|(63&t[e++])<<6|63&t[e++],o>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,s)),o=0);return n?(o&&n.push(String.fromCharCode.apply(String,s.slice(0,o))),n.join("")):String.fromCharCode.apply(String,s.slice(0,o))},r.write=function(t,e,r){for(var i,n,s=r,o=0;o<t.length;++o)(i=t.charCodeAt(o))<128?e[r++]=i:i<2048?(e[r++]=i>>6|192,e[r++]=63&i|128):55296==(64512&i)&&56320==(64512&(n=t.charCodeAt(o+1)))?(i=65536+((1023&i)<<10)+(1023&n),++o,e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=63&i|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=63&i|128);return r-s}},6925:(t,e)=>{var r={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(t){return(t=Math.round(t))<0?0:t>255?255:t}function n(t){return t<0?0:t>1?1:t}function s(t){return"%"===t[t.length-1]?i(parseFloat(t)/100*255):i(parseInt(t))}function o(t){return"%"===t[t.length-1]?n(parseFloat(t)/100):n(parseFloat(t))}function a(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,n=t.replace(/ /g,"").toLowerCase();if(n in r)return r[n].slice();if("#"===n[0])return 4===n.length?(e=parseInt(n.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===n.length&&(e=parseInt(n.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=n.indexOf("("),l=n.indexOf(")");if(-1!==u&&l+1===n.length){var h=n.substr(0,u),c=n.substr(u+1,l-(u+1)).split(","),d=1;switch(h){case"rgba":if(4!==c.length)return null;d=o(c.pop());case"rgb":return 3!==c.length?null:[s(c[0]),s(c[1]),s(c[2]),d];case"hsla":if(4!==c.length)return null;d=o(c.pop());case"hsl":if(3!==c.length)return null;var p=(parseFloat(c[0])%360+360)%360/360,f=o(c[1]),m=o(c[2]),y=m<=.5?m*(f+1):m+f-m*f,g=2*m-y;return[i(255*a(g,y,p+1/3)),i(255*a(g,y,p)),i(255*a(g,y,p-1/3)),d];default:return null}}return null}}catch(t){}},242:(t,e,r)=>{"use strict";function i(t,e,r,s){for(var o,a=s,u=r-e>>1,l=r-e,h=t[e],c=t[e+1],d=t[r],p=t[r+1],f=e+3;f<r;f+=3){var m=n(t[f],t[f+1],h,c,d,p);if(m>a)o=f,a=m;else if(m===a){var y=Math.abs(f-u);y<l&&(o=f,l=y)}}a>s&&(o-e>3&&i(t,e,o,s),t[o+2]=a,r-o>3&&i(t,o,r,s))}function n(t,e,r,i,n,s){var o=n-r,a=s-i;if(0!==o||0!==a){var u=((t-r)*o+(e-i)*a)/(o*o+a*a);u>1?(r=n,i=s):u>0&&(r+=o*u,i+=a*u)}return(o=t-r)*o+(a=e-i)*a}function s(t,e,r,i){var n={id:void 0===t?null:t,type:e,geometry:r,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)o(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var i=0;i<e.length;i++)o(t,e[i]);else if("MultiPolygon"===r)for(i=0;i<e.length;i++)for(var n=0;n<e[i].length;n++)o(t,e[i][n])}(n),n}function o(t,e){for(var r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function a(t,e,r,i){if(e.geometry){var n=e.geometry.coordinates,o=e.geometry.type,c=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),d=[],p=e.id;if(r.promoteId?p=e.properties[r.promoteId]:r.generateId&&(p=i||0),"Point"===o)u(n,d);else if("MultiPoint"===o)for(var f=0;f<n.length;f++)u(n[f],d);else if("LineString"===o)l(n,d,c,!1);else if("MultiLineString"===o){if(r.lineMetrics){for(f=0;f<n.length;f++)d=[],l(n[f],d,c,!1),t.push(s(p,"LineString",d,e.properties));return}h(n,d,c,!1)}else if("Polygon"===o)h(n,d,c,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(f=0;f<e.geometry.geometries.length;f++)a(t,{id:p,geometry:e.geometry.geometries[f],properties:e.properties},r,i);return}throw new Error("Input data is not a valid GeoJSON object.")}for(f=0;f<n.length;f++){var m=[];h(n[f],m,c,!0),d.push(m)}}t.push(s(p,o,d,e.properties))}}function u(t,e){e.push(c(t[0])),e.push(d(t[1])),e.push(0)}function l(t,e,r,n){for(var s,o,a=0,u=0;u<t.length;u++){var l=c(t[u][0]),h=d(t[u][1]);e.push(l),e.push(h),e.push(0),u>0&&(a+=n?(s*h-l*o)/2:Math.sqrt(Math.pow(l-s,2)+Math.pow(h-o,2))),s=l,o=h}var p=e.length-3;e[2]=1,i(e,0,p,r),e[p+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function h(t,e,r,i){for(var n=0;n<t.length;n++){var s=[];l(t[n],s,r,i),e.push(s)}}function c(t){return t/360+.5}function d(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function p(t,e,r,i,n,o,a,u){if(i/=e,o>=(r/=e)&&a<i)return t;if(a<r||o>=i)return null;for(var l=[],h=0;h<t.length;h++){var c=t[h],d=c.geometry,p=c.type,y=0===n?c.minX:c.minY,x=0===n?c.maxX:c.maxY;if(y>=r&&x<i)l.push(c);else if(!(x<r||y>=i)){var v=[];
vendor: 9,029 bytes, line 2
2if("Point"===p||"MultiPoint"===p)f(d,v,r,i,n);else if("LineString"===p)m(d,v,r,i,n,!1,u.lineMetrics);else if("MultiLineString"===p)g(d,v,r,i,n,!1);else if("Polygon"===p)g(d,v,r,i,n,!0);else if("MultiPolygon"===p)for(var b=0;b<d.length;b++){var w=[];g(d[b],w,r,i,n,!0),w.length&&v.push(w)}if(v.length){if(u.lineMetrics&&"LineString"===p){for(b=0;b<v.length;b++)l.push(s(c.id,p,v[b],c.tags));continue}"LineString"!==p&&"MultiLineString"!==p||(1===v.length?(p="LineString",v=v[0]):p="MultiLineString"),"Point"!==p&&"MultiPoint"!==p||(p=3===v.length?"Point":"MultiPoint"),l.push(s(c.id,p,v,c.tags))}}}return l.length?l:null}function f(t,e,r,i,n){for(var s=0;s<t.length;s+=3){var o=t[s+n];o>=r&&o<=i&&(e.push(t[s]),e.push(t[s+1]),e.push(t[s+2]))}}function m(t,e,r,i,n,s,o){for(var a,u,l=y(t),h=0===n?v:b,c=t.start,d=0;d<t.length-3;d+=3){var p=t[d],f=t[d+1],m=t[d+2],g=t[d+3],w=t[d+4],_=0===n?p:f,M=0===n?g:w,E=!1;o&&(a=Math.sqrt(Math.pow(p-g,2)+Math.pow(f-w,2))),_<r?M>r&&(u=h(l,p,f,g,w,r),o&&(l.start=c+a*u)):_>i?M<i&&(u=h(l,p,f,g,w,i),o&&(l.start=c+a*u)):x(l,p,f,m),M<r&&_>=r&&(u=h(l,p,f,g,w,r),E=!0),M>i&&_<=i&&(u=h(l,p,f,g,w,i),E=!0),!s&&E&&(o&&(l.end=c+a*u),e.push(l),l=y(t)),o&&(c+=a)}var T=t.length-3;p=t[T],f=t[T+1],m=t[T+2],(_=0===n?p:f)>=r&&_<=i&&x(l,p,f,m),T=l.length-3,s&&T>=3&&(l[T]!==l[0]||l[T+1]!==l[1])&&x(l,l[0],l[1],l[2]),l.length&&e.push(l)}function y(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function g(t,e,r,i,n,s){for(var o=0;o<t.length;o++)m(t[o],e,r,i,n,s,!1)}function x(t,e,r,i){t.push(e),t.push(r),t.push(i)}function v(t,e,r,i,n,s){var o=(s-e)/(i-e);return t.push(s),t.push(r+(n-r)*o),t.push(1),o}function b(t,e,r,i,n,s){var o=(s-r)/(n-r);return t.push(e+(i-e)*o),t.push(s),t.push(1),o}function w(t,e){for(var r=[],i=0;i<t.length;i++){var n,o=t[i],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)n=_(o.geometry,e);else if("MultiLineString"===a||"Polygon"===a){n=[];for(var u=0;u<o.geometry.length;u++)n.push(_(o.geometry[u],e))}else if("MultiPolygon"===a)for(n=[],u=0;u<o.geometry.length;u++){for(var l=[],h=0;h<o.geometry[u].length;h++)l.push(_(o.geometry[u][h],e));n.push(l)}r.push(s(o.id,a,n,o.tags))}return r}function _(t,e){var r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);for(var i=0;i<t.length;i+=3)r.push(t[i]+e,t[i+1],t[i+2]);return r}function M(t,e){if(t.transformed)return t;var r,i,n,s=1<<t.z,o=t.x,a=t.y;for(r=0;r<t.features.length;r++){var u=t.features[r],l=u.geometry,h=u.type;if(u.geometry=[],1===h)for(i=0;i<l.length;i+=2)u.geometry.push(E(l[i],l[i+1],e,s,o,a));else for(i=0;i<l.length;i++){var c=[];for(n=0;n<l[i].length;n+=2)c.push(E(l[i][n],l[i][n+1],e,s,o,a));u.geometry.push(c)}}return t.transformed=!0,t}function E(t,e,r,i,n,s){return[Math.round(r*(t*i-n)),Math.round(r*(e*i-s))]}function T(t,e,r,i,n){for(var s=e===n.maxZoom?0:n.tolerance/((1<<e)*n.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:i,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},a=0;a<t.length;a++){o.numFeatures++,S(o,t[a],s,n);var u=t[a].minX,l=t[a].minY,h=t[a].maxX,c=t[a].maxY;u<o.minX&&(o.minX=u),l<o.minY&&(o.minY=l),h>o.maxX&&(o.maxX=h),c>o.maxY&&(o.maxY=c)}return o}function S(t,e,r,i){var n=e.geometry,s=e.type,o=[];if("Point"===s||"MultiPoint"===s)for(var a=0;a<n.length;a+=3)o.push(n[a]),o.push(n[a+1]),t.numPoints++,t.numSimplified++;else if("LineString"===s)A(o,n,t,r,!1,!1);else if("MultiLineString"===s||"Polygon"===s)for(a=0;a<n.length;a++)A(o,n[a],t,r,"Polygon"===s,0===a);else if("MultiPolygon"===s)for(var u=0;u<n.length;u++){var l=n[u];for(a=0;a<l.length;a++)A(o,l[a],t,r,!0,0===a)}if(o.length){var h=e.tags||null;if("LineString"===s&&i.lineMetrics){for(var c in h={},e.tags)h[c]=e.tags[c];h.mapbox_clip_start=n.start/n.size,h.mapbox_clip_end=n.end/n.size}var d={geometry:o,type:"Polygon"===s||"MultiPolygon"===s?3:"LineString"===s||"MultiLineString"===s?2:1,tags:h};null!==e.id&&(d.id=e.id),t.features.push(d)}}function A(t,e,r,i,n,s){var o=i*i;if(i>0&&e.size<(n?o:i))r.numPoints+=e.length/3;else{for(var a=[],u=0;u<e.length;u+=3)(0===i||e[u+2]>o)&&(r.numSimplified++,a.push(e[u]),a.push(e[u+1])),r.numPoints++;n&&function(t,e){for(var r=0,i=0,n=t.length,s=n-2;i<n;s=i,i+=2)r+=(t[i]-t[s])*(t[i+1]+t[s+1]);if(r>0===e)for(i=0,n=t.length;i<n/2;i+=2){var o=t[i],a=t[i+1];t[i]=t[n-2-i],t[i+1]=t[n-1-i],t[n-2-i]=o,t[n-1-i]=a}}(a,s),t.push(a)}}function z(t,e){return new P(t,e)}function P(t,e){var r=(e=this.options=function(t,e){for(var r in e)t[r]=e[r];return t}(Object.create(this.options),e)).debug;if(r&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var i=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var i=0;i<t.features.length;i++)a(r,t.features[i],e,i);else"Feature"===t.type?a(r,t,e):a(r,{geometry:t},e);return r}(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),i=function(t,e){var r=e.buffer/e.extent,i=t,n=p(t,1,-1-r,r,0,-1,2,e),s=p(t,1,1-r,2+r,0,-1,2,e);return(n||s)&&(i=p(t,1,-r,1+r,0,-1,2,e)||[],n&&(i=w(n,1).concat(i)),s&&(i=i.concat(w(s,-1)))),i}(i,e),i.length&&this.splitTile(i,0,0,0),r&&(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 L(t,e,r){return 32*((1<<t)*r+e)+t}r.r(e),r.d(e,{default:()=>z}),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(t,e,r,i,n,s,o){for(var a=[t,e,r,i],u=this.options,l=u.debug;a.length;){i=a.pop(),r=a.pop(),e=a.pop(),t=a.pop();var h=1<<e,c=L(e,r,i),d=this.tiles[c];if(!d&&(l>1&&console.time("creation"),d=this.tiles[c]=T(t,e,r,i,u),this.tileCoords.push({z:e,x:r,y:i}),l)){l>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,i,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(d.source=t,n){if(e===u.maxZoom||e===n)continue;var m=1<<n-e;if(r!==Math.floor(s/m)||i!==Math.floor(o/m))continue}else if(e===u.indexMaxZoom||d.numPoints<=u.indexMaxPoints)continue;if(d.source=null,0!==t.length){l>1&&console.time("clipping");var y,g,x,v,b,w,_=.5*u.buffer/u.extent,M=.5-_,E=.5+_,S=1+_;y=g=x=v=null,b=p(t,h,r-_,r+E,0,d.minX,d.maxX,u),w=p(t,h,r+M,r+S,0,d.minX,d.maxX,u),t=null,b&&(y=p(b,h,i-_,i+E,1,d.minY,d.maxY,u),g=p(b,h,i+M,i+S,1,d.minY,d.maxY,u),b=null),w&&(x=p(w,h,i-_,i+E,1,d.minY,d.maxY,u),v=p(w,h,i+M,i+S,1,d.minY,d.maxY,u),w=null),l>1&&console.timeEnd("clipping"),a.push(y||[],e+1,2*r,2*i),a.push(g||[],e+1,2*r,2*i+1),a.push(x||[],e+1,2*r+1,2*i),a.push(v||[],e+1,2*r+1,2*i+1)}}},P.prototype.getTile=function(t,e,r){var i=this.options,n=i.extent,s=i.debug;if(t<0||t>24)return null;var o=1<<t,a=L(t,e=(e%o+o)%o,r);if(this.tiles[a])return M(this.tiles[a],n);s>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var u,l=t,h=e,c=r;!u&&l>0;)l--,h=Math.floor(h/2),c=Math.floor(c/2),u=this.tiles[L(l,h,c)];return u&&u.source?(s>1&&console.log("found parent tile z%d-%d-%d",l,h,c),s>1&&console.time("drilling down"),this.splitTile(u.source,l,h,c,t,e,r),s>1&&console.timeEnd("drilling down"),this.tiles[a]?M(this.tiles[a],n):null):null}},5133:t=>{t.exports=r;var e=null;try{e=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(t){}function r(t,e,r){this.low=0|t,this.high=0|e,this.unsigned=!!r}function i(t){return!0===(t&&t.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=i;var n={},s={};function o(t,e){var r,i,o;return e?(o=0<=(t>>>=0)&&t<256)&&(i=s[t])?i:(r=u(t,(0|t)<0?-1:0,!0),o&&(s[t]=r),r):(o=-128<=(t|=0)&&t<128)&&(i=n[t])?i:(r=u(t,t<0?-1:0,!1),o&&(n[t]=r),r)}function a(t,e){if(isNaN(t))return e?g:y;if(e){if(t<0)return g;if(t>=p)return _}
vendor: 7,213 bytes, line 2
2else{if(t<=-f)return M;if(t+1>=f)return w}return t<0?a(-t,e).neg():u(t%d|0,t/d|0,e)}function u(t,e,i){return new r(t,e,i)}r.fromInt=o,r.fromNumber=a,r.fromBits=u;var l=Math.pow;function h(t,e,r){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return y;if("number"==typeof e?(r=e,e=!1):e=!!e,(r=r||10)<2||36<r)throw RangeError("radix");var i;if((i=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return h(t.substring(1),e,r).neg();for(var n=a(l(r,8)),s=y,o=0;o<t.length;o+=8){var u=Math.min(8,t.length-o),c=parseInt(t.substring(o,o+u),r);if(u<8){var d=a(l(r,u));s=s.mul(d).add(a(c))}else s=(s=s.mul(n)).add(a(c))}return s.unsigned=e,s}function c(t,e){return"number"==typeof t?a(t,e):"string"==typeof t?h(t,e):u(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}r.fromString=h,r.fromValue=c;var d=4294967296,p=d*d,f=p/2,m=o(1<<24),y=o(0);r.ZERO=y;var g=o(0,!0);r.UZERO=g;var x=o(1);r.ONE=x;var v=o(1,!0);r.UONE=v;var b=o(-1);r.NEG_ONE=b;var w=u(-1,2147483647,!1);r.MAX_VALUE=w;var _=u(-1,-1,!0);r.MAX_UNSIGNED_VALUE=_;var M=u(0,-2147483648,!1);r.MIN_VALUE=M;var E=r.prototype;E.toInt=function(){return this.unsigned?this.low>>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},E.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(M)){var e=a(t),r=this.div(e),i=r.mul(e).sub(this);return r.toString(t)+i.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var n=a(l(t,6),this.unsigned),s=this,o="";;){var u=s.div(n),h=(s.sub(u.mul(n)).toInt()>>>0).toString(t);if((s=u).isZero())return h+o;for(;h.length<6;)h="0"+h;o=""+h+o}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(M)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&!(t&1<<e);e--);return 0!=this.high?e+33:e+1},E.isZero=function(){return 0===this.high&&0===this.low},E.eqz=E.isZero,E.isNegative=function(){return!this.unsigned&&this.high<0},E.isPositive=function(){return this.unsigned||this.high>=0},E.isOdd=function(){return!(1&~this.low)},E.isEven=function(){return!(1&this.low)},E.equals=function(t){return i(t)||(t=c(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},E.eq=E.equals,E.notEquals=function(t){return!this.eq(t)},E.neq=E.notEquals,E.ne=E.notEquals,E.lessThan=function(t){return this.comp(t)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(t){return this.comp(t)<=0},E.lte=E.lessThanOrEqual,E.le=E.lessThanOrEqual,E.greaterThan=function(t){return this.comp(t)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(t){return this.comp(t)>=0},E.gte=E.greaterThanOrEqual,E.ge=E.greaterThanOrEqual,E.compare=function(t){if(i(t)||(t=c(t)),this.eq(t))return 0;var e=this.isNegative(),r=t.isNegative();return e&&!r?-1:!e&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(M)?M:this.not().add(x)},E.neg=E.negate,E.add=function(t){i(t)||(t=c(t));var e=this.high>>>16,r=65535&this.high,n=this.low>>>16,s=65535&this.low,o=t.high>>>16,a=65535&t.high,l=t.low>>>16,h=0,d=0,p=0,f=0;return p+=(f+=s+(65535&t.low))>>>16,d+=(p+=n+l)>>>16,h+=(d+=r+a)>>>16,h+=e+o,u((p&=65535)<<16|(f&=65535),(h&=65535)<<16|(d&=65535),this.unsigned)},E.subtract=function(t){return i(t)||(t=c(t)),this.add(t.neg())},E.sub=E.subtract,E.multiply=function(t){if(this.isZero())return y;if(i(t)||(t=c(t)),e)return u(e.mul(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned);if(t.isZero())return y;if(this.eq(M))return t.isOdd()?M:y;if(t.eq(M))return this.isOdd()?M:y;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(m)&&t.lt(m))return a(this.toNumber()*t.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,s=this.low>>>16,o=65535&this.low,l=t.high>>>16,h=65535&t.high,d=t.low>>>16,p=65535&t.low,f=0,g=0,x=0,v=0;return x+=(v+=o*p)>>>16,g+=(x+=s*p)>>>16,x&=65535,g+=(x+=o*d)>>>16,f+=(g+=n*p)>>>16,g&=65535,f+=(g+=s*d)>>>16,g&=65535,f+=(g+=o*h)>>>16,f+=r*p+n*d+s*h+o*l,u((x&=65535)<<16|(v&=65535),(f&=65535)<<16|(g&=65535),this.unsigned)},E.mul=E.multiply,E.divide=function(t){if(i(t)||(t=c(t)),t.isZero())throw Error("division by zero");var r,n,s;if(e)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?u((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?g:y;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return g;if(t.gt(this.shru(1)))return v;s=g}else{if(this.eq(M))return t.eq(x)||t.eq(b)?M:t.eq(M)?x:(r=this.shr(1).div(t).shl(1)).eq(y)?t.isNegative()?x:b:(n=this.sub(t.mul(r)),s=r.add(n.div(t)));if(t.eq(M))return this.unsigned?g:y;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();s=y}for(n=this;n.gte(t);){r=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),h=o<=48?1:l(2,o-48),d=a(r),p=d.mul(t);p.isNegative()||p.gt(n);)p=(d=a(r-=h,this.unsigned)).mul(t);d.isZero()&&(d=x),s=s.add(d),n=n.sub(p)}return s},E.div=E.divide,E.modulo=function(t){return i(t)||(t=c(t)),e?u((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},E.mod=E.modulo,E.rem=E.modulo,E.not=function(){return u(~this.low,~this.high,this.unsigned)},E.and=function(t){return i(t)||(t=c(t)),u(this.low&t.low,this.high&t.high,this.unsigned)},E.or=function(t){return i(t)||(t=c(t)),u(this.low|t.low,this.high|t.high,this.unsigned)},E.xor=function(t){return i(t)||(t=c(t)),u(this.low^t.low,this.high^t.high,this.unsigned)},E.shiftLeft=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):u(0,this.low<<t-32,this.unsigned)},E.shl=E.shiftLeft,E.shiftRight=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):u(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(t){if(i(t)&&(t=t.toInt()),0==(t&=63))return this;var e=this.high;return t<32?u(this.low>>>t|e<<32-t,e>>>t,this.unsigned):u(32===t?e:e>>>t-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.shr_u=E.shiftRightUnsigned,E.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},E.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},E.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]}
vendor: 15,372 bytes, line 2
2,r.fromBytes=function(t,e,i){return i?r.fromBytesLE(t,e):r.fromBytesBE(t,e)},r.fromBytesLE=function(t,e){return new r(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},r.fromBytesBE=function(t,e){return new r(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},6918:(t,e,r)=>{"use strict";t.exports=r(3729)},3729:(t,e,r)=>{"use strict";var i=e;function n(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}i.build="minimal",i.Writer=r(8116),i.BufferWriter=r(1819),i.Reader=r(2461),i.BufferReader=r(9117),i.util=r(1679),i.rpc=r(8082),i.roots=r(575),i.configure=n,n()},2461:(t,e,r)=>{"use strict";t.exports=u;var i,n=r(1679),s=n.LongBits,o=n.utf8;function a(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function u(t){this.buf=t,this.pos=0,this.len=t.length}var l,h="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new u(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new u(t);throw Error("illegal buffer")},c=function(){return n.Buffer?function(t){return(u.create=function(t){return n.Buffer.isBuffer(t)?new i(t):h(t)})(t)}:h};function d(){var t=new s(0,0),e=0;if(!(this.len-this.pos>4)){for(;e<3;++e){if(this.pos>=this.len)throw a(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*e)>>>0,t}for(;e<4;++e)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(e=0,this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw a(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function p(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new s(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}u.create=c(),u.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,u.prototype.uint32=(l=4294967295,function(){if(l=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return l;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return l}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|p(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var t=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},u.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var t=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},u.prototype.bytes=function(){var t=this.uint32(),e=this.pos,r=this.pos+t;if(r>this.len)throw a(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(e,r):e===r?new this.buf.constructor(0):this._slice.call(this.buf,e,r)},u.prototype.string=function(){var t=this.bytes();return o.read(t,0,t.length)},u.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw a(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},u._configure=function(t){i=t,u.create=c(),i._configure();var e=n.Long?"toLong":"toNumber";n.merge(u.prototype,{int64:function(){return d.call(this)[e](!1)},uint64:function(){return d.call(this)[e](!0)},sint64:function(){return d.call(this).zzDecode()[e](!1)},fixed64:function(){return f.call(this)[e](!0)},sfixed64:function(){return f.call(this)[e](!1)}})}},9117:(t,e,r)=>{"use strict";t.exports=s;var i=r(2461);(s.prototype=Object.create(i.prototype)).constructor=s;var n=r(1679);function s(t){i.call(this,t)}s._configure=function(){n.Buffer&&(s.prototype._slice=n.Buffer.prototype.slice)},s.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},s._configure()},575:t=>{"use strict";t.exports={}},8082:(t,e,r)=>{"use strict";e.Service=r(7927)},7927:(t,e,r)=>{"use strict";t.exports=n;var i=r(1679);function n(t,e,r){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(e),this.responseDelimited=Boolean(r)}(n.prototype=Object.create(i.EventEmitter.prototype)).constructor=n,n.prototype.rpcCall=function t(e,r,n,s,o){if(!s)throw TypeError("request must be specified");var a=this;if(!o)return i.asPromise(t,a,e,r,n,s);if(a.rpcImpl)try{return a.rpcImpl(e,r[a.requestDelimited?"encodeDelimited":"encode"](s).finish(),(function(t,r){if(t)return a.emit("error",t,e),o(t);if(null!==r){if(!(r instanceof n))try{r=n[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(t){return a.emit("error",t,e),o(t)}return a.emit("data",r,e),o(null,r)}a.end(!0)}))}catch(t){return a.emit("error",t,e),void setTimeout((function(){o(t)}),0)}else setTimeout((function(){o(Error("already ended"))}),0)},n.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},8294:(t,e,r)=>{"use strict";t.exports=n;var i=r(1679);function n(t,e){this.lo=t>>>0,this.hi=e>>>0}var s=n.zero=new n(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var o=n.zeroHash="\\0\\0\\0\\0\\0\\0\\0\\0";n.fromNumber=function(t){if(0===t)return s;var e=t<0;e&&(t=-t);var r=t>>>0,i=(t-r)/4294967296>>>0;return e&&(i=~i>>>0,r=~r>>>0,++r>4294967295&&(r=0,++i>4294967295&&(i=0))),new n(r,i)},n.from=function(t){if("number"==typeof t)return n.fromNumber(t);if(i.isString(t)){if(!i.Long)return n.fromNumber(parseInt(t,10));t=i.Long.fromString(t)}return t.low||t.high?new n(t.low>>>0,t.high>>>0):s},n.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=1+~this.lo>>>0,r=~this.hi>>>0;return e||(r=r+1>>>0),-(e+4294967296*r)}return this.lo+4294967296*this.hi},n.prototype.toLong=function(t){return i.Long?new i.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var a=String.prototype.charCodeAt;n.fromHash=function(t){return t===o?s:new n((a.call(t,0)|a.call(t,1)<<8|a.call(t,2)<<16|a.call(t,3)<<24)>>>0,(a.call(t,4)|a.call(t,5)<<8|a.call(t,6)<<16|a.call(t,7)<<24)>>>0)},n.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)},n.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},n.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},n.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===e?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:r<128?9:10}},1679:function(t,e,r){"use strict";var i=e;function n(t,e,r){for(var i=Object.keys(e),n=0;n<i.length;++n)void 0!==t[i[n]]&&r||(t[i[n]]=e[i[n]]);return t}function s(t){function e(t,r){if(!(this instanceof e))return new e(t,r);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&n(this,r)}return(e.prototype=Object.create(Error.prototype)).constructor=e,Object.defineProperty(e.prototype,"name",{get:function(){return t}}),e.prototype.toString=function(){return this.name+": "+this.message},e}i.asPromise=r(7018),i.base64=r(2647),i.EventEmitter=r(2922),i.float=r(7955),i.inquire=r(8446),i.utf8=r(5226),i.pool=r(5374),i.LongBits=r(8294),i.isNode=Boolean(void 0!==r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),i.global=i.isNode&&r.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(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},i.isString=function(t){return"string"==typeof t||t instanceof String},i.isObject=function(t){return t&&"object"==typeof t},i.isset=i.isSet=function(t,e){var r=t[e];return!(null==r||!t.hasOwnProperty(e))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},i.Buffer=function(){try{var t=i.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(t){return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(t){return"number"==typeof t?i.Buffer?i._Buffer_allocUnsafe(t):new i.Array(t):i.Buffer?i._Buffer_from(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},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(t){return t?i.LongBits.from(t).toHash():i.LongBits.zeroHash},i.longFromHash=function(t,e){var r=i.LongBits.fromHash(t);return i.Long?i.Long.fromBits(r.lo,r.hi,e):r.toNumber(Boolean(e))},i.merge=n,i.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},i.newError=s,i.ProtocolError=s("ProtocolError"),i.oneOfGetter=function(t){for(var e={},r=0;r<t.length;++r)e[t[r]]=1;return function(){for(var t=Object.keys(this),r=t.length-1;r>-1;--r)if(1===e[t[r]]&&void 0!==this[t[r]]&&null!==this[t[r]])return t[r]}},i.oneOfSetter=function(t){return function(e){for(var r=0;r<t.length;++r)t[r]!==e&&delete this[t[r]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var t=i.Buffer;t?(i._Buffer_from=t.from!==Uint8Array.from&&t.from||function(e,r){return new t(e,r)},i._Buffer_allocUnsafe=t.allocUnsafe||function(e){return new t(e)}):i._Buffer_from=i._Buffer_allocUnsafe=null}},8116:(t,e,r)=>{"use strict";t.exports=c;var i,n=r(1679),s=n.LongBits,o=n.base64,a=n.utf8;function u(t,e,r){this.fn=t,this.len=e,this.next=void 0,this.val=r}function l(){}function h(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function c(){this.len=0,this.head=new u(l,0,0),this.tail=this.head,this.states=null}var d=function(){return n.Buffer?function(){return(c.create=function(){return new i})()}:function(){return new c}};function p(t,e,r){e[r]=255&t}function f(t,e){this.len=t,this.next=void 0,this.val=e}function m(t,e,r){for(;t.hi;)e[r++]=127&t.lo|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=127&t.lo|128,t.lo=t.lo>>>7;e[r++]=t.lo}function y(t,e,r){e[r]=255&t,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}c.create=d(),c.alloc=function(t){return new n.Array(t)},n.Array!==Array&&(c.alloc=n.pool(c.alloc,n.Array.prototype.subarray)),c.prototype._push=function(t,e,r){return this.tail=this.tail.next=new u(t,e,r),this.len+=e,this},f.prototype=Object.create(u.prototype),f.prototype.fn=function(t,e,r){for(;t>127;)e[r++]=127&t|128,t>>>=7;e[r]=t},c.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new f((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},c.prototype.int32=function(t){return t<0?this._push(m,10,s.fromNumber(t)):this.uint32(t)},c.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},c.prototype.uint64=function(t){var e=s.from(t);return this._push(m,e.length(),e)},c.prototype.int64=c.prototype.uint64,c.prototype.sint64=function(t){var e=s.from(t).zzEncode();return this._push(m,e.length(),e)},c.prototype.bool=function(t){return this._push(p,1,t?1:0)},c.prototype.fixed32=function(t){return this._push(y,4,t>>>0)},c.prototype.sfixed32=c.prototype.fixed32,c.prototype.fixed64=function(t){var e=s.from(t);return this._push(y,4,e.lo)._push(y,4,e.hi)},c.prototype.sfixed64=c.prototype.fixed64,c.prototype.float=function(t){return this._push(n.float.writeFloatLE,4,t)},c.prototype.double=function(t){return this._push(n.float.writeDoubleLE,8,t)};var g=n.Array.prototype.set?function(t,e,r){e.set(t,r)}:function(t,e,r){for(var i=0;i<t.length;++i)e[r+i]=t[i]};c.prototype.bytes=function(t){var e=t.length>>>0;if(!e)return this._push(p,1,0);if(n.isString(t)){var r=c.alloc(e=o.length(t));o.decode(t,r,0),t=r}return this.uint32(e)._push(g,e,t)},c.prototype.string=function(t){var e=a.length(t);return e?this.uint32(e)._push(a.write,e,t):this._push(p,1,0)},c.prototype.fork=function(){return this.states=new h(this),this.head=this.tail=new u(l,0,0),this.len=0,this},c.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 u(l,0,0),this.len=0),this},c.prototype.ldelim=function(){var t=this.head,e=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=t.next,this.tail=e,this.len+=r),this},c.prototype.finish=function(){for(var t=this.head.next,e=this.constructor.alloc(this.len),r=0;t;)t.fn(t.val,e,r),r+=t.len,t=t.next;return e},c._configure=function(t){i=t,c.create=d(),i._configure()}},1819:(t,e,r)=>{"use strict";t.exports=s;var i=r(8116);(s.prototype=Object.create(i.prototype)).constructor=s;var n=r(1679);function s(){i.call(this)}function o(t,e,r){t.length<40?n.utf8.write(t,e,r):e.utf8Write?e.utf8Write(t,r):e.write(t,r)}s._configure=function(){s.alloc=n._Buffer_allocUnsafe,s.writeBytesBuffer=n.Buffer&&n.Buffer.prototype instanceof Uint8Array&&"set"===n.Buffer.prototype.set.name?function(t,e,r){e.set(t,r)}:function(t,e,r){if(t.copy)t.copy(e,r,0,t.length);else for(var i=0;i<t.length;)e[r++]=t[i++]}},s.prototype.bytes=function(t){n.isString(t)&&(t=n._Buffer_from(t,"base64"));var e=t.length>>>0;return this.uint32(e),e&&this._push(s.writeBytesBuffer,e,t),this},s.prototype.string=function(t){var e=n.Buffer.byteLength(t);return this.uint32(e),e&&this._push(o,e,t),this},s._configure()},7769:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};
2Object.defineProperty(e,"__esModule",{value:!0}),n(r(5185),e),n(r(6406),e),n(r(6114),e),n(r(8934),e),n(r(1072),e),n(r(7259),e),n(r(8284),e),n(r(1017),e),n(r(1370),e),n(r(1216),e),n(r(8131),e)},8152:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(7395),e),n(r(8920),e),n(r(4835),e),n(r(9421),e),n(r(9362),e),n(r(7980),e),n(r(2286),e),n(r(3253),e),n(r(8770),e),n(r(1072),e)},3253:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.scaleHeight=e.getFeatureText=e.getFeatureName=e.getFeatureId=e.getProjectionName=e.getProjection=e.GeometryType=e.getArrayConstructor=void 0;const i=r(2616),n=r(1984),s=r(3561);function o(t,e,r){var i;let n;if(void 0===e&&(e="name"),void 0!==r)for(const s of r)if(n=null!==(i=t.lookup(`${e}:${s}`))&&void 0!==i?i:t.lookup(`${e}_${s}`),"string"==typeof n&&n.length>0)return n;if(n=t.lookup(e),"string"==typeof n)return n}var a;e.getArrayConstructor=function(t){switch(t){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=e.GeometryType||(e.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",e.getProjection=function(t){switch(t){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 ${t}`)}},e.getProjectionName=function(t){if(t===i.mercatorProjection)return"mercator";if(t===i.webMercatorProjection)return"webMercator";if(t===i.sphereProjection)return"sphere";if(t===i.normalizedEquirectangularProjection)return"normalizedEquirectangular";if(t===i.equirectangularProjection)return"equirectangular";throw new Error("Unknown projection")},e.getFeatureId=function(t){if(void 0===t)return 0;if("string"==typeof t||"number"==typeof t)return t;if(t.hasOwnProperty("$id")){const e=t.$id;if("string"==typeof e||"number"==typeof e)return e}return 0},e.getFeatureName=o,e.getFeatureText=function(t,e,r){const i=t instanceof n.Env?t:t.env;if((0,n.isTextTechnique)(e)||(0,n.isIconTextTechnique)(e)||(0,n.isLineMarkerTechnique)(e)){if(void 0!==e.text)return(0,s.evaluateTechniqueAttr)(t,e.text);if((0,n.isIconTextTechnique)(e)||(0,n.isLineMarkerTechnique)(e))return}return o(i,"name",r)},e.scaleHeight=function(t,e,r){return!(0,s.evaluateTechniqueAttr)(t,e.constantHeight,r<12)}},1072:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isFeatureGeometry=void 0,e.isFeatureGeometry=function(t){const e=t.type;return"Point"===e||"MultiPoint"===e||"LineString"===e||"MultiLineString"===e||"Polygon"===e||"MultiPolygon"===e}},6406:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7980:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2286:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6114:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.addPolygonEdges=void 0;const i=r(5448),n=new i.Vector2,s=new i.Vector2,o=new i.Vector2,a=new i.Vector2;e.addPolygonEdges=function(t,e,r,i,u,l,h,c){for(let d=0;d<u.length;++d)if(u[d])if(!0===l){const l=e+2*d,p=l+1,f=e+(d+1)%u.length*2,m=f+1;
2!0===h&&t.push(l,f),t.push(p,m);const y=(0===d?u.length:d)-1;if(u[y])if(void 0!==c){const e=i[d*r],h=i[d*r+1],f=i[(d+1)%u.length*r],m=i[(d+1)%u.length*r+1];n.set(e,h),s.set(f,m),o.set(i[y*r],i[y*r+1]),a.set(n.x,n.y),a.sub(o).normalize().dot(s.sub(n).normalize())<=c&&t.push(l,p)}else t.push(l,p)}else{const r=e+d,i=e+(d+1)%u.length;t.push(r,i)}}},7395:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},8920:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getPropertyValue=void 0;const i=r(1984),n=r(4342).LoggerManager.instance.create("PropertyValue");e.getPropertyValue=function(t,e,r){try{return(0,i.getPropertyValue)(t,e,r)}catch(e){return n.error("failed to evaluate expression",JSON.stringify(t),"error",String(e)),null}}},5185:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.makeDecodedTechnique=e.StyleSetEvaluator=void 0;const i=r(1984),n=r(8023),s=r(8797),o=r(8628),a=r(4342),u=r(5535),l=a.LoggerManager.instance.create("StyleSetEvaluator"),h=u.AttrScope.TechniqueGeometry;class c{classify(t){if(t._whenExpr){const e=this.switchStyle(t);t._whenExpr=t._whenExpr.accept(this,void 0),this._style=e}}visitNullLiteralExpr(t,e){return t}visitBooleanLiteralExpr(t,e){return t}visitNumberLiteralExpr(t,e){return t}visitStringLiteralExpr(t,e){return t}visitObjectLiteralExpr(t,e){return t}visitVarExpr(t,e){return t}visitHasAttributeExpr(t,e){return t}visitMatchExpr(t,e){return t}visitCaseExpr(t,e){return t}visitCallExpr(t,e){if("all"===t.op){const e=t.args.map((e=>e.accept(this,t))).filter((t=>void 0!==t));return new n.CallExpr(t.op,e)}if(e){const e=this.matchVarStringComparison(t);if(e){if(void 0===this._style.dataLayer&&"$layer"===e.name)return void(this._style.dataLayer=e.value);if(void 0===this._style._geometryType&&"$geometryType"===e.name)return void(this._style._geometryType=e.value)}}return t}visitLookupExpr(t,e){return this.visitCallExpr(t,e)}visitStepExpr(t,e){return t}visitInterpolateExpr(t,e){return t}matchVarStringComparison(t){if("=="===t.op){const e=t.args[0],r=t.args[1];if(e instanceof n.VarExpr&&r instanceof n.StringLiteralExpr)return{name:e.name,value:r.value};if(r instanceof n.VarExpr&&e instanceof n.StringLiteralExpr)return{name:r.name,value:e.value}}}switchStyle(t){const e=this._style;return this._style=t,e}}class d{constructor(t,e){this.key="",this.set(t,e)}set(t,e,r){let i=!1;if(void 0===t){const e=void 0!==r?r.lookup("$layer"):void 0;t="string"==typeof e?e:void 0}if(this.layer!==t&&(this.layer=t,i=!0),void 0===e){const t=void 0!==r?r.lookup("$geometryType"):void 0;e="string"==typeof t?t:void 0}return this.geometryType!==e&&(this.geometryType=e,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(t){const e={};for(const r in t){if(!t.hasOwnProperty(r))continue;let i=t[r];"object"==typeof i&&(i.isVector2||i.isVector3||i.isVector4)&&(i=n.LiteralExpr.fromValue(i)),n.Expr.isExpr(i)&&(i=i.toJSON()),e[r]=i}return e}e.StyleSetEvaluator=class{constructor(t){this.m_options=t,this.styleSet=[],this.m_techniques=[],this.m_exprPool=new s.ExprPool,this.m_cachedResults=new Map,this.m_styleConditionClassifier=new c,this.m_subStyleSetCache=new Map,this.m_areCurrentDefinitionsOverrid
2den=!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 t in this.m_definitions)this.m_definitionsContainVerbose||(this.m_definitionsContainVerbose=(0,i.isVerboseDefinition)(this.m_definitions[t]));this.styleSet=this.m_options.styleSet.map((t=>{const e=Object.assign(Object.assign({},t),{_forceCompile:!0});return t.attr&&(e.attr=Object.assign({},t.attr)),e})),function(t){var e;let r=0,i=0;for(const n of t)n._styleIndex=i++,void 0!==n.technique&&void 0===(null===(e=n.attr)||void 0===e?void 0:e.renderOrder)&&(void 0===n.attr?n.attr={renderOrder:r++}:n.attr.renderOrder=r++)}(this.styleSet),this.m_features=this.validateFeatures(this.m_options.features);const e=[];for(const t in this.m_features){const r=this.m_features[t];Object.values(r.modes).forEach((t=>{(null==t?void 0:t.extendedDefinitions)&&Array.prototype.push.apply(e,Object.keys(t.extendedDefinitions))}))}this.m_modesDefinitions=new Set(e),this.setEnabledFeatures(t.enabledFeatures)}setEnabledFeatures(t){this.applyFeaturesAndModes(null!=t?t:this.getFeaturesEnabledByDefault())}getFeaturesEnabledByDefault(){const t=[];if(this.m_features)for(const e in this.m_features){const r=this.m_features[e];(null==r?void 0:r.defaultMode)&&t.push({feature:e,mode:r.defaultMode||"none"})}return t}applyFeaturesAndModes(t){if(this.m_disabledStyles.byId.clear(),this.m_disabledStyles.byLayer.clear(),this.resetTechniques(),this.m_areCurrentDefinitionsOverrid
2den&&(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 e in this.m_features){const r=this.m_features[e];if(r){let i;const n=t.find((t=>t.feature===e));n?(i=r.modes[n.mode],i||(i=r.modes.none)):i=r.modes.none,i&&(i.disabledLayers&&i.disabledLayers.forEach((t=>{this.m_disabledStyles.byLayer.add(t)})),i.disabledStyleRules&&i.disabledStyleRules.forEach((t=>{this.m_disabledStyles.byId.add(t)}))),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(t){const e={};for(const r in t){const i=t[r];null!==i&&(Array.isArray(i.modes)||i.modes&&!i.modes.none?l.error(`The style configuration is invalid. The feature "${r}" modes must be a literal object and have at least the "none" mode.`):e[r]=i)}if(Object.keys(e).length>0)return e}isStyleDisabled(t){if(void 0!==this.m_disabledStyles){if(void 0!==t.layer&&this.m_disabledStyles.byLayer.has(t.layer))return!0;if(void 0!==t.id&&this.m_disabledStyles.byId.has(t.id))return!0}return!1}getMatchingTechniques(t,e,r){if(this.m_previousResult&&this.m_previousEnv&&this.m_featureDependencies.every((e=>{var r;return(null===(r=this.m_previousEnv)||void 0===r?void 0:r.lookup(e))===t.lookup(e)})))return this.m_previousResult;const i=[];this.m_cachedResults.clear();const n=this.m_tmpOptimizedSubSetKey;n.set(e,r,t),this.m_dataLayer=n.layer,this.m_geometryType=n.geometryType,this.m_zoomLevel=t.lookup("$zoom");const s=this.getOptimizedStyleSet(n);for(const e of s)if(this.processStyle(t,e,i))break;return this.m_previousResult=i,this.m_previousEnv=t,i}wantsDataLayer(t){return this.getOptimizedStyleSet(this.m_tmpOptimizedSubSetKey.set(t,void 0)).length>0}wantsFeature(t,e){return this.getOptimizedStyleSet(this.m_tmpOptimizedSubSetKey.set(t,e)).length>0}resetTechniques(){for(const t of this.m_techniques)t._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(t){if(void 0!==t.cachedStyleSet)return t.cachedStyleSet;let e=this.m_subStyleSetCache.get(t.key);return void 0!==e?(t.cachedStyleSet=e,e):(e=this.createPreFilteredStyleSet(t),this.m_subStyleSetCache.set(t.key,e),t.cachedStyleSet=e,e)}createPreFilteredStyleSet(t){const{layer:e,geometryType:r}=t;return this.styleSet.filter((t=>!(void 0!==e&&void 0!==t.dataLayer&&t.dataLayer!==e||void 0!==r&&void 0!==t._geometryType&&t._geometryType!==r)))}compileStyleSet(){this.styleSet.forEach((t=>this.compileStyle(t))),this.styleSet.forEach((t=>{this.getOptimizedStyleSet(this.m_tmpOptimizedSubSetKey.set(t.dataLayer,t._geometryType))}))}compileStyle(t){var e,r;try{this.compileStyleAttributes(t)}catch(e){l.error("failed to evaluate style rule",t,String(e))}if(void 0!==t.when)try{t._whenExpr=n.Expr.fromJSON(t.when,this.m_currentDefinitions,this.m_definitionExprCache),this.m_styleConditionClassifier.classify(t),void 0!==t._whenExpr&&(t._whenExpr=t._whenExpr.intern(this.m_exprPool));const s=t._whenExpr.dependencies();null==s||s.properties.forEach((t=>{this.m_featureDependencies.includes(t)||this.m_featureDependencies.push(t)})),(0,i.isJsonExpr)(null===(e=t.attr)||void 0===e?void 0:e.minZoomLevel)&&(t._minZoomLevelExpr=n.Expr.fromJSON(t.attr.minZoomLevel,this.m_currentDefinitions).intern(this.m_exprPool)),(0,i.isJsonExpr)(null===(r=t.attr)||void 0===r?void 0:r.maxZoomLevel)&&(t._maxZoomLevelExpr=n.Expr.fromJSON(t.attr.maxZoomLevel,this.m_currentDefinitions).intern(this.m_exprPool))}catch(e){l.error("failed to evaluate expression",JSON.stringify(t.when),String(e))}}processStyle(t,e,r){if(!this.checkZoomLevel(t,e))return!1;if(this.isStyleDisabled(e))return!1;if(void 0!==this.m_dataLayer&&void 0!==e.dataLayer&&e.dataLayer!==this.m_dataLayer)return!1;if(void 0!==this.m_geometryType&&void 0!==e._geometryType&&e._geometryType!==this.m_geometryType)return!1;if(e._whenExpr)try{if(!e._whenExpr.evaluate(t,n.ExprScope.Condition,this.m_cachedResults))return!1}catch(t){return l.error(`failed to evaluate expression \'${JSON.stringify(e.when)}\': ${t}`),!1}return void 0!==e.technique&&("none"!==e.technique&&r.push(this.getTechniqueForStyleMatch(t,e)),!0===e.final)}checkZoomLevel(t,e){var r,i,s,o,a;const u=this.m_zoomLevel;if(void 0===u||u>=17)return!0;let h=null===(r=e.attr)||void 0===r?void 0:r.minZoomLevel,c=null===(i=e.attr)||void 0===i?void 0:i.maxZoomLevel;if(void 0===h&&void 0===c)return!0;
2if(void 0!==h){if(!1===(null===(s=e._minZoomLevelExpr)||void 0===s?void 0:s.isDynamic()))try{h=e._minZoomLevelExpr.evaluate(t,n.ExprScope.Condition,this.m_cachedResults)}catch(t){l.error(`failed to evaluate expression \'${JSON.stringify(e._minZoomLevelExpr)}\': ${t}`)}if("number"==typeof h&&u<Math.floor(h))return!1}if(void 0!==(null===(o=e.attr)||void 0===o?void 0:o.maxZoomLevel)){if(!1===(null===(a=e._maxZoomLevelExpr)||void 0===a?void 0:a.isDynamic()))try{c=e._maxZoomLevelExpr.evaluate(t,n.ExprScope.Condition,this.m_cachedResults)}catch(t){l.error(`failed to evaluate expression \'${JSON.stringify(e._maxZoomLevelExpr)}\': ${t}`)}if("number"==typeof c&&u>=Math.ceil(c))return!1}return!0}getTechniqueForStyleMatch(t,e){let r;if(void 0!==e._dynamicTechniques){const i=this.evaluateTechniqueProperties(e,t),n=this.getDynamicTechniqueKey(e,i);r=e._dynamicTechniques.get(n),void 0===r&&(r=this.createTechnique(e,i),e._dynamicTechniques.set(n,r))}else r=e._staticTechnique,void 0===r&&(e._staticTechnique=r=this.createTechnique(e,[]));return void 0===r._index&&(r._index=this.m_techniques.length,this.m_techniques.push(r)),r}getDynamicTechniqueKey(t,e){const r=e.map((([t,e])=>void 0===e?"U":"object"==typeof e?JSON.stringify(e,((t,e)=>{if(e instanceof ArrayBuffer){let t=e.id;return void 0===t&&(t=e.id=this.m_nextArrayBufferId++),t}return e})):JSON.stringify(e))).join(":");return`${t._styleIndex}:${r}`}compileStyleAttributes(t){var e;if(!t._forceCompile&&(void 0!==t._dynamicTechniqueAttributes||"none"===t.technique))return;t._dynamicTechniqueAttributes=[],t._dynamicFeatureAttributes=[],t._dynamicForwardedAttributes=[],t._staticAttributes=[],t._staticTechnique=void 0,t._dynamicTechniques=void 0;const r=t._dynamicFeatureAttributes,s=t._dynamicTechniqueAttributes,a=t._dynamicForwardedAttributes,c=t._staticAttributes,d=(e,d)=>{if(void 0===d)return;const p=new Set;if((0,i.isJsonExpr)(d)?d=n.Expr.fromJSON(d,this.m_currentDefinitions,this.m_definitionExprCache,p).intern(this.m_exprPool):(0,o.isInterpolatedPropertyDefinition)(d)&&(d=n.Expr.fromJSON((0,o.interpolatedPropertyDefinitionToJsonExpr)(d)).intern(this.m_exprPool)),n.Expr.isExpr(d)){const r=d.dependencies();r.featureState&&("enabled"!==e?l.log("feature-state is not supported in this context"):t._usesFeatureState=!0),0!==r.properties.size||d.isDynamic()||(d=d.evaluate(this.m_emptyEnv))}if(n.Expr.isExpr(d)){const i=function(t,e){var r,i,n;return"extruded-polygon"===t.technique&&"color"===e&&!1!==(null===(r=t.attr)||void 0===r?void 0:r.vertexColors)?h:null!==(n=null===(i=(0,u.getTechniqueAttributeDescriptor)(t.technique,e))||void 0===i?void 0:i.scope)&&void 0!==n?n:h}(t,e),n=d.dependencies();switch(n.properties.forEach((t=>{this.m_featureDependencies.includes(t)||this.m_featureDependencies.push(t)})),i){case u.AttrScope.FeatureGeometry:r.push([e,d]);break;case u.AttrScope.TechniqueGeometry:s.push([e,d]);break;case u.AttrScope.TechniqueRendering:0===n.properties.size?a.push([e,d]):s.push([e,d])}}else null!=d&&c.push([e,d]);for(const e of p.values())if(this.m_modesDefinitions.has(e)){t._forceCompile=!0;break}};t._forceCompile=!1;for(const e in t)t.hasOwnProperty(e)&&(e.startsWith("_")||["when","technique","layer","attr","category","description"].includes(e)||d(e,t[e]));const p=new Map([["category","_category"]]);if(void 0!==t.attr)for(const r in t.attr)t.attr.hasOwnProperty(r)&&d(null!==(e=p.get(r))&&void 0!==e?e:r,t.attr[r]);s.length>0&&(t._dynamicTechniques=new Map)}evaluateTechniqueProperties(t,e){return void 0===t._dynamicTechniqueAttributes?[]:t._dynamicTechniqueAttributes.map((([t,r])=>{try{return[t,r.evaluate(e,n.ExprScope.Value,this.m_cachedResults)]}catch(e){return l.error(`failed to evaluate expression \'${r.toJSON()}\': ${e}`),[t,null]}}))}createTechnique(t,e){var r,n;const s={};if(s.name=t.technique,void 0!==t._staticAttributes)for(const[e,r]of t._staticAttributes)null!==r&&(s[e]=r);for(const[t,r]of e)null!==r&&(s[t]=r);if(void 0!==t._dynamicFeatureAttributes)for(const[e,r]of t._dynamicFeatureAttributes)s[e]=r;if(void 0!==t._dynamicForwardedAttributes)for(const[e,r]of t._dynamicForwardedAttributes)s[e]=r;return s._index=this.m_techniques.length,s._styleIndex=t._styleIndex,void 0!==t.layer&&(s._layer=t.layer),void 0!==t._usesFeatureState&&(s._usesFeatureState=t._usesFeatureState),(0,i.setTechniqueRenderOrderOrPriority)(s,null!==(r=this.m_options.priorities)&&void 0!==r?r:[],null!==(n=this.m_options.labelPriorities)&&void 0!==n?n:[]),this.m_techniques.push(s),s}},e.makeDecodedTechnique=p},3561:(t,e,r)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.evaluateTechniqueAttr=void 0;const i=r(1984),n=r(8920);e.evaluateTechniqueAttr=function(t,e,r){if(void 0===e)return r;const s=i.Env.isEnv(t)?(0,n.getPropertyValue)(e,t):(0,n.getPropertyValue)(e,t.env,t.cachedExprResults);return null!=s?s:r}},5535:(t,e)=>{"use strict";var r;function i(...t){const e={attrDescriptors:{}};for(const r of t)void 0!==r.attrTransparencyColor&&(e.attrTransparencyColor=r.attrTransparencyColor),void 0!==r.attrDescriptors&&(e.attrDescriptors=Object.assign(Object.assign({},e.attrDescriptors),r.attrDescriptors));return e}Object.defineProperty(e,"__esModule",{value:!0}),e.getTechniqueAutomaticAttrs=e.getTechniqueAttributeDescriptor=e.getTechniqueDescriptor=e.AttrScope=void 0,function(t){t[t.FeatureGeometry=0]="FeatureGeometry",t[t.TechniqueGeometry=1]="TechniqueGeometry",t[t.TechniqueRendering=2]="TechniqueRendering"}(r=e.AttrScope||(e.AttrScope={}));const n={attrTransparencyColor:"color",attrDescriptors:{constantHeight:r.FeatureGeometry,visible:r.FeatureGeometry,fadeFar:r.TechniqueRendering,fadeNear:r.TechniqueRendering,transparent:{scope:r.TechniqueRendering,automatic:!0},side:{scope:r.TechniqueRendering,automatic:!0}}},s=i(n,{attrDescriptors:{color:{scope:r.TechniqueRendering,automatic:!0},size:{scope:r.TechniqueRendering,automatic:!0},opacity:{scope:r.TechniqueRendering,automatic:!0}}}),o=i(n,s),a=i(n,s),u=i(n,{attrDescriptors:{text:r.FeatureGeometry,imageTexture:r.FeatureGeometry,iconColor:r.TechniqueRendering,iconBrightness:r.TechniqueRendering,textBrightness:r.TechniqueRendering,backgroundColor:r.TechniqueRendering,backgroundSize:r.TechniqueRendering,backgroundOpacity:r.TechniqueRendering,color:r.TechniqueRendering,opacity:r.TechniqueRendering,size:r.TechniqueRendering,priority:r.TechniqueRendering,zOrder:r.TechniqueRendering,margin:r.TechniqueRendering,"check-margin":r.TechniqueRendering,"anchor-point-density":r.TechniqueRendering}}),l={attrDescriptors:{polygonOffset:{scope:r.TechniqueRendering,automatic:!0},polygonOffsetFactor:{scope:r.TechniqueRendering,automatic:!0},polygonOffsetUnits:{scope:r.TechniqueRendering,automatic:!0},depthTest:{scope:r.TechniqueRendering,automatic:!0},transparent:{scope:r.TechniqueRendering,automatic:!0},opacity:{scope:r.TechniqueRendering,automatic:!0},color:{scope:r.TechniqueRendering,automatic:!0},lineColor:r.TechniqueRendering,lineFadeFar:r.TechniqueRendering,lineFadeNear:r.TechniqueRendering}},h=i(n,l,{attrDescriptors:{width:r.TechniqueRendering,cap:{scope:r.TechniqueRendering,automatic:!0},drawRangeStart:{scope:r.TechniqueRendering,automatic:!0},drawRangeEnd:{scope:r.TechniqueRendering,automatic:!0},dashes:{scope:r.TechniqueRendering,automatic:!0},"dash-gap-color":{scope:r.TechniqueRendering,automatic:!0},"dash-pattern":{scope:r.TechniqueRendering,automatic:!0},"dash-image":{scope:r.TechniqueRendering,automatic:!0},"dash-image-color":{scope:r.TechniqueRendering,automatic:!0}}}),c=i(n,{attrDescriptors:{color:{scope:r.TechniqueRendering,automatic:!0},opacity:{scope:r.TechniqueRendering,automatic:!0},width:r.FeatureGeometry}}),d=i(n,l,{attrDescriptors:{wireframe:{scope:r.TechniqueRendering,automatic:!0},color:{scope:r.TechniqueRendering,automatic:!0},opacity:{scope:r.TechniqueRendering,automatic:!0},transparent:{scope:r.TechniqueRendering,automatic:!0},lineWidth:r.TechniqueRendering,map:{scope:r.TechniqueRendering,automatic:!0}}}),p=i(n,{attrDescriptors:{color:{scope:r.TechniqueRendering,automatic:!0},vertexColors:{scope:r.TechniqueRendering,automatic:!0},wireframe:{scope:r.TechniqueRendering,automatic:!0},roughness:{scope:r.TechniqueRendering,automatic:!0},metalness:{scope:r.TechniqueRendering,automatic:!0},alphaTest:{scope:r.TechniqueRendering,automatic:!0},depthTest:{scope:r.TechniqueRendering,automatic:!0},transparent:{scope:r.TechniqueRendering,automatic:!0},opacity:{scope:r.TechniqueRendering,automatic:!0},emissive:{scope:r.TechniqueRendering,automatic:!0},emissiveIntensity:{scope:r.TechniqueRendering,automatic:!0},refractionRatio:{scope:r.TechniqueRendering,automatic:!0},normalMapType:{scope:r.TechniqueRendering,automatic:!0},map:{scope:r.TechniqueRendering,automatic:!0},normalMap:{scope:r.TechniqueRendering,automatic:!0},displacementMap:{scope:r.TechniqueRendering,automatic:!0},roughnessMap:{scope:r.TechniqueRendering,automatic:!0},emissiveMap:{scope:r.TechniqueRendering,automatic:!0},bumpMap:{scope:r.TechniqueRendering,automatic:!0},metalnessMap:{scope:r.TechniqueRendering,automatic:!0},alphaMap:{scope:r.TechniqueRendering,automatic:!0}}}),f={"extruded-polygon":i(n,{attrDescriptors:{depthTest:{scope:r.TechniqueRendering,automatic:!0},vertexColors:{scope:r.TechniqueRendering,automatic:!0},opacity:{scope:r.TechniqueRendering,automatic:!0},color:{scope:r.TechniqueRendering,automatic:!0},colorIntensity:{scope:r.TechniqueRendering,automatic:!0},specular:{scope:r.TechniqueRendering,automatic:!0},emissive:{scope:r.TechniqueRendering,automatic:!0},emissiveIntensity:{scope:r.TechniqueRendering,automatic:!0},shininess:{scope:r.TechniqueRendering,automatic:!0},displacementMap:{scope:r.TechniqueRendering,automatic:!0},height:r.FeatureGeometry,floorHeight:r.FeatureGeometry,defaultColor:r.FeatureGeometry,defaultHeight:r.FeatureGeometry,boundaryWalls:r.FeatureGeometry,footprint:r.FeatureGeometry,maxSlope:r.FeatureGeometry,animateExtrusion:r.TechniqueRendering,lineWidth:r.TechniqueRendering,lineFadeNear:r.TechniqueRendering,lineFadeFar:r.TechniqueRendering,lineColor:r.TechniqueRendering}}),"line-marker":u,"labeled-icon":u,"solid-line":h,"dashed-line":h,terrain:p,standard:p,squares:o,circles:a,line:c,segments:c,polygon:d,text:i(n,{attrDescriptors:{text:r.FeatureGeometry,backgroundColor:r.TechniqueRendering,backgroundSize:r.TechniqueRendering,backgroundOpacity:r.TechniqueRendering,color:r.TechniqueRendering,opacity:r.TechniqueRendering,size:r.TechniqueRendering,priority:r.TechniqueRendering,zOrder:r.TechniqueRendering}}),raster:i(n,{attrDescriptors:{brightness:{scope:r.TechniqueRendering,automatic:!0},gamma:{scope:r.TechniqueRendering,automatic:!0}}})};function m(t){return"string"!=typeof t&&(t=t.name),f[t]}e.getTechniqueDescriptor=m,e.getTechniqueAttributeDescriptor=function(t,e){const r=m(t),i=null==r?void 0:r.attrDescriptors,n=null==i?void 0:i[e];if(void 0!==typeof n)return"object"==typeof n?n:{scope:n}};const y=new Map;e.getTechniqueAutomaticAttrs=function(t){var e;if("string"!=typeof t&&(t=t.name),y.has(t))return y.get(t);const r=[],i=null===(e=m(t))||void 0===e?void 0:e.attrDescriptors;if(void 0===i)return r;for(const t in i){if(!i.hasOwnProperty(t))continue;const e=i[t];void 0!==e&&"number"!=typeof e&&!0===e.automatic&&r.push(t)}return y.set(t,r),r}},8934:(t,e,r)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.ThreeBufferUtils=void 0;const i=r(3253);!function(t){function e(t){if(t instanceof Int8Array)return"int8";if(t instanceof Uint8Array)return"uint8";if(t instanceof Int16Array)return"int16";if(t instanceof Uint16Array)return"uint16";if(t instanceof Int32Array)return"int32";if(t instanceof Uint32Array)return"uint32";if(t instanceof Float32Array)return"float";throw new Error(`Unsupported buffer type ${name}`)}function r(t){const r=t.array;return{name:t.name,buffer:r.buffer,type:e(r),itemCount:t.itemSize,normalized:t.normalized}}t.getBufferElementType=e,t.fromThreeBufferAttribute=r,t.fromThreeInterleavedBufferAttribute=function(t){throw new Error("Not implemented yet")},t.fromThreeBufferGeometry=function(t,e){const n=[],s=Object.getOwnPropertyNames(t.attributes);for(const e of s){const i=r(t.attributes[e]);i.name=e,n.push(i)}const o=null!==t.index?r(t.index):void 0;let a=0;if(void 0!==o)a=null===t.index?0:t.index.count;else{const e=t.attributes.position;if(void 0===e)throw new Error("Missing position attibute to deduce item count");a=e.count}return{type:i.GeometryType.Unspecified,vertexAttributes:n,index:o,groups:[{start:0,count:a,technique:e}]}}}(e.ThreeBufferUtils||(e.ThreeBufferUtils={}))},8770:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},9362:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerDecoderProtocol=e.RequestController=void 0,e.RequestController=class{constructor(t=0,e=new AbortController){this.priority=t,this.abortController=e}get signal(){return this.abortController.signal}abort(){this.abortController.abort()}},function(t){let e,r;!function(t){t.Configuration="configuration"}(e=t.DecoderMessageName||(t.DecoderMessageName={})),t.isConfigurationMessage=function(t){return t&&"string"==typeof t.service&&"string"==typeof t.type&&t.type===e.Configuration},function(t){t.DecodeTileRequest="decode-tile-request",t.TileInfoRequest="tile-info-request"}(r=t.Requests||(t.Requests={})),t.isDecodeTileRequest=function(t){return t&&"string"==typeof t.type&&t.type===r.DecodeTileRequest},t.isTileInfoRequest=function(t){return t&&"string"==typeof t.type&&t.type===r.TileInfoRequest}}(e.WorkerDecoderProtocol||(e.WorkerDecoderProtocol={}))},4835:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerServiceProtocol=void 0,function(t){let e,r;t.WORKER_SERVICE_MANAGER_SERVICE_ID="worker-service-manager",function(t){t.Initialized="initialized",t.Request="request",t.Response="response"}(e=t.ServiceMessageName||(t.ServiceMessageName={})),t.isInitializedMessage=function(t){return t&&"string"==typeof t.service&&"string"==typeof t.type&&t.type===e.Initialized},function(t){t.CreateService="create-service",t.DestroyService="destroy-service"}(r=t.Requests||(t.Requests={})),t.isUnknownServiceError=function(t){return t.message.includes("unknown targetServiceType requested: ")},t.isRequestMessage=function(t){return t&&"string"==typeof t.service&&"string"==typeof t.type&&t.type===e.Request},t.isResponseMessage=function(t){return t&&"string"==typeof t.service&&"string"==typeof t.type&&t.type===e.Response}}(e.WorkerServiceProtocol||(e.WorkerServiceProtocol={}))},9421:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerTilerProtocol=void 0,function(t){let e;!function(t){t.RegisterIndex="register-index",t.UpdateIndex="update-index",t.TileRequest="tile-request"}(e=t.Requests||(t.Requests={})),t.isRegisterIndexRequest=function(t){return t&&"string"==typeof t.type&&t.type===e.RegisterIndex},t.isUpdateIndexRequest=function(t){return t&&"string"==typeof t.type&&t.type===e.UpdateIndex},t.isTileRequest=function(t){return t&&"string"==typeof t.type&&t.type===e.TileRequest}}(e.WorkerTilerProtocol||(e.WorkerTilerProtocol={}))},6112:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.wrapLineString=e.clipLineString=void 0;const i=r(5448),n=r(6815),s=r(2616),o=r(4342);class a{constructor(t,e,r,n,s){this.isInside=s,this.p0=new i.Vector2(t,e),this.p1=new i.Vector2(r,n)}inside(t){return this.isInside(t)}computeIntersection(t,e){const r=new i.Vector2;return o.Math2D.intersectLines(t.x,t.y,e.x,e.y,this.p0.x,this.p0.y,this.p1.x,this.p1.y,r),r}clipLine(t){const e=t,r=[];t=[],r.push(t);const i=e=>{0!==t.length&&t[t.length-1].equals(e)||t.push(e)};for(let n=0;n<e.length;++n){const s=e[n],o=n>0?e[n-1]:void 0;this.inside(s)?(void 0===o||this.inside(o)||(t.length>0&&(t=[],r.push(t)),i(this.computeIntersection(o,s))),i(s)):void 0!==o&&this.inside(o)&&i(this.computeIntersection(o,s))}return 0===r[r.length-1].length&&(r.length=r.length-1),r}clipLines(t){const e=[];return t.forEach((t=>{this.clipLine(t).forEach((t=>{e.push(t)}))})),e}}function u(t,e,r){for(const r of e)t=r.clipLines(t);const i=new n.Vector3,o=[];return t.forEach((t=>{if(0===t.length)return;const e=t.map((({x:t,y:e})=>{i.set(t,e,0);const n=s.webMercatorProjection.unprojectPoint(i);return n.longitude+=r,n}));o.push(e)})),o.length>0?o:void 0}e.clipLineString=function(t,e,r,i,n){const s=new a(e,r,e,n,(t=>t.x>e)),o=new a(e,n,i,n,(t=>t.y<n)),u=new a(i,n,i,r,(t=>t.x<i)),l=new a(i,r,e,r,(t=>t.y>r));let h=s.clipLine(t);return h=o.clipLines(h),h=u.clipLines(h),h=l.clipLines(h),h},e.wrapLineString=function(t){const e=new n.Vector3,r=[t.map((t=>{const{x:r,y:n}=s.webMercatorProjection.projectPoint(t,e);return new i.Vector2(r,n)}))];return{left:u(r,c,360),middle:u(r,h,0),right:u(r,d,-360)}};const l=s.EarthConstants.EQUATORIAL_CIRCUMFERENCE,h=[new a(0,l,0,0,(t=>t.x>0)),new a(l+0,0,l+0,l,(t=>t.x<l+0))],c=[new a(-l-0,l,-l-0,0,(t=>t.x>-l-0)),new a(0,0,0,l,(t=>t.x<0))],d=[new a(l-0,l,l-0,0,(t=>t.x>l-0)),new a(2*l+0,0,2*l+0,l,(t=>t.x<2*l+0))]},2982:(t,e,r)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.clipPolygon=e.ClippingEdge=void 0;const i=r(5448);class n{clipPolygon(t,e){const r=t;t=[];const i=e=>{const r=t[t.length-1];(!(null==r?void 0:r.equals(e))||!0===e.isClipped&&!(null==r?void 0:r.isClipped)||!e.isClipped&&!0===(null==r?void 0:r.isClipped))&&t.push(e)};for(let t=0;t<r.length;++t){const n=r[t],s=r[(t+r.length-1)%r.length];if(this.inside(n,e)){if(!this.inside(s,e)){const t=this.computeIntersection(s,n,e);t.isClipped=!0,i(t)}i(n)}else if(this.inside(s,e)){const t=this.computeIntersection(s,n,e);t.isClipped=!0,i(t)}}return t}}e.ClippingEdge=n;const s=[new class extends n{inside(t){return t.y>=0}computeIntersection(t,e){const{x:r,y:n}=t,{x:s,y:o}=e;return new i.Vector2((r*o-n*s)/-(n-o),0).round()}},new class extends n{inside(t,e){return t.x<=e}computeIntersection(t,e,r){const{x:n,y:s}=t,{x:o,y:a}=e;return new i.Vector2(r,(n*a-s*o-(s-a)*-r)/(n-o)).round()}},new class extends n{inside(t,e){return t.y<=e}computeIntersection(t,e,r){const{x:n,y:s}=t,{x:o,y:a}=e;return new i.Vector2((n*a-s*o-(n-o)*r)/-(s-a),r).round()}},new class extends n{inside(t){return t.x>=0}computeIntersection(t,e){const{x:r,y:n}=t,{x:s,y:o}=e;return new i.Vector2(0,(r*o-n*s)/(r-s)).round()}}];e.clipPolygon=function(t,e){if(0===t.length)return t;t[0].equals(t[t.length-1])||(t=[...t,t[0]]);for(const r of s)t=r.clipPolygon(t,e);return t.length<3?[]:t}},6525:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EdgeLengthGeometrySubdivisionModifier=e.SubdivisionMode=void 0;const i=r(6815),n=r(2616),s=r(4342),o=r(3386),a=[new i.Vector3,new i.Vector3];var u;!function(t){t[t.All=0]="All",t[t.NoDiagonals=1]="NoDiagonals"}(u=e.SubdivisionMode||(e.SubdivisionMode={}));class l extends o.SubdivisionModifier{constructor(t,e,r=u.All,i){super(),this.subdivision=t,this.geoBox=e,this.subdivisionMode=r,this.projection=i,(0,s.assert)(i.type===n.ProjectionType.Planar,"EdgeLengthGeometrySubdivisionModifier only supports planar projections");const o=i.projectPoint(e.northEast,a[0]),l=i.projectPoint(e.southWest,a[1]);this.m_projectedBox={min:{x:Math.min(o.x,l.x),y:Math.min(o.y,l.y),z:Math.min(o.z,l.z)},max:{x:Math.max(o.x,l.x),y:Math.max(o.y,l.y),z:Math.max(o.z,l.z)}},this.m_maxLengthX=(this.m_projectedBox.max.x-this.m_projectedBox.min.x)/t,this.m_maxLengthY=(this.m_projectedBox.max.y-this.m_projectedBox.min.y)/t,this.subdivisionMode===u.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(t,e,r){const i=this.shouldSplitEdge(t,e),n=this.shouldSplitEdge(e,r),s=this.shouldSplitEdge(r,t);if(!(i||n||s))return;const o=t.distanceTo(e),a=e.distanceTo(r),u=r.distanceTo(t),l=Math.max(i?o:0,n?a:0,s?u:0);if(o===l)return 0;if(a===l)return 1;if(u===l)return 2;throw new Error("Could not split triangle.")}shouldSplitEdge(t,e){switch(this.subdivisionMode){case u.All:return t.y===e.y&&Math.abs(t.x-e.x)>this.m_maxLengthX||t.x===e.x&&Math.abs(t.y-e.y)>this.m_maxLengthY||t.distanceTo(e)>this.m_maxLength;case u.NoDiagonals:return t.y===e.y&&Math.abs(t.x-e.x)>this.m_maxLengthX||t.x===e.x&&Math.abs(t.y-e.y)>this.m_maxLengthY}}}e.EdgeLengthGeometrySubdivisionModifier=l},6189:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SphericalGeometrySubdivisionModifier=void 0;const i=r(6815),n=r(2616),s=r(3386),o=[new i.Vector3,new i.Vector3,new i.Vector3];class a extends s.SubdivisionModifier{constructor(t,e=n.sphereProjection){super(),this.angle=t,this.projection=e}shouldSplitTriangle(t,e,r){const i=n.sphereProjection.reprojectPoint(this.projection,t,o[0]),s=n.sphereProjection.reprojectPoint(this.projection,e,o[1]),a=n.sphereProjection.reprojectPoint(this.projection,r,o[2]),u=i.angleTo(s),l=s.angleTo(a),h=a.angleTo(i),c=Math.max(u,Math.max(l,h));if(!(c<this.angle)){if(c===u)return 0;if(c===l)return 1;if(c===h)return 2;throw new Error("failed to split triangle")}}}e.SphericalGeometrySubdivisionModifier=a},3386:(t,e,r)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.SubdivisionModifier=void 0;const i=r(6815),n=new i.Vector3,s=new i.Vector3,o=new i.Vector3;e.SubdivisionModifier=class{constructor(){}modify(t){const e=t.getAttribute("position"),r=Array.from(e.array),i=t.getAttribute("uv"),a=void 0!==i?Array.from(i.array):void 0,u=t.getAttribute("edge"),l=void 0!==u?Array.from(u.array):void 0,h=t.getAttribute("wall"),c=void 0!==h?Array.from(h.array):void 0,d=t.getIndex(),p=Array.from(d.array),f=new Map;function m(t,e){const i=`${Math.min(t,e)}_${Math.max(t,e)}`,u=f.get(i);if(void 0!==u)return u;n.set(r[3*t],r[3*t+1],r[3*t+2]),s.set(r[3*e],r[3*e+1],r[3*e+2]),o.lerpVectors(n,s,.5);const h=r.length/3;return r.push(...o.toArray()),f.set(i,h),void 0!==a&&(n.set(a[2*t],a[2*t+1],0),s.set(a[2*e],a[2*e+1],0),o.lerpVectors(n,s,.5),a.push(o.x,o.y)),void 0!==l&&(l[t]===e?(l.push(e),l[t]=h):l[e]===t?(l.push(t),l[e]=h):l.push(-1)),void 0!==c&&(c[t]===e?(c.push(e),c[t]=h):c[e]===t?(c.push(t),c[e]=h):c.push(-1)),h}const y=[];for(;p.length>=3;){const t=p.shift(),e=p.shift(),i=p.shift();switch(n.set(r[3*t],r[3*t+1],r[3*t+2]),s.set(r[3*e],r[3*e+1],r[3*e+2]),o.set(r[3*i],r[3*i+1],r[3*i+2]),this.shouldSplitTriangle(n,s,o)){case 0:{const r=m(t,e);p.push(t,r,i,r,e,i);break}case 1:{const r=m(e,i);p.push(t,e,r,t,r,i);break}case 2:{const r=m(i,t);p.push(t,e,r,r,e,i);break}case void 0:y.push(t,e,i);break;default:throw new Error("failed to subdivide the given geometry")}}return e.array=e.array instanceof Float32Array?new Float32Array(r):new Float64Array(r),e.count=r.length/e.itemSize,e.needsUpdate=!0,t.setIndex(y),void 0!==a&&(i.array=new Float32Array(a),i.count=a.length/i.itemSize,i.needsUpdate=!0),void 0!==l&&(u.array=new Float32Array(l),u.count=l.length/u.itemSize,u.needsUpdate=!0),t}}},2616:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(3068),e),n(r(5999),e),n(r(6306),e),n(r(4860),e),n(r(8248),e),n(r(9019),e),n(r(6482),e),n(r(7870),e),n(r(5610),e),n(r(1515),e),n(r(9686),e),n(r(5234),e),n(r(9885),e),n(r(7289),e),n(r(6322),e),n(r(9861),e),n(r(435),e),n(r(9447),e),n(r(7171),e),n(r(3424),e),n(r(4948),e),n(r(6541),e),n(r(7841),e),n(r(2801),e),n(r(6557),e),n(r(4490),e),n(r(2224),e),n(r(1635),e),n(r(1871),e),n(r(2953),e),n(r(1383),e),n(r(9264),e),n(r(58),e),n(r(7523),e),n(r(2683),e),n(r(2334),e)},3068:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GeoBox=void 0;const i=r(3334),n=r(4860);class s{static fromCoordinates(t,e){return new s(t,e)}static fromCenterAndExtents(t,e){return new s(new n.GeoCoordinates(t.latitude-e.latitudeSpan/2,t.longitude-e.longitudeSpan/2),new n.GeoCoordinates(t.latitude+e.latitudeSpan/2,t.longitude+e.longitudeSpan/2))}constructor(t,e){this.southWest=t,this.northEast=e,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 t=.5*(this.south+this.north),{west:e,east:r}=this,{minAltitude:i,altitudeSpan:s}=this;let o;if(void 0!==i&&void 0!==s&&(o=i+.5*s),e<=r)return new n.GeoCoordinates(t,.5*(e+r),o);let a=.5*(360+r+e);return a>360&&(a-=360),new n.GeoCoordinates(t,a,o)}get latitudeSpanInRadians(){return(0,i.degToRad)(this.latitudeSpan)}get longitudeSpanInRadians(){return(0,i.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 t=this.northEast.longitude-this.southWest.longitude;return t<0&&(t+=360),t}get latitudeSpanInDegrees(){return this.latitudeSpan}get longitudeSpanInDegrees(){return this.longitudeSpan}contains(t){if(void 0===t.altitude||void 0===this.minAltitude||void 0===this.maxAltitude)return this.containsHelper(t);const e=this.minAltitude===this.maxAltitude,r=this.minAltitude===t.altitude,i=this.minAltitude<=t.altitude&&this.maxAltitude>t.altitude;return!!(e?r:i)&&this.containsHelper(t)}clone(){return new s(this.southWest.clone(),this.northEast.clone())}growToContain(t){this.southWest.latitude=Math.min(this.southWest.latitude,t.latitude),this.southWest.longitude=Math.min(this.southWest.longitude,t.longitude),this.southWest.altitude=void 0!==this.southWest.altitude&&void 0!==t.altitude?Math.min(this.southWest.altitude,t.altitude):void 0!==this.southWest.altitude?this.southWest.altitude:void 0!==t.altitude?t.altitude:void 0,this.northEast.latitude=Math.max(this.northEast.latitude,t.latitude),this.northEast.longitude=Math.max(this.northEast.longitude,t.longitude),this.northEast.altitude=void 0!==this.northEast.altitude&&void 0!==t.altitude?Math.max(this.northEast.altitude,t.altitude):void 0!==this.northEast.altitude?this.northEast.altitude:void 0!==t.altitude?t.altitude:void 0}containsHelper(t){if(t.latitude<this.southWest.latitude||t.latitude>=this.northEast.latitude)return!1;const{west:e,east:r}=this;let i=t.longitude;if(r>n.MAX_LONGITUDE)for(;i<e;)i+=360;if(i>r)for(;i>e+360;)i-=360;return i>=e&&i<r}}e.GeoBox=s},5999:(t,e)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.isGeoBoxExtentLike=void 0,e.isGeoBoxExtentLike=function(t){return t&&"object"==typeof t&&"number"==typeof t.latitudeSpan&&"number"==typeof t.longitudeSpan}},680:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isGeoCoordLike=e.geoCoordLikeToGeoPointLike=e.geoCoordLikeToGeoCoordinatesLike=void 0;const i=r(6306),n=r(8248),s=r(7870);e.geoCoordLikeToGeoCoordinatesLike=function(t){return(0,i.isGeoCoordinatesLike)(t)?t:(0,s.isLatLngLike)(t)?{latitude:t.lat,longitude:t.lng}:{latitude:t[1],longitude:t[0]}},e.geoCoordLikeToGeoPointLike=function(t){return(0,n.isGeoPointLike)(t)?t:(0,s.isLatLngLike)(t)?[t.lng,t.lat]:[t.longitude,t.latitude]},e.isGeoCoordLike=function(t){return(0,i.isGeoCoordinatesLike)(t)||(0,s.isLatLngLike)(t)||!(0,n.isGeoPointLike)(t)}},4860:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GeoCoordinates=e.MIN_LONGITUDE=e.MAX_LONGITUDE=e.MIN_LATITUDE=e.MAX_LATITUDE=void 0;const i=r(6815),n=r(3334),s=r(6306),o=r(8248),a=r(7870);e.MAX_LATITUDE=90,e.MIN_LATITUDE=-90,e.MAX_LONGITUDE=180,e.MIN_LONGITUDE=-180;const u=new i.Vector3,l=new i.Vector3;class h{static fromDegrees(t,e,r){return new h(t,e,r)}static fromRadians(t,e,r){return new h((0,n.radToDeg)(t),(0,n.radToDeg)(e),r)}static fromLatLng(t){return new h(t.lat,t.lng)}static fromGeoPoint(t){return new h(t[1],t[0],t[2])}static fromObject(t){if((0,o.isGeoPointLike)(t))return h.fromGeoPoint(t);if((0,s.isGeoCoordinatesLike)(t))return h.fromDegrees(t.latitude,t.longitude,t.altitude);if((0,a.isLatLngLike)(t))return h.fromDegrees(t.lat,t.lng);throw new Error("Invalid input coordinate format.")}static lerp(t,e,r,i=!1,n=!1){var s,o;if(i){if(t.lng<e.lng){const i=t.clone();return i.longitude+=360,this.lerp(e,i,1-r)}{const i=e.clone();return i.longitude+=360,this.lerp(t,i,r)}}const a=u.set(t.lat,t.lng,null!==(s=t.altitude)&&void 0!==s?s:0),c=l.set(e.lat,e.lng,null!==(o=e.altitude)&&void 0!==o?o:0);a.lerp(c,r);const d=new h(a.x,a.y,a.z);return n?d.normalized():d}constructor(t,e,r){this.latitude=t,this.longitude=e,this.altitude=r}get latitudeInRadians(){return(0,n.degToRad)(this.latitude)}get longitudeInRadians(){return(0,n.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:t,longitude:e}=this;return isNaN(t)||isNaN(e)?this:((e<-180||e>180)&&(e=function(t){const e=t%360;return e<0==0?e:e+360}(e+180)-180),t=(0,n.clamp)(t,-90,90),new h(t,e,this.altitude))}equals(t){return this.latitude===t.latitude&&this.longitude===t.longitude&&this.altitude===t.altitude}copy(t){return this.latitude=t.latitude,this.longitude=t.longitude,this.altitude=t.altitude,this}clone(){return new h(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(t){const e=Math.min(this.longitude,t.longitude),r=Math.max(this.longitude,t.longitude);return Math.min(r-e,360+e-r)}}e.GeoCoordinates=h},6306:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isGeoCoordinatesLike=void 0,e.isGeoCoordinatesLike=function(t){return t&&"number"==typeof t.latitude&&"number"==typeof t.longitude&&("number"==typeof t.altitude||void 0===t.altitude)}},8248:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isGeoPointLike=void 0,e.isGeoPointLike=function(t){if(Array.isArray(t)){const[e,r,i]=t;return"number"==typeof e&&"number"==typeof r&&(void 0===i||"number"==typeof i)}return!1}},6482:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPolygon=e.isAntimeridianCrossing=void 0;const i=r(5448),n=r(3068),s=r(4860),o=r(680);function a(t,e){return Math.max(t,e)-Math.min(t,e)}function u(t,e){return t>0&&e<0&&a(t,e)>180}e.isAntimeridianCrossing=function(t,e){return Math.sign(t)===-Math.sign(e)&&a(t,e)>180},e.GeoPolygon=class{constructor(t,e=!1,r=!1){this.m_coordinates=t.map((t=>(0,o.geoCoordLikeToGeoCoordinatesLike)(t))),e&&this.sortCCW(),r&&this.wrapCoordinatesAround()}get coordinates(){return this.m_coordinates}getGeoBoundingBox(){const t=this.getCentroid();if(void 0===t)return n.GeoBox.fromCoordinates(this.coordinates[0],this.coordinates[0]);const{east:e,west:r}=this.getEastAndWest(t),{north:i,south:o}=this.getNorthAndSouth();return n.GeoBox.fromCoordinates(new s.GeoCoordinates(o,r),new s.GeoCoordinates(i,e))}getCentroid(){const t=this.getArea();if(0===t)return;let e,r=0,i=0,n=this.m_coordinates.length-1;
2return this.m_coordinates.forEach(((t,s)=>{const o=this.m_coordinates[n];e=t.latitude*o.longitude-o.latitude*t.longitude,r+=(t.latitude+o.latitude)*e,i+=(t.longitude+o.longitude)*e,n=s})),e=6*t,new s.GeoCoordinates(r/e,t<0?i/e-180:i/e)}sortCCW(){const t=this.getPolyAverageCenter();t&&this.m_coordinates.sort(((e,r)=>{const n=new i.Vector2(e.latitude-t.latitude,e.longitude-t.longitude).normalize();return new i.Vector2(r.latitude-t.latitude,r.longitude-t.longitude).normalize().angle()-n.angle()}))}wrapCoordinatesAround(){const t=this.m_coordinates.findIndex(((t,e)=>{const r=0===e?this.m_coordinates.length-1:e-1;return u(this.m_coordinates[r].longitude,t.longitude)}));if(t<0)return;let e=!0;for(let r=0;r<this.m_coordinates.length;r++){const i=(t+r)%this.m_coordinates.length,n=this.m_coordinates[i].longitude,s=this.m_coordinates[(i+1)%this.m_coordinates.length].longitude;e&&(this.m_coordinates[i].longitude+=360),u(s,n)?e=!1:u(n,s)&&(e=!0)}}getPolyAverageCenter(){const t=this.m_coordinates.reduce(((t,e)=>new s.GeoCoordinates(t.latitude+e.latitude,t.longitude+e.longitude)));return new s.GeoCoordinates(t.latitude/this.m_coordinates.length,t.longitude/this.m_coordinates.length)}getArea(){let t=0,e=this.m_coordinates.length-1;return this.m_coordinates.forEach(((r,i)=>{const n=this.m_coordinates[e];t+=r.latitude*n.longitude,t-=r.longitude*n.latitude,e=i})),t/=2}getEastAndWest(t){let e=t.longitude,r=t.longitude,n=this.m_coordinates.length-1;return this.m_coordinates.forEach(((s,o)=>{const a=this.m_coordinates[n];n=o;const u=new i.Vector2(s.latitude-t.latitude,s.longitude-t.longitude).normalize(),l=new i.Vector2(a.latitude-t.latitude,a.longitude-t.longitude).normalize();let h=1===Math.sign(l.angle()-u.angle());l.y>=0&&u.y<0&&(h=!0);const c=s.longitude;c<t.longitude?h?e=Math.min(e,c):r=Math.min(r,c):h?r=Math.max(r,c):e=Math.max(e,c)})),{east:r,west:e}}getNorthAndSouth(){let t=s.MIN_LATITUDE,e=s.MAX_LATITUDE;return this.m_coordinates.forEach(((r,i)=>{t=Math.max(t,r.latitude),e=Math.min(e,r.latitude)})),{north:t,south:e}}}},9019:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isGeoPolygonLike=void 0;const i=r(680);e.isGeoPolygonLike=function(t){if(!t||!Array.isArray(t.coordinates)&&t.coordinates.length>2)return!1;let e=!0;return t.coordinates.forEach((r=>{(0,i.isGeoCoordLike)(t)||(e=!1)})),e}},7870:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isLatLngLike=void 0,e.isLatLngLike=function(t){return t&&"number"==typeof t.lat&&"number"==typeof t.lng}},9264:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isBox3Like=void 0,e.isBox3Like=function(t){const e=t;return void 0!==e.min&&void 0!==e.max}},7523:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MathUtils=void 0;const i=r(3334);!function(t){function e(t){return(t%=360)<0&&(t+=360),t}function r(t,r){const i=(t=e(t))-(r=e(r));return i>180?i-360:i<=-180?i+360:i}t.newEmptyBox3=function(){return{min:{x:1/0,y:1/0,z:1/0},max:{x:-1/0,y:-1/0,z:-1/0}}},t.newVector3=function(t,e,r,i){return void 0===i?{x:t,y:e,z:r}:(i.x=t,i.y=e,i.z=r,i)},t.copyVector3=function(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e},t.degToRad=i.degToRad,t.radToDeg=i.radToDeg,t.clamp=i.clamp,t.normalizeAngleDeg=e,t.normalizeLongitudeDeg=function(t){return(t=e(t))>180&&(t-=360),t},t.angleDistanceDeg=r,t.interpolateAnglesDeg=function(t,e,i){return(t+r(e,t)*i)%360}}(e.MathUtils||(e.MathUtils={}))},2334:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OrientedBox3=void 0;const i=r(8333),n=r(6815);function s(t,e,r,i,n){const s=r.dot(e),o=r.dot(t);if(Math.abs(o)<1e-20)return Math.abs(s)<=i;const a=1/o,u=(s+i)*a,l=(s-i)*a;return u>l?(l>n.min&&(n.min=l),u<n.max&&(n.max=u)):(u>n.min&&(n.min=u),l<n.max&&(n.max=l)),n.min<=n.max&&n.max>=0}const o=new n.Vector3,a={min:-1/0,max:1/0};class u{constructor(t,e,r){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!==t&&this.position.copy(t),void 0!==e&&e.extractBasis(this.xAxis,this.yAxis,this.zAxis),void 0!==r&&this.extents.copy(r)}clone(){const t=new u;return t.copy(this),t}copy(t){this.position.copy(t.position),this.xAxis.copy(t.xAxis),this.yAxis.copy(t.yAxis),this.zAxis.copy(t.zAxis),this.extents.copy(t.extents)}getCenter(t=new n.Vector3){return t.copy(this.position)}getSize(t=new n.Vector3){return t.copy(this.extents).multiplyScalar(2)}getRotationMatrix(t=new i.Matrix4){return t.makeBasis(this.xAxis,this.yAxis,this.zAxis)}intersects(t){const e=Array.isArray(t)?t:t.planes;for(const t of e){const e=Math.abs(t.normal.dot(this.xAxis)*this.extents.x)+Math.abs(t.normal.dot(this.yAxis)*this.extents.y)+Math.abs(t.normal.dot(this.zAxis)*this.extents.z);if(t.distanceToPoint(this.position)+e<0)return!1}return!0}intersectsRay(t){if(a.min=-1/0,a.max=1/0,o.copy(this.position).sub(t.origin),s(t.direction,o,this.xAxis,this.extents.x,a)&&s(t.direction,o,this.yAxis,this.extents.y,a)&&s(t.direction,o,this.zAxis,this.extents.z,a))return a.min>0?a.min:a.max}contains(t){const e=t.x-this.position.x,r=t.y-this.position.y,i=t.z-this.position.z,n=Math.abs(e*this.xAxis.x+r*this.xAxis.y+i*this.xAxis.z),s=Math.abs(e*this.yAxis.x+r*this.yAxis.y+i*this.yAxis.z),o=Math.abs(e*this.zAxis.x+r*this.zAxis.y+i*this.zAxis.z);return!(n>this.extents.x||s>this.extents.y||o>this.extents.z)}distanceToPoint(t){return Math.sqrt(this.distanceToPointSquared(t))}distanceToPointSquared(t){const e=new n.Vector3;e.subVectors(t,this.position);const r=[e.dot(this.xAxis),e.dot(this.yAxis),e.dot(this.zAxis)];let i=0;for(let t=0;t<3;++t){const e=r[t],n=this.extents.getComponent(t);if(e<-n){const t=n+e;i+=t*t}else if(e>n){const t=e-n;i+=t*t}}return i}}e.OrientedBox3=u},58:(t,e)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.isOrientedBox3Like=void 0,e.isOrientedBox3Like=function(t){const e=t;return void 0!==e.position&&void 0!==e.xAxis&&void 0!==e.yAxis&&void 0!==e.zAxis&&void 0!==e.extents}},2683:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isTransformLike=void 0,e.isTransformLike=function(t){const e=t;return void 0!==e.position&&void 0!==e.xAxis&&void 0!==e.yAxis&&void 0!==e.zAxis}},2953:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isVector2Like=void 0,e.isVector2Like=function(t){return t&&"number"==typeof t.x&&"number"==typeof t.y}},1383:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isVector3Like=void 0,e.isVector3Like=function(t){return t&&"number"==typeof t.x&&"number"==typeof t.y&&"number"==typeof t.z}},5610:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EarthConstants=void 0;class r{}e.EarthConstants=r,r.EQUATORIAL_CIRCUMFERENCE=40075016.68557849,r.EQUATORIAL_RADIUS=6378137,r.MIN_ELEVATION=-433,r.MAX_ELEVATION=8848,r.MAX_BUILDING_HEIGHT=828},1515:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.equirectangularProjection=e.normalizedEquirectangularProjection=void 0;const i=r(3334),n=r(2754),s=r(3068),o=r(4860),a=r(9264),u=r(7523),l=r(58),h=r(5610),c=r(5234);class d extends c.Projection{constructor(){super(...arguments),this.type=c.ProjectionType.Planar}getScaleFactor(t){return 1}worldExtent(t,e,r){return r||(r=new n.Box3),r.min.x=0,r.min.y=0,r.min.z=t,r.max.x=this.unitScale,r.max.y=this.unitScale/2,r.max.z=e,r}projectPoint(t,e){var r;return void 0===e&&(e={x:0,y:0,z:0}),e.x=((0,i.degToRad)(t.longitude)+Math.PI)*d.geoToWorldScale*this.unitScale,e.y=((0,i.degToRad)(t.latitude)+.5*Math.PI)*d.geoToWorldScale*this.unitScale,e.z=null!==(r=t.altitude)&&void 0!==r?r:0,e}unprojectPoint(t){return o.GeoCoordinates.fromRadians(t.y*d.worldToGeoScale/this.unitScale-.5*Math.PI,t.x*d.worldToGeoScale/this.unitScale-Math.PI,t.z)}unprojectAltitude(t){return t.z}projectBox(t,e){const r=this.projectPoint(new o.GeoCoordinates(t.center.latitude,t.center.longitude,0)),{latitudeSpanInRadians:i,longitudeSpanInRadians:s,altitudeSpan:h}=t,c=s*d.geoToWorldScale,p=i*d.geoToWorldScale;return e||(e=new n.Box3),(0,a.isBox3Like)(e)?(e.min.x=r.x-.5*c*this.unitScale,e.min.y=r.y-.5*p*this.unitScale,e.max.x=r.x+.5*c*this.unitScale,e.max.y=r.y+.5*p*this.unitScale,void 0!==h?(e.min.z=r.z-.5*h,e.max.z=r.z+.5*h):(e.min.z=0,e.max.z=0)):(0,l.isOrientedBox3Like)(e)&&(u.MathUtils.newVector3(1,0,0,e.xAxis),u.MathUtils.newVector3(0,1,0,e.yAxis),u.MathUtils.newVector3(0,0,1,e.zAxis),e.position.x=r.x,e.position.y=r.y,e.position.z=r.z,e.extents.x=.5*c*this.unitScale,e.extents.y=.5*p*this.unitScale,e.extents.z=Math.max(Number.EPSILON,.5*(null!=h?h:0))),e}unprojectBox(t){const e=this.unprojectPoint(t.min),r=this.unprojectPoint(t.max);return s.GeoBox.fromCoordinates(e,r)}groundDistance(t){return t.z}scalePointToSurface(t){return t.z=0,t}surfaceNormal(t,e){return void 0===e?e={x:0,y:0,z:1}:(e.x=0,e.y=0,e.z=1),e}}d.geoToWorldScale=1/(2*Math.PI),d.worldToGeoScale=2*Math.PI/1,e.normalizedEquirectangularProjection=new d(1),e.equirectangularProjection=new d(h.EarthConstants.EQUATORIAL_CIRCUMFERENCE)},9686:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.identityProjection=void 0;const i=r(2754),n=r(3334),s=r(3068),o=r(4860),a=r(9264),u=r(7523),l=r(58),h=r(5234);class c extends h.Projection{constructor(){super(...arguments),this.type=h.ProjectionType.Planar}getScaleFactor(t){return 1}worldExtent(t,e,r){return r||(r=new i.Box3),r.min.x=-Math.PI,r.min.y=.5*-Math.PI,r.min.z=t,r.max.x=Math.PI,r.max.y=.5*Math.PI,r.max.z=e,r}projectPoint(t,e){var r;return e||(e={x:0,y:0,z:0}),e.x=(0,n.degToRad)(t.longitude),e.y=(0,n.degToRad)(t.latitude),e.z=null!==(r=t.altitude)&&void 0!==r?r:0,e}unprojectPoint(t){return o.GeoCoordinates.fromRadians(t.y,t.x,t.z)}unprojectAltitude(t){return t.z}projectBox(t,e){e||(e=new i.Box3);const r=this.projectPoint(new o.GeoCoordinates(t.south,t.west,t.minAltitude)),n=this.projectPoint(new o.GeoCoordinates(t.north,t.east,t.maxAltitude));return(0,a.isBox3Like)(e)?(e.min.x=r.x,e.min.y=r.y,e.min.z=r.z,e.max.x=n.x,e.max.y=n.y,e.max.z=n.z):(0,l.isOrientedBox3Like)(e)&&(u.MathUtils.newVector3(1,0,0,e.xAxis),u.MathUtils.newVector3(0,1,0,e.yAxis),u.MathUtils.newVector3(0,0,1,e.zAxis),e.position.x=.5*(r.x+n.x),e.position.y=.5*(r.y+n.y),e.position.z=.5*(r.z+n.z),e.extents.x=.5*(n.x-r.x),e.extents.y=.5*(n.y-r.y),e.extents.z=Math.max(Number.EPSILON,.5*(n.z-r.z))),e}unprojectBox(t){const e=this.unprojectPoint(t.min),r=this.unprojectPoint(t.max);return s.GeoBox.fromCoordinates(e,r)}groundDistance(t){return t.z}scalePointToSurface(t){return t.z=0,t}surfaceNormal(t,e){return void 0===e?e={x:0,y:0,z:1}:(e.x=0,e.y=0,e.z=1),e}}e.identityProjection=new c(1)},9885:(t,e,r)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.webMercatorProjection=e.mercatorProjection=e.MercatorConstants=void 0;const i=r(2754),n=r(3068),s=r(4860),o=r(6306),a=r(9264),u=r(7523),l=r(58),h=r(5610),c=r(5234);class d extends c.Projection{constructor(){super(...arguments),this.type=c.ProjectionType.Planar}static clamp(t,e,r){return Math.min(Math.max(e,t),r)}static latitudeClamp(t){return d.clamp(t,-p.MAXIMUM_LATITUDE,p.MAXIMUM_LATITUDE)}static latitudeProject(t){return Math.log(Math.tan(.25*Math.PI+.5*t))/Math.PI}static latitudeClampProject(t){return d.latitudeProject(d.latitudeClamp(t))}static unprojectLatitude(t){return 2*Math.atan(Math.exp(Math.PI*t))-.5*Math.PI}getScaleFactor(t){return Math.cosh(2*Math.PI*(t.y/this.unitScale-.5))}worldExtent(t,e,r){return r||(r=new i.Box3),r.min.x=0,r.min.y=0,r.min.z=t,r.max.x=this.unitScale,r.max.y=this.unitScale,r.max.z=e,r}projectPoint(t,e){var r;let i;return i=t instanceof s.GeoCoordinates?t:new s.GeoCoordinates(t.latitude,t.longitude,t.altitude),e||(e={x:0,y:0,z:0}),e.x=(i.longitude+180)/360*this.unitScale,e.y=(.5*d.latitudeClampProject(i.latitudeInRadians)+.5)*this.unitScale,e.z=null!==(r=i.altitude)&&void 0!==r?r:0,e}unprojectPoint(t){return s.GeoCoordinates.fromRadians(d.unprojectLatitude(2*(t.y/this.unitScale-.5)),t.x/this.unitScale*2*Math.PI-Math.PI,t.z)}unprojectAltitude(t){return t.z}projectBox(t,e){var r;const n=this.projectPoint(t.center),s=(.5*d.latitudeClampProject(t.northEast.latitudeInRadians)+.5)*this.unitScale,o=(.5*d.latitudeClampProject(t.southWest.latitudeInRadians)+.5)*this.unitScale,h=.5*(s+o);n.y=h;const c=s-o,p=t.longitudeSpan/360*this.unitScale;if(e||(e=new i.Box3),(0,a.isBox3Like)(e)){e.min.x=n.x-.5*p,e.min.y=n.y-.5*c,e.max.x=n.x+.5*p,e.max.y=n.y+.5*c;const r=t.altitudeSpan;void 0!==r?(e.min.z=n.z-.5*r,e.max.z=n.z+.5*r):(e.min.z=0,e.max.z=0)}else{if(!(0,l.isOrientedBox3Like)(e))throw new Error("invalid bounding box");u.MathUtils.newVector3(1,0,0,e.xAxis),u.MathUtils.newVector3(0,1,0,e.yAxis),u.MathUtils.newVector3(0,0,1,e.zAxis),e.position.x=n.x,e.position.y=n.y,e.position.z=n.z,e.extents.x=.5*p,e.extents.y=.5*c,e.extents.z=Math.max(Number.EPSILON,.5*(null!==(r=t.altitudeSpan)&&void 0!==r?r:0))}return e}unprojectBox(t){const e=this.unprojectPoint(t.min),r=this.unprojectPoint(t.max);return n.GeoBox.fromCoordinates(e,r)}groundDistance(t){return t.z}scalePointToSurface(t){return t.z=0,t}surfaceNormal(t,e){return void 0===e?e={x:0,y:0,z:1}:(e.x=0,e.y=0,e.z=1),e}reprojectPoint(t,r,i){return t===this||t!==e.webMercatorProjection&&t!==e.mercatorProjection?super.reprojectPoint(t,r,i):(void 0===i&&(i={}),i.x=r.x,i.y=this.unitScale-r.y,i.z=r.z,i)}}class p{}e.MercatorConstants=p,p.MAXIMUM_LATITUDE=1.4844222297453322,e.mercatorProjection=new d(h.EarthConstants.EQUATORIAL_CIRCUMFERENCE),e.webMercatorProjection=new class extends d{projectPoint(t,e){var r;let i;i=t instanceof s.GeoCoordinates?t:new s.GeoCoordinates(t.latitude,t.longitude,t.altitude),e||(e={x:0,y:0,z:0}),e.x=(i.longitude+180)/360*this.unitScale;const n=Math.sin(d.latitudeClamp(i.latitudeInRadians));return e.y=(.5-Math.log((1+n)/(1-n))/(4*Math.PI))*this.unitScale,e.z=null!==(r=i.altitude)&&void 0!==r?r:0,e}unprojectPoint(t){const e=t.x/this.unitScale-.5,r=.5-t.y/this.unitScale,i=360*e,n=90-360*Math.atan(Math.exp(2*-r*Math.PI))/Math.PI;return new s.GeoCoordinates(n,i,t.z)}projectBox(t,e){const r=super.projectBox(t,e);if((0,a.isBox3Like)(r)){const t=r.max.y;r.max.y=this.unitScale-r.min.y,r.min.y=this.unitScale-t}else(0,l.isOrientedBox3Like)(r)&&(u.MathUtils.newVector3(1,0,0,r.xAxis),u.MathUtils.newVector3(0,-1,0,r.yAxis),u.MathUtils.newVector3(0,0,-1,r.zAxis),r.position.y=this.unitScale-r.position.y);return r}unprojectBox(t){const e=this.unprojectPoint(t.min),r=this.unprojectPoint(t.max);return new n.GeoBox(new s.GeoCoordinates(r.latitude,e.longitude,e.altitude),new s.GeoCoordinates(e.latitude,r.longitude,r.altitude))}surfaceNormal(t,e){return void 0===e?e={x:0,y:0,z:-1}:(e.x=0,e.y=0,e.z=-1),e}localTangentSpace(t,e){return(0,o.isGeoCoordinatesLike)(t)?this.projectPoint(t,e.position):u.MathUtils.copyVector3(t,e.position),u.MathUtils.newVector3(1,0,0,e.xAxis),u.MathUtils.newVector3(0,-1,0,e.yAxis),u.MathUtils.newVector3(0,0,-1,e.zAxis),e}}(h.EarthConstants.EQUATORIAL_CIRCUMFERENCE)},5234:(t,e,r)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.Projection=e.ProjectionType=void 0;const i=r(6306),n=r(7523);var s;(s=e.ProjectionType||(e.ProjectionType={}))[s.Planar=0]="Planar",s[s.Spherical=1]="Spherical",e.Projection=class{constructor(t){this.unitScale=t}localTangentSpace(t,e){return(0,i.isGeoCoordinatesLike)(t)?this.projectPoint(t,e.position):n.MathUtils.copyVector3(t,e.position),n.MathUtils.newVector3(1,0,0,e.xAxis),n.MathUtils.newVector3(0,1,0,e.yAxis),n.MathUtils.newVector3(0,0,1,e.zAxis),e}reprojectPoint(t,e,r){return t===this?void 0===r?{x:e.x,y:e.y,z:e.z}:(r.x=e.x,r.y=e.y,r.z=e.z,r):this.projectPoint(t.unprojectPoint(e),r)}}},6322:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sphereProjection=void 0;const i=r(2754),n=r(3334),s=r(4860),o=r(6306),a=r(9264),u=r(7523),l=r(58),h=r(5610),c=r(9885),d=r(5234);function p(t){const e=1/Math.PI,r=Math.floor(2*(t*e+1));return(0,n.clamp)(r,0,4)}function f(t){return Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)}function m(t,e,r){var i;const s=.5*(r+(null!==(i=t.maxAltitude)&&void 0!==i?i:0)),o=(0,n.degToRad)(t.west),a=(0,n.degToRad)(t.east),u=p(o),l=p(a);let h=Math.cos(o),c=h,d=Math.sin(o),f=d;for(let t=u+1;t<=l;t++){const e=(t+1&1)*((2&t)-1);h=Math.min(e,h),c=Math.max(e,c);const r=(1&t)*((2&t)-1);d=Math.min(r,d),f=Math.max(r,f)}const m=Math.cos(a);h=Math.min(m,h),c=Math.max(m,c);const y=Math.sin(a);d=Math.min(y,d),f=Math.max(y,f);const g=(c+h)*s,x=(c-h)*s,v=(f+d)*s,b=(f-d)*s,w=(0,n.degToRad)(t.south),_=(0,n.degToRad)(t.north),M=Math.sin(_),E=Math.sin(w),T=(M+E)*s,S=(M-E)*s;return e.min.x=g-x,e.min.y=v-b,e.min.z=T-S,e.max.x=g+x,e.max.y=v+b,e.max.z=T+S,e}class y extends d.Projection{constructor(){super(...arguments),this.type=d.ProjectionType.Spherical}worldExtent(t,e,r=new i.Box3){const n=this.unitScale+e;return r.min.x=-n,r.min.y=-n,r.min.z=-n,r.max.x=n,r.max.y=n,r.max.z=n,r}projectPoint(t,e=u.MathUtils.newVector3(0,0,0)){return function(t,e,r){var i;const s=r+(null!==(i=t.altitude)&&void 0!==i?i:0),o=(0,n.degToRad)(t.latitude),a=(0,n.degToRad)(t.longitude),u=Math.cos(o);return e.x=s*u*Math.cos(a),e.y=s*u*Math.sin(a),e.z=s*Math.sin(o),e}(t,e,this.unitScale)}unprojectPoint(t){const e=t.x*t.x+t.y*t.y,r=Math.sqrt(e),i=t.z/r;if(isNaN(i))return s.GeoCoordinates.fromRadians(0,0,-this.unitScale);const n=Math.sqrt(e+t.z*t.z);return s.GeoCoordinates.fromRadians(Math.atan(i),Math.atan2(t.y,t.x),n-this.unitScale)}unprojectAltitude(t){const e=t.x*t.x+t.y*t.y+t.z*t.z;return Math.sqrt(e)-h.EarthConstants.EQUATORIAL_RADIUS}projectBox(t,e=new i.Box3){var r,s;if((0,a.isBox3Like)(e))return m(t,e,this.unitScale);if((0,l.isOrientedBox3Like)(e)){if(t.longitudeSpan>=90){const r=m(t,new i.Box3,this.unitScale);return u.MathUtils.newVector3(1,0,0,e.xAxis),u.MathUtils.newVector3(0,1,0,e.yAxis),u.MathUtils.newVector3(0,0,1,e.zAxis),e.position.x=.5*(r.max.x+r.min.x),e.position.y=.5*(r.max.y+r.min.y),e.position.z=.5*(r.max.z+r.min.z),e.extents.x=.5*(r.max.x-r.min.x),e.extents.y=.5*(r.max.y-r.min.y),e.extents.z=.5*(r.max.z-r.min.z),e}const{south:o,west:a,north:l,east:h,center:c}=t,d=c.longitude,p=c.latitude,f=Math.cos((0,n.degToRad)(o)),y=Math.sin((0,n.degToRad)(o)),g=Math.cos((0,n.degToRad)(a)),x=Math.sin((0,n.degToRad)(a)),v=Math.cos((0,n.degToRad)(l)),b=Math.sin((0,n.degToRad)(l)),w=Math.cos((0,n.degToRad)(h)),_=Math.sin((0,n.degToRad)(h)),M=Math.cos((0,n.degToRad)(d)),E=Math.sin((0,n.degToRad)(d)),T=Math.cos((0,n.degToRad)(p)),S=Math.sin((0,n.degToRad)(p));let A,z,P;u.MathUtils.newVector3(M*T,E*T,S,e.zAxis),u.MathUtils.newVector3(-E,M,0,e.xAxis),u.MathUtils.newVector3(-M*S,-E*S,T,e.yAxis),o>=0?(A=Math.abs(f*(M*(x-_)+E*(w-g))),z=T*y-S*f,P=T*b-S*v*(M*w+E*_)):(l<=0?(A=Math.abs(v*(M*(x-_)+E*(w-g))),P=T*b-S*v):(A=Math.abs(M*(x-_)+E*(w-g)),P=T*b-S*v*(E*_+M*w)),z=T*y-S*f*(M*w+E*_));const L=.5*(this.unitScale+(null!==(r=t.maxAltitude)&&void 0!==r?r:0)),O=.5*(this.unitScale+(null!==(s=t.minAltitude)&&void 0!==s?s:0)),C=T*(M*w+E*_),k=Math.min(v*C+b*S,f*C+y*S);return u.MathUtils.newVector3(A*L,(P-z)*L,L-k*O,e.extents),u.MathUtils.newVector3(0,(z+P)*L,L+L,e.position),function(t,e,r,i){const n=t.x*i.x+e.x*i.y+r.x*i.z,s=t.y*i.x+e.y*i.y+r.y*i.z,o=t.z*i.x+e.z*i.y+r.z*i.z;i.x=n,i.y=s,i.z=o}(e.xAxis,e.yAxis,e.zAxis,e.position),e.position.x=e.position.x-e.zAxis.x*e.extents.z,e.position.y=e.position.y-e.zAxis.y*e.extents.z,e.position.z=e.position.z-e.zAxis.z*e.extents.z,e}throw new Error("Invalid bounding box")}unprojectBox(t){throw new Error("Method not implemented.")}getScaleFactor(t){return 1}groundDistance(t){return f(t)-this.unitScale}scalePointToSurface(t){const e=this.unitScale/(f(t)||1);
2return t.x*=e,t.y*=e,t.z*=e,t}surfaceNormal(t,e){void 0===e&&(e={x:0,y:0,z:0});const r=1/(f(t)||1);return e.x=t.x*r,e.y=t.y*r,e.z=t.z*r,e}reprojectPoint(t,e,r){if(t===c.mercatorProjection||t===c.webMercatorProjection){const{x:i,y:n,z:s}=e,o=this.unitScale,a=i/o-Math.PI,u=n/o-Math.PI,l=Math.exp(u),h=l*l,d=2*l/(h+1),p=(h-1)/(h+1),f=o+s;return void 0===r&&(r={}),r.x=Math.cos(a)*d*f,r.y=Math.sin(a)*d*f,r.z=p*f,t===c.webMercatorProjection&&(r.z=-r.z),r}return super.reprojectPoint(t,e,r)}localTangentSpace(t,e){let r;(0,o.isGeoCoordinatesLike)(t)?(this.projectPoint(t,e.position),r=t):(u.MathUtils.copyVector3(t,e.position),r=this.unprojectPoint(t));const i=(0,n.degToRad)(r.latitude),s=(0,n.degToRad)(r.longitude),a=Math.cos(s),l=Math.sin(s),h=Math.cos(i),c=Math.sin(i);return u.MathUtils.newVector3(a*h,l*h,c,e.zAxis),u.MathUtils.newVector3(-l,a,0,e.xAxis),u.MathUtils.newVector3(-a*c,-l*c,h,e.yAxis),e}}e.sphereProjection=new y(h.EarthConstants.EQUATORIAL_RADIUS)},7289:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.transverseMercatorProjection=e.TransverseMercatorUtils=void 0;const i=r(2754),n=r(3334),s=r(3068),o=r(4860),a=r(9264),u=r(7523),l=r(58),h=r(5610),c=r(5234);class d extends c.Projection{static clampGeoPoint(t,e){const r=t.latitude,i=t.longitude,n=p.POLE_RADIUS,s=p.POLE_RADIUS_SQ,a=Math.round(i/90),u=90*a-i;if(a%2==0||Math.abs(u)>n)return t;const l=r-0,h=u*u+l*l;if(h<s){const t=Math.sqrt(h),e=(n-t)/t,s=0===u&&0===l?1*n:u;return new o.GeoCoordinates(r+l*e,i+s*e)}return t}constructor(t){super(t),this.unitScale=t,this.type=c.ProjectionType.Planar,this.m_phi0=0,this.m_lambda0=0}getScaleFactor(t){return Math.cosh(2*(t.x/this.unitScale-.5)*Math.PI)}worldExtent(t,e,r){return r||(r=new i.Box3),r.min.x=0,r.min.y=0,r.min.z=t,r.max.x=this.unitScale,r.max.y=this.unitScale,r.max.z=e,r}projectPoint(t,e){var r;e||(e={x:0,y:0,z:0});const i=d.clampGeoPoint(t,this.unitScale),s=i.longitude/360+.5,o=1===s?0:Math.floor(s),a=(0,n.degToRad)(i.latitude),u=(0,n.degToRad)(i.longitude-360*o)-this.m_lambda0,l=Math.cos(a)*Math.sin(u);e.x=Math.atanh(l),e.y=Math.atan2(Math.tan(a),Math.cos(u))-this.m_phi0;const h=.5/Math.PI;return e.x=this.unitScale*((0,n.clamp)(e.x*h+.5,0,1)+o),e.y=this.unitScale*(0,n.clamp)(e.y*h+.5,0,1),e.z=null!==(r=t.altitude)&&void 0!==r?r:0,e}unprojectPoint(t){const e=2*Math.PI,r=t.x/this.unitScale,i=t.y/this.unitScale,n=1===r?0:Math.floor(r),s=e*(r-.5-n),a=e*(i-.5),u=t.z||0,l=a+this.m_phi0,h=Math.asin(Math.sin(l)/Math.cosh(s)),c=this.m_lambda0+Math.atan2(Math.sinh(s),Math.cos(l))+n*e;return o.GeoCoordinates.fromRadians(h,c,u)}projectBox(t,e){const{north:r,south:n,east:s,west:h}=t,c=[t.center,t.northEast,t.southWest,new o.GeoCoordinates(n,s),new o.GeoCoordinates(r,h)],d=p.POLE_EDGE_DEG,f=h<90&&s>90,m=h<0&&s>0,y=h<d&&s>-d&&r>0&&n<0;h<-90&&s>-90&&(c.push(new o.GeoCoordinates(r,-90)),c.push(new o.GeoCoordinates(n,-90))),f&&(c.push(new o.GeoCoordinates(r,90)),c.push(new o.GeoCoordinates(n,90))),m&&(c.push(new o.GeoCoordinates(r,0)),c.push(new o.GeoCoordinates(n,0))),y&&(c.push(new o.GeoCoordinates(0,h)),c.push(new o.GeoCoordinates(0,s))),p.alignLatitude(c,c[0]);const g=c.map((t=>this.projectPoint(t))),x=g.map((t=>t.x)),v=g.map((t=>t.y)),b=g.map((t=>t.z)),w=Math.min(...x),_=Math.min(...v),M=Math.min(...b),E=Math.max(...x),T=Math.max(...v),S=Math.max(...b);if(e||(e=new i.Box3),(0,a.isBox3Like)(e))e.min.x=w,e.min.y=_,e.min.z=M,e.max.x=E,e.max.y=T,e.max.z=S;else{if(!(0,l.isOrientedBox3Like)(e))throw new Error("invalid bounding box");u.MathUtils.newVector3(1,0,0,e.xAxis),u.MathUtils.newVector3(0,1,0,e.yAxis),u.MathUtils.newVector3(0,0,1,e.zAxis),e.position.x=(w+E)/2,e.position.y=(_+T)/2,e.position.z=(M+S)/2,e.extents.x=(E-w)/2,e.extents.y=(T-_)/2,e.extents.z=(S-M)/2}return e}unprojectBox(t){const e=this.unitScale,r=t.min,i=t.max,n=[{x:(r.x+i.x)/2,y:(r.y+i.y)/2,z:0},r,i,{x:r.x,y:i.y,z:0},{x:i.x,y:r.y,z:0}],a=.5*e,u=.25*e,l=.75*e,h=r.x<a&&i.x>a,c=r.y<a&&i.y>a,d=r.y<u&&i.y>u,f=r.y<l&&i.y>l;c&&(n.push({x:r.x,y:a,z:0}),n.push({x:i.x,y:a,z:0}),h&&n.push({x:a,y:a,z:0})),d&&(n.push({x:r.x,y:u,z:0}),n.push({x:i.x,y:u,z:0}),h&&n.push({x:a,y:u,z:0})),f&&(n.push({x:r.x,y:l,z:0}),n.push({x:i.x,y:l,z:0}),h&&n.push({x:a,y:l,z:0}));const m=n.map((t=>this.unprojectPoint(t)));p.alignLongitude(m,m[0]);const y=m.map((t=>t.latitude)),g=m.filter((t=>Math.abs(t.latitude)<90)).map((t=>t.longitude)),x=m.map((t=>{var e;return null!==(e=t.altitude)&&void 0!==e?e:0})),v=new o.GeoCoordinates(Math.min(...y),Math.min(...g),Math.min(...x)),b=new o.GeoCoordinates(Math.max(...y),Math.max(...g),Math.max(...x));return s.GeoBox.fromCoordinates(v,b)}unprojectAltitude(t){return t.z}groundDistance(t){return t.z}scalePointToSurface(t){return t.z=0,t}surfaceNormal(t,e){return void 0===e?e={x:0,y:0,z:-1}:(e.x=0,e.y=0,e.z=-1),e}}class p{static alignLatitude(t,e){for(const r of t)0===r.latitude&&(r.latitude=1e-9*e.latitude)}static alignLongitude(t,e){const r=e.longitude<0?180:-180,i=e.longitude<0?-180:180;for(const e of t)e.longitude===r&&(e.longitude=i)}}e.TransverseMercatorUtils=p,p.POLE_EDGE=1.4844222297453322,p.POLE_EDGE_DEG=(0,n.radToDeg)(p.POLE_
2EDGE),p.POLE_RADIUS=90-p.POLE_EDGE_DEG,p.POLE_RADIUS_SQ=Math.pow(p.POLE_RADIUS,2),e.transverseMercatorProjection=new d(h.EarthConstants.EQUATORIAL_CIRCUMFERENCE)},9861:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FlatTileBoundingBoxGenerator=void 0;const i=r(2754);e.FlatTileBoundingBoxGenerator=class{constructor(t,e=0,r=0){this.tilingScheme=t,this.minElevation=e,this.maxElevation=r,this.m_tilingScheme=t,this.m_worldBox=t.projection.worldExtent(e,r);const{min:i,max:n}=this.m_worldBox;this.m_worldDimensions={x:n.x-i.x,y:n.y-i.y,z:n.z-i.z}}get projection(){return this.m_tilingScheme.projection}get subdivisionScheme(){return this.m_tilingScheme.subdivisionScheme}getWorldBox(t,e){const r=t.level,n=this.subdivisionScheme.getLevelDimensionX(r),s=this.subdivisionScheme.getLevelDimensionY(r),o=this.m_worldDimensions.x/n,a=this.m_worldDimensions.y/s,u=this.m_worldBox.min.x+o*t.column,l=this.m_worldBox.min.y+a*t.row;return e||(e=new i.Box3),e.min.x=u,e.min.y=l,e.min.z=this.m_worldBox.min.z,e.max.x=u+o,e.max.y=l+a,e.max.z=this.m_worldBox.max.z,e}getGeoBox(t){const e=this.getWorldBox(t);return this.projection.unprojectBox(e)}}},435:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.halfQuadTreeSubdivisionScheme=void 0,e.halfQuadTreeSubdivisionScheme=new class{getSubdivisionX(){return 2}getSubdivisionY(t){return 0===t?1:2}getLevelDimensionX(t){return 1<<t}getLevelDimensionY(t){return 0!==t?1<<t-1:1}}},4490:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hereTilingScheme=void 0;const i=r(1515),n=r(435),s=r(6557);e.hereTilingScheme=new s.TilingScheme(n.halfQuadTreeSubdivisionScheme,i.normalizedEquirectangularProjection)},1635:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mercatorTilingScheme=void 0;const i=r(9885),n=r(9447),s=r(6557);e.mercatorTilingScheme=new s.TilingScheme(n.quadTreeSubdivisionScheme,i.mercatorProjection)},1871:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.polarTilingScheme=void 0;const i=r(7289),n=r(9447),s=r(6557);e.polarTilingScheme=new s.TilingScheme(n.quadTreeSubdivisionScheme,i.transverseMercatorProjection)},7171:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuadTree=void 0;const i=r(6541);e.QuadTree=class{constructor(t){this.tilingScheme=t}visit(t){this.visitTileKey(i.TileKey.fromRowColumnLevel(0,0,0),t)}visitTileKey(t,e){if(e(t,this.tilingScheme.getGeoBox(t)))for(const r of this.tilingScheme.getSubTileKeys(t))this.visitTileKey(r,e)}}},9447:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.quadTreeSubdivisionScheme=void 0,e.quadTreeSubdivisionScheme=new class{getSubdivisionX(){return 2}getSubdivisionY(){return 2}getLevelDimensionX(t){return 1<<t}getLevelDimensionY(t){return 1<<t}}},3424:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SubTiles=void 0;const i=r(6541);class n{constructor(t,e,r){this.tileKey=t,this.sizeX=e,this.sizeY=r}[Symbol.iterator](){return 2===this.sizeX&&2===this.sizeY?n.ZCurveIterator(this.tileKey):n.RowColumnIterator(this.tileKey,this.sizeX,this.sizeY)}}e.SubTiles=n,function(t){t.RowColumnIterator=function*(t,e,r){for(let n=0;n<r;n++)for(let s=0;s<e;s++)yield i.TileKey.fromRowColumnLevel(t.row*r+n,t.column*e+s,t.level+1)},t.ZCurveIterator=function*(t){for(let e=0;e<4;e++)yield i.TileKey.fromRowColumnLevel(t.row<<1|e>>1,t.column<<1|1&e,t.level+1)}}(n=e.SubTiles||(e.SubTiles={}))},4948:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6541:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TileKey=void 0;const r=[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,
20x8000000000000,4503599627370496];class i{static fromRowColumnLevel(t,e,r){return new i(t,e,r)}static fromQuadKey(t){const e=t.length;let r=0,n=0;for(let i=0;i<t.length;++i){const s=1<<i,o=parseInt(t.charAt(e-i-1),10);1&o&&(n|=s),2&o&&(r|=s)}return i.fromRowColumnLevel(r,n,e)}static fromMortonCode(t){let e=0,r=0,n=0,s=t;for(;s>1;){const t=1<<e;1&s&&(n|=t),2&s&&(r|=t),e++,s=(s-(3&s))/4}const o=i.fromRowColumnLevel(r,n,e);return o.m_mortonCode=t,o}static fromHereTile(t){const e=i.fromMortonCode(parseInt(t,10));return e.m_hereTile=t,e}static columnsAtLevel(t){return Math.pow(2,t)}static rowsAtLevel(t){return Math.pow(2,t)}static atCoords(t,e,r,n,s){return i.fromRowColumnLevel(Math.floor(r/(s/i.rowsAtLevel(t))),Math.floor(e/(n/i.columnsAtLevel(t))),t)}static parentMortonCode(t){return Math.floor(t/4)}constructor(t,e,r){this.row=t,this.column=e,this.level=r}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(t){const e=Math.max(0,this.level+t);let r=this.row,n=this.column;return t>=0?(r<<=t,n<<=t):(r>>>=-t,n>>>=-t),i.fromRowColumnLevel(r,n,e)}changedLevelTo(t){return this.changedLevelBy(t-this.level)}mortonCode(){if(void 0===this.m_mortonCode){let t=this.column,e=this.row,i=r[this.level<<1];for(let n=0;n<this.level;++n)1&t&&(i+=r[2*n]),1&e&&(i+=r[2*n+1]),t>>>=1,e>>>=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 t="";for(let e=this.level;e>0;--e){const r=1<<e-1,i=!!(this.column&r),n=!!(this.row&r);t+=i&&n?"3":n?"2":i?"1":"0"}return t}equals(t){return this.row===t.row&&this.column===t.column&&this.level===t.level}addedSubKey(t){const e=i.fromQuadKey(0===t.length?"-":t),r=this.changedLevelBy(e.level);return i.fromRowColumnLevel(r.row+e.row,r.column+e.column,r.level)}addedSubHereTile(t){const e=i.fromHereTile(t),r=this.changedLevelBy(e.level);return i.fromRowColumnLevel(r.row+e.row,r.column+e.column,r.level)}getSubHereTile(t){const e=1<<2*t;return(this.mortonCode()&e-1|e).toString()}rowCount(){return i.rowsAtLevel(this.level)}columnCount(){return i.columnsAtLevel(this.level)}}e.TileKey=i},7841:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TileKeyUtils=e.powerOfTwo=void 0;const i=r(4860),n=r(6541);e.powerOfTwo=(()=>{let t=.5;return new Array(53).fill(0).map((()=>t*=2))})(),function(t){function r(t,e,r){const i=t.projection,s=t.subdivisionScheme,o=s.getLevelDimensionX(r),a=s.getLevelDimensionY(r),{min:u,max:l}=i.worldExtent(0,0),h=l.x-u.x,c=l.y-u.y;if(e.x<u.x||e.x>l.x)return null;if(e.y<u.y||e.y>l.y)return null;const d=Math.min(o-1,Math.floor(o*(e.x-u.x)/h)),p=Math.min(a-1,Math.floor(a*(e.y-u.y)/c));return n.TileKey.fromRowColumnLevel(p,d,r)}function s(t,r,i=4){const n=function(t,r=4){let i=0;const n=e.powerOfTwo[r];for(t+=n/2;t<0;)t+=n;for(;t>=n;)t-=n;for(let n=0;n<r&&t>0;n++)1&t&&(i+=e.powerOfTwo[53-r+n]),t>>>=1;return i}(r,i);return t.mortonCode()+n}function o(t,r=4){let i=0,n=t,s=0;for(;s<r;s++){const t=e.powerOfTwo[52-s];n>=t&&(n-=t,i+=e.powerOfTwo[r-1-s])}return i-=e.powerOfTwo[r-1],{offset:i,mortonCode:n}}t.geoCoordinatesToTileKey=function(t,e,i){return r(t,t.projection.projectPoint(e),i)},t.worldCoordinatesToTileKey=r,t.geoRectangleToTileKeys=function(e,r,s){const o=(t,e,r)=>t<e?r-(e-t)%(r-e):e+(t-e)%(r-e),a=(t,e,r)=>Math.min(Math.max(t,e),r),u=o(r.southWest.longitudeInRadians,-Math.PI,Math.PI),l=a(r.southWest.latitudeInRadians,-.5*Math.PI,.5*Math.PI),h=o(r.northEast.longitudeInRadians,-Math.PI,Math.PI),c=a(r.northEast.latitudeInRadians,-.5*Math.PI,.5*Math.PI),d=t.geoCoordinatesToTileKey(e,i.GeoCoordinates.fromRadians(l,u),s),p=t.geoCoordinatesToTileKey(e,i.GeoCoordinates.fromRadians(c,h),s),f=e.subdivisionScheme.getLevelDimensionX(s);if(!d||!p)throw new Error("Invalid coordinates");const m=d.column;let y=p.column;u>h&&(y+=y!==m?f:f-1);const g=Math.min(d.row,p.row),x=Math.max(d.row,p.row),v=new Array;for(let t=g;t<=x;++t)for(let e=m;e<=y;++e)v.push(n.TileKey.fromRowColumnLevel(t,e%f,s));return v},t.getKeyForTileKeyAndOffset=s,t.extractOffsetAndMortonKeyFromKey=o,t.getParentKeyFromKey=function(t,e=4){const{offset:r,mortonCode:i}=o(t,e);return s(n.TileKey.fromMortonCode(n.TileKey.parentMortonCode(i)),r,e)}}(e.TileKeyUtils||(e.TileKeyUtils={}))},2801:(t,e,r)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.TileTreeTraverse=void 0;const i=r(3424);e.TileTreeTraverse=class{constructor(t){this.m_subdivisionScheme=t}subTiles(t){const e=this.m_subdivisionScheme.getSubdivisionX(t.level),r=this.m_subdivisionScheme.getSubdivisionY(t.level);return new i.SubTiles(t,e,r)}}},6557:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TilingScheme=void 0;const i=r(9861),n=r(7841),s=r(2801);e.TilingScheme=class{constructor(t,e){this.subdivisionScheme=t,this.projection=e,this.boundingBoxGenerator=new i.FlatTileBoundingBoxGenerator(this),this.tileTreeTraverse=new s.TileTreeTraverse(t)}getSubTileKeys(t){return this.tileTreeTraverse.subTiles(t)}getTileKey(t,e){return n.TileKeyUtils.geoCoordinatesToTileKey(this,t,e)}getTileKeys(t,e){return n.TileKeyUtils.geoRectangleToTileKeys(this,t,e)}getGeoBox(t){return this.boundingBoxGenerator.getGeoBox(t)}getWorldBox(t,e){return this.boundingBoxGenerator.getWorldBox(t,e)}}},2224:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.webMercatorTilingScheme=void 0;const i=r(9885),n=r(9447),s=r(6557);e.webMercatorTilingScheme=new s.TilingScheme(n.quadTreeSubdivisionScheme,i.webMercatorProjection)},4388:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LineGroup=e.createSimpleLineGeometry=e.createLineGeometry=e.LineGeometry=void 0;const i=r(9365),n=r(1405),s=r(9044),o=r(6280),a=r(6815),u=r(4342),l=new a.Vector3,h=new a.Vector3,c=new a.Vector3,d={attributes:[{name:"extrusionCoord",itemSize:3,offset:0},{name:"position",itemSize:3,offset:3},{name:"tangent",itemSize:3,offset:6},{name:"tangent2",itemSize:3,offset:9}],stride:12},p={attributes:[{name:"uv",itemSize:2,offset:d.stride},{name:"normal",itemSize:3,offset:d.stride+2}],stride:5},f={attributes:[...d.attributes,...p.attributes],stride:d.stride+p.stride},m={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},y={attributes:[...m.attributes,...p.attributes],stride:m.stride+p.stride};class g{constructor(){this.vertices=[],this.vertexColors=[],this.indices=[]}}function x(t,e){return e?t?y:m:t?f:d}function v(t,e,r,i,n,s,o=new g,a=!1){if(0===e.length)return o;const d=x(void 0!==n,a).stride,p=e.length,f=p/3,m=new Array(f),y=new Array(p-3),v=o.vertices.length/d,b=void 0!==i&&i.length>0,w=void 0!==n&&n.length>0,_=void 0!==s&&s.length&&p;(0,u.assert)(!b||i.length===f),(0,u.assert)(!w||n.length/2===f),(0,u.assert)(!_||s.length===p);let M=.1;m[0]=M;for(let t=0;t<f-1;++t){let r=0;for(let i=0;i<3;++i){const n=e[3*(t+1)+i]-e[3*t+i];y[3*t+i]=n,r+=n*n}M+=Math.sqrt(r),m[t+1]=M}const E=b?Math.abs(i[i.length-1]-i[0]):1,T=m[m.length-1]/E;if(b)for(let t=0;t<f;++t)m[t]=i[t]*T+.1;let S=!0;for(let t=0;t<3;++t)S=S&&e[t]===e[e.length-3+t];const A=(i,u,d,p,f)=>{const m=[],g=[];m.push(p,-1*f,T),g.push(p,1*f,T);for(let t=0;t<3;++t){if(a){const r=Math.fround(e[3*i+t]),n=e[3*i+t]-r;m.push(r,n),g.push(r,n)}else m.push(e[3*i+t]),g.push(e[3*i+t]);l.setComponent(t,e[3*i+t]),h.setComponent(t,y[u+t]),c.setComponent(t,y[d+t])}h.normalize(),c.normalize(),m.push(h.x,h.y,h.z),g.push(h.x,h.y,h.z),m.push(c.x,c.y,c.z),g.push(c.x,c.y,c.z),l.add(t),r.surfaceNormal(l,l),w&&(m.push(n[2*i],n[2*i+1]),g.push(n[2*i],n[2*i+1]),m.push(l.x,l.y,l.z),g.push(l.x,l.y,l.z)),o.vertices.push(...m,...g),_&&(o.vertexColors.push(s[3*i],s[3*i+1],s[3*i+2]),o.vertexColors.push(s[3*i],s[3*i+1],s[3*i+2]))};for(let t=0;t<f;++t){const e=S&&0===t?y.length-3:3*Math.max(0,t-1),r=S&&t===f-1?0:Math.min(3*t,y.length-3);t>0&&A(t,e,r,m[t-1],m[t]),t+1<f&&A(t,e,r,-1*m[Math.min(t,m.length-1)],m[Math.min(t+1,m.length-1)])}for(let t=0;t<f-1;++t){const e=v+4*t;o.indices.push(e,e+1,e+2,e+2,e+1,e+3)}return o}function b(t,e,r=new g){if(0===t.length)return r;const i=t.length/3;let n=r.vertices.length/3;const s=void 0!==e&&e.length&&t.length;for(let o=0;o<i;++o,n++){o>0&&r.indices.push(n),o<i-1&&r.indices.push(n);for(let i=0;i<3;++i)r.vertices.push(t[3*o+i]),s&&r.vertexColors.push(e[3*o+i])}return r}e.LineGeometry=g,e.createLineGeometry=v,e.createSimpleLineGeometry=b;class w{static createGeometry(t,e,r,n,a=!1,u=!1,l=!1){if(l)return n.setAttribute("position",new i.BufferAttribute(new Float32Array(t),3)),e.length===t.length&&n.setAttribute("color",new i.BufferAttribute(new Float32Array(e),3)),n.setIndex(new i.BufferAttribute(new Uint32Array(r),1)),n;{const l=x(a,u),h=new s.InterleavedBuffer(new Float32Array(t),l.stride);
2return l.attributes.forEach((t=>{const e=new o.InterleavedBufferAttribute(h,t.itemSize,t.offset,!1);n.setAttribute(t.name,e)})),e.length===t.length&&n.setAttribute("color",new i.BufferAttribute(new Float32Array(e),3)),n.setIndex(new i.BufferAttribute(new Uint32Array(r),1)),n}}constructor(t=!1,e=!1,r=!1){this.hasNormalsAndUvs=t,this.highPrecision=e,this.isSimple=r,this.m_geometry=new g}clear(){this.m_geometry.vertices=[],this.m_geometry.vertexColors=[],this.m_geometry.indices=[]}add(t,e,r,i,n,s){return this.isSimple?b(e,s,this.m_geometry):((0,u.assert)(!this.hasNormalsAndUvs||void 0!==n),v(t,e,r,i,n,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 x(this.hasNormalsAndUvs,this.highPrecision).attributes}get stride(){return x(this.hasNormalsAndUvs,this.highPrecision).stride}createGeometry(t){return void 0===t&&(t=new n.BufferGeometry),w.createGeometry(this.m_geometry.vertices,this.m_geometry.vertexColors,this.m_geometry.indices,t,this.hasNormalsAndUvs,this.highPrecision)}}e.LineGroup=w},3711:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.reconstructLineWidth=e.reconstructLine=e.triangulateLine=e.numCirclePoints=void 0;const i=r(5448),n=r(6815),s=new n.Vector3(0,0,1),o=[0,1,2,1,3,2],a=[0,1,3,3,1,2,0,3,4,5,4,3],u=Math.PI/8;function l(t,e,r,i,n,s){const o=n.length/3;n.push(t,e,0);for(let a=0;a<9;++a){const l=u*a+Math.PI/2+r;n.push(t+i*Math.cos(l),e+i*Math.sin(l),0),s.push(o,o+a+1,o+(a+1)%9+1)}}e.numCirclePoints=function(t){return 9},e.triangulateLine=function(t,e,r,u,h=!0,c=h){if(t.length<3)return;const d=new i.Vector2;if(h){const i=3!==t.length?d.set(t[3]-t[0],t[4]-t[1]).angle():0;l(t[0],t[1],i,e,r,u)}const p=r.length/3,f=new n.Vector3,m=new n.Vector3,y=new n.Vector3,g=new n.Vector3,x=new n.Vector3,v=new n.Vector3,b=new n.Vector3,w=new n.Vector3,_=new n.Vector3,M=t.length/3;let E=0;for(let i=0;i<M;++i){let n=!1;if(m.set(t[3*i],t[3*i+1],t[3*i+2]),i+1<M){if(y.set(t[3*(i+1)],t[3*(i+1)+1],t[3*(i+1)+2]),g.copy(y).sub(m).normalize().cross(s),x.copy(g),i>0&&(x.add(f).multiplyScalar(1-.5*g.dot(f)),n=f.angleTo(g)>Math.PI/2,n)){const t=e/Math.cos(g.angleTo(f)/2);v.copy(g).add(f).normalize().multiplyScalar(-t).add(m),b.copy(f).multiplyScalar(e).add(m),w.copy(g).add(f).normalize().multiplyScalar(t).add(m),_.copy(g).multiplyScalar(e).add(m)}n?r.push(v.x,v.y,v.z,b.x,b.y,b.z,w.x,w.y,w.z,_.x,_.y,_.z):(v.copy(x).multiplyScalar(-e).add(m),b.copy(x).multiplyScalar(e).add(m),r.push(v.x,v.y,v.z,b.x,b.y,b.z)),f.copy(g)}else v.copy(f).multiplyScalar(-e).add(m),b.copy(f).multiplyScalar(e).add(m),r.push(v.x,v.y,v.z,b.x,b.y,b.z);i!==M-1&&((n?a:o).forEach((t=>u.push(p+E+t))),E+=n?4:2)}if(c){const i=2!==t.length?d.set(t[3*(M-3)]-t[3*(M-2)],t[3*(M-3)+1]-t[3*(M-2)+1]).angle():Math.PI;l(t[3*(M-2)],t[3*(M-2)+1],i,e,r,u)}},e.reconstructLine=function(t,e){const r=new Float32Array(t.length/2);for(let i=3*e,n=2*i;i<r.length;i+=3,n+=6)r[i]=t[n]+.5*(t[n+3]-t[n]),r[i+1]=t[n+1]+.5*(t[n+3+1]-t[n+1]),r[i+2]=t[n+2]+.5*(t[n+3+2]-t[n+2]);return r},e.reconstructLineWidth=function(t,e){const r=t[2*e+3]-t[2*e],i=t[2*e+3+1]-t[2*e+1],n=t[2*e+3+2]-t[2*e+2];return.5*Math.sqrt(r*r+i*i+n*n)}},8263:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8759),e)},8759:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.Entry=void 0;const i=r(4342);class n{constructor(t,e,r,i,n){this.key=t,this.value=e,this.size=r,this.newer=i,this.older=n}}e.Entry=n,e.LRUCache=class{constructor(t,e=()=>1){this.m_size=0,this.m_map=new Map,this.m_newest=null,this.m_oldest=null,this.m_capacity=t,this.m_sizeFunction=e}forEach(t,e){let r=this.m_newest;for(;null!==r;){const i=r.older;t.call(e,r.value,r.key,this),r=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(t){this.m_capacity=t,this.evict()}setCapacityAndMeasure(t,e=()=>1){this.m_capacity=t,this.m_sizeFunction=e,this.shrinkToCapacity()}shrinkToCapacity(){let t=0;const e=this.m_sizeFunction;let r=this.m_newest;for(;null!==r;){const i=e(r.value);r.size=i,t+=i,r=r.older}this.m_size=t,this.evict()}set(t,e){const r=this.m_sizeFunction(e);let s=this.m_map.get(t);if(void 0!==s)this.m_size=this.m_size-s.size+r,s.value=e,s.size=r,this.promoteEntry(s),this.evict();else{if(r>this.m_capacity)return;if(s=new n(t,e,r,null,null),0===this.m_map.size)this.m_newest=this.m_oldest=s;else{(0,i.assert)(null!==this.m_newest);const t=this.m_newest;s.older=this.m_newest,t.newer=s,this.m_newest=s}this.m_map.set(t,s),this.m_size+=r,this.evict()}}get(t){const e=this.m_map.get(t);if(void 0!==e)return this.promoteEntry(e),e.value}has(t){return this.m_map.has(t)}clear(){this.m_newest=this.m_oldest=null,this.m_size=0,this.m_map.clear()}evictAll(){const t=this.evictionCallback;void 0!==t&&this.forEach(((e,r)=>t(r,e))),this.clear()}evictSelected(t,e){const r=this.evictionCallback;let i=this.m_newest;for(;null!==i;){const n=i.older;t.call(e,i.value,i.key)&&(void 0!==r&&r(i.key,i.value),this.deleteEntry(i),this.m_map.delete(i.key)),i=n}}delete(t){const e=this.m_map.get(t);return void 0!==e&&(this.deleteEntry(e),this.m_map.delete(t))}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 t=this.m_oldest;(0,i.assert)(null===t.older);let e=t;if(void 0!==this.canEvict)for(;!this.canEvict(e.key,e.value);){if(null===e.newer)return;e=e.newer}if(e===t)this.m_oldest=e.newer,null!==e.newer&&((0,i.assert)(e.newer.older===e),e.newer.older=null);else{if(null===e.newer)return;(0,i.assert)(e.newer.older===e),e.newer.older=e.older,null!==e.older&&(e.older.newer=e.newer)}const r=this.m_map.delete(e.key);return(0,i.assert)(!0===r),r&&void 0!==this.evictionCallback&&this.evictionCallback(e.key,e.value),this.m_size-=e.size,e}deleteEntry(t){t===this.m_newest?this.m_newest=t.older:t.newer?t.newer.older=t.older:(0,i.assert)(!1),t===this.m_oldest?this.m_oldest=t.newer:t.older?t.older.newer=t.newer:(0,i.assert)(!1),this.m_size-=t.size}promoteEntry(t){if(t===this.m_newest)return;t.newer&&((0,i.assert)(t.newer.older===t),t.newer.older=t.older),t.older&&((0,i.assert)(t.older.newer===t),t.older.newer=t.newer),t===this.m_oldest&&(this.m_oldest=t.newer),t.newer=null,t.older=this.m_newest,(0,i.assert)(null!==this.m_newest);const e=this.m_newest;(0,i.assert)(null===e.newer),e.newer=t,this.m_newest=t}}},2626:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};
2Object.defineProperty(e,"__esModule",{value:!0}),n(r(1153),e),n(r(6802),e),n(r(4773),e),n(r(2369),e),n(r(5199),e),n(r(1781),e)},1781:(t,e,r)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.GeoJsonTiler=void 0;const n=r(242),s=r(8152),o=null!==(i=n.default)&&void 0!==i?i:n,a=-(-2&-Math.ceil(204.8));e.GeoJsonTiler=class{constructor(){this.indexes=new Map}dispose(){}async connect(){return await Promise.resolve()}async registerIndex(t,e){if(!this.indexes.has(t))return await this.updateIndex(t,e)}async updateIndex(t,e){if(e instanceof URL){const t=await fetch(e.href);if(!t.ok)throw new Error(`GeoJsonTiler: Unable to fetch ${e.href}: ${t.statusText}`);e=await t.json()}const r=(0,s.isFeatureGeometry)(e)||"GeometryCollection"===e.type||"Feature"===e.type&&void 0===e.id||"FeatureCollection"===e.type&&e.features.length>0&&void 0===e.features[0].id,i=o(e,{maxZoom:20,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:a,lineMetrics:!1,promoteId:null,generateId:r,debug:0});i.geojson=e,this.indexes.set(t,i)}async getTile(t,e){const r=this.indexes.get(t);if(void 0===r)throw new Error("Tile not found");const i=r.getTile(e.level,e.column,e.row);return null!==i&&(i.layer=t),i||{}}}},1153:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ThemedTileDecoder=void 0;const i=r(7769),n=r(4342).LoggerManager.instance.create("ThemedTileDecoder");e.ThemedTileDecoder=class{constructor(){this.m_storageLevelOffset=0}dispose(){}decodeTile(t,e,r){return void 0===this.m_styleSetEvaluator?(n.info("cannot decode tile, as there is not style available"),Promise.resolve(void 0)):this.decodeThemedTile(t,e,this.m_styleSetEvaluator,r)}getTileInfo(t,e,r){return Promise.resolve(void 0)}configure(t,e){void 0!==(null==t?void 0:t.styleSet)&&(this.m_styleSetEvaluator=new i.StyleSetEvaluator(t)),this.m_styleSetEvaluator&&t&&"enabledFeatures"in t&&this.m_styleSetEvaluator.setEnabledFeatures(t.enabledFeatures),void 0!==(null==t?void 0:t.languages)&&(this.languages=t.languages),void 0!==e&&void 0!==e.storageLevelOffset&&(this.m_storageLevelOffset=e.storageLevelOffset)}}},6802:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TileDecoderService=void 0;const i=r(8152),n=r(2616),s=r(1984),o=r(4342),a=r(2369),u=o.LoggerManager.instance.create("TileDecoderService");class l extends a.WorkerService{static start(t,e){return new l(t,e)}constructor(t,e){super(t),this.serviceId=t,this.m_decoder=e,this.m_decoder.connect()}handleRequest(t){return i.WorkerDecoderProtocol.isDecodeTileRequest(t)?this.handleDecodeTileRequest(t):i.WorkerDecoderProtocol.isTileInfoRequest(t)?this.handleTileInfoRequest(t):super.handleRequest(t)}handleMessage(t){i.WorkerDecoderProtocol.isConfigurationMessage(t)?this.handleConfigurationMessage(t):u.error(`[${this.serviceId}]: invalid message ${t.type}`)}async handleDecodeTileRequest(t){const e=n.TileKey.fromMortonCode(t.tileKey),r=(0,i.getProjection)(t.projection),o=await this.m_decoder.decodeTile(t.data,e,r),a=[],u=t=>{void 0!==t&&t.buffer.byteLength>0&&!a.includes(t.buffer)&&a.push(t.buffer)};return null==o||o.geometries.forEach((t=>{var e,r,i;if(null===(e=t.vertexAttributes)||void 0===e||e.forEach((t=>u(t))),null===(r=t.interleavedVertexAttributes)||void 0===r||r.forEach((t=>u(t))),u(t.index),u(t.edgeIndex),Array.isArray(t.objInfos)&&1===t.objInfos.length&&"object"==typeof t.objInfos[0]&&(null===(i=t.objInfos[0])||void 0===i?void 0:i.hasOwnProperty("displacementMap"))){const e=t.objInfos[0];u(e.displacementMap)}Array.isArray(t.attachments)&&t.attachments.forEach((t=>{u(t.index),u(t.edgeIndex)}))})),null==o||o.techniques.forEach((t=>{(0,s.addBuffersToTransferList)(t,a)})),{response:o,transferList:a}}handleTileInfoRequest(t){const e=n.TileKey.fromMortonCode(t.tileKey),r=(0,i.getProjection)(t.projection);return this.m_decoder.getTileInfo(t.data,e,r).then((t=>({response:t,transferList:void 0!==t&&void 0!==t.transferList?t.transferList:[]})))}handleConfigurationMessage(t){this.m_decoder.configure(t,t.options)}}e.TileDecoderService=l},4773:(t,e,r)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.TilerService=void 0;const i=r(8152),n=r(2616),s=r(1781),o=r(2369);class a extends o.WorkerService{static start(t){return new a(t)}constructor(t){super(t),this.serviceId=t,this.tiler=new s.GeoJsonTiler}handleRequest(t){return i.WorkerTilerProtocol.isRegisterIndexRequest(t)?this.handleRegisterIndexRequest(t):i.WorkerTilerProtocol.isUpdateIndexRequest(t)?this.handleUpdateIndexRequest(t):i.WorkerTilerProtocol.isTileRequest(t)?this.handleTileRequest(t):super.handleRequest(t)}async handleTileRequest(t){const e=n.TileKey.fromMortonCode(t.tileKey);return{response:await this.tiler.getTile(t.index,e)||{}}}async handleRegisterIndexRequest(t){const e="string"==typeof t.input?new URL(t.input):t.input;return await this.tiler.registerIndex(t.id,e),{response:{}}}async handleUpdateIndexRequest(t){const e="string"==typeof t.input?new URL(t.input):t.input;return this.tiler.updateIndex(t.id,e),{response:{}}}}e.TilerService=a},2369:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerService=void 0;const i=r(8152),n=r(4342).LoggerManager.instance.create("WorkerService",{enabled:!0});e.WorkerService=class{constructor(t){this.serviceId=t,this.m_pendingRequests=new Map,this.onMessage=t=>{if("string"==typeof t.data.service&&t.data.service===this.serviceId)try{if(i.WorkerServiceProtocol.isRequestMessage(t.data)){const e=t.data,r={service:e.service,messageId:e.messageId,responseSent:!1};this.m_pendingRequests.set(e.messageId,r),this.tryHandleRequest(e.request).then((t=>{this.doSendResponse(r,{service:this.serviceId,type:i.WorkerServiceProtocol.ServiceMessageName.Response,messageId:e.messageId,response:t.response},t.transferList)})).catch((t=>{this.doSendResponse(r,{service:this.serviceId,type:i.WorkerServiceProtocol.ServiceMessageName.Response,messageId:e.messageId,errorMessage:t.toString(),errorStack:t.stack})}))}else this.tryHandleMessage(t.data)}catch(e){n.error(`[${this.serviceId}]: Unhandled exception when handling ${t.type}`)}},self.addEventListener("message",this.onMessage);const e={service:t,type:i.WorkerServiceProtocol.ServiceMessageName.Initialized};self.postMessage(e)}destroy(){this.cancelAllPendingRequests(),self.removeEventListener("message",this.onMessage)}handleMessage(t){n.error(`[${this.serviceId}]: Invalid message ${t.type}`)}handleRequest(t){throw new Error(`ServiceAdapter[${this.serviceId}]: Invalid request \'${t.type}\'`)}tryHandleMessage(t){try{this.handleMessage(t)}catch(e){n.error(`[${this.serviceId}]: Failed, handling message ${t.type}`)}}tryHandleRequest(t){try{return this.handleRequest(t)}catch(t){return n.error(`[${this.serviceId}]: Failure`,t),Promise.reject(t)}}doSendResponse(t,e,r){t.responseSent||(void 0!==r?self.postMessage(e,r):self.postMessage(e),t.responseSent=!0,this.m_pendingRequests.delete(t.messageId))}cancelAllPendingRequests(){this.m_pendingRequests.forEach((t=>{this.doSendResponse(t,{service:this.serviceId,type:i.WorkerServiceProtocol.ServiceMessageName.Response,messageId:t.messageId,errorMessage:"cancelled"})}))}}},5199:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerServiceManager=void 0;const i=r(8152),n=r(2369);class s extends n.WorkerService{static getInstance(){return void 0===this.m_service&&(this.m_service=new s(i.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID)),this.m_service}constructor(t=i.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID){super(t),this.m_factories=new Map,this.m_services=new Map}register(t){this.m_factories.set(t.serviceType,t.factory)}handleRequest(t){if(t.type===i.WorkerServiceProtocol.Requests.CreateService){if(void 0!==this.m_services.get(t.targetServiceId))throw Error(`error - service with targetServiceId=\'${t.targetServiceId}\' already running, ignoring CreateService request`);const e=this.m_factories.get(t.targetServiceType);if(void 0===e)throw Error(`unknown targetServiceType requested: \'${t.targetServiceType}\'`);const r=e(t.targetServiceId);this.m_services.set(t.targetServiceId,r)}if(t.type===i.WorkerServiceProtocol.Requests.DestroyService){const e=this.m_services.get(t.targetServiceId);if(void 0===e)throw Error(`unknown targetServiceId \'${t.targetServiceId}\'`);e.destroy(),this.m_services.delete(t.targetServiceId)}return Promise.resolve({response:{}})}}e.WorkerServiceManager=s},5033:(t,e)=>{"use strict";var r;
2Object.defineProperty(e,"__esModule",{value:!0}),e.ExtrusionFeatureDefs=void 0,(r=e.ExtrusionFeatureDefs||(e.ExtrusionFeatureDefs={})).DEFAULT_RATIO_MIN=0,r.DEFAULT_RATIO_MAX=1,r.MIN_BUILDING_HEIGHT=.1},1509:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.OmvTilerService=e.OmvTileDecoder=e.OmvTileDecoderService=e.OmvDecoder=void 0,n(r(952),e);var s=r(952);Object.defineProperty(e,"OmvDecoder",{enumerable:!0,get:function(){return s.VectorTileDataProcessor}}),Object.defineProperty(e,"OmvTileDecoderService",{enumerable:!0,get:function(){return s.VectorTileDecoderService}}),Object.defineProperty(e,"OmvTileDecoder",{enumerable:!0,get:function(){return s.VectorTileDecoder}}),Object.defineProperty(e,"OmvTilerService",{enumerable:!0,get:function(){return s.GeoJsonTilerService}})},1984:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(7259),e),n(r(8284),e),n(r(1017),e),n(r(1370),e),n(r(1216),e),n(r(5771),e),n(r(8131),e),n(r(6304),e),n(r(8023),e)},1667:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ColorUtils=void 0;const i=r(3096),n=r(3334),s=r(8263),o=r(797),a=r(7610),u=255,l=new i.Color,h={h:0,s:0,l:0};!function(t){function e(t,e){return(0,n.clamp)(t+(e<0?t:1-t)*e,0,1)}function r(t,e,r){let i;if(a.RGBA.isRGBA(e))i=t.equals(e)===r;else if("string"==typeof e){const n=c.get(e);if(n)i=t.equals(n)===r;else{const n=a.RGBA.parse(e);void 0!==n&&(c.set(e,n),i=t.equals(n)===r)}}return i}t.getHexFromRgba=function(t,e,r,i){return(0,o.assert)(i>=0&&i<=1),u-Math.floor(i*u)<<24^t*u<<16^e*u<<8^r*u},t.getHexFromRgb=function(t,e,r){return(0,o.assert)(t>=0&&t<=1),(0,o.assert)(e>=0&&e<=1),(0,o.assert)(r>=0&&r<=1),t*u<<16^e*u<<8^r*u},t.getHexFromHsl=function(t,e,r){return(0,o.assert)(t>=0&&t<=1),(0,o.assert)(e>=0&&e<=1),(0,o.assert)(r>=0&&r<=1),l.setHSL(t,e,r).getHex()},t.darken=function(t,e){return l.setRGB(t.r,t.g,t.b),l.getHSL(h),h.l=(0,n.clamp)(h.l-e,0,1),l.setHSL(h.h,h.s,h.l),t.r=l.r,t.g=l.g,t.b=l.b,t},t.scaleColor=function(t,r){return l.setRGB(t.r,t.g,t.b),l.getHSL(h),h.s=e(h.s,r.s),h.l=e(h.l,r.l),l.setHSL(h.h,h.s,h.l),t.r=l.r,t.g=l.g,t.b=l.b,t.a=e(t.a,r.a),t},t.getRgbaFromHex=function(t,e=new a.RGBA){return(0,o.assert)(!0,"Wrong hex format"),e.r=(t>>16&u)/u,e.g=(t>>8&u)/u,e.b=(t&u)/u,e.a=(u-(t>>24&u))/u,e},t.hasAlphaInHex=function(t){return(0,o.assert)(!0,"Wrong hex format"),!!(t>>24)},t.getAlphaFromHex=function(t){return(0,o.assert)(!0,"Wrong hex format"),(u-(t>>24)&u)/u},t.removeAlphaFromHex=function(t){return(0,o.assert)(!0,"Wrong hex format"),16777215&t},t.comparePotentiallyRGBA=function(t,e,i){let n;return a.RGBA.isRGBA(t)?n=r(t,e,i):a.RGBA.isRGBA(e)&&(n=r(e,t,i)),n}}(e.ColorUtils||(e.ColorUtils={}));const c=new s.LRUCache(500)},7259:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MapEnv=e.Env=void 0;class r{static isEnv(t){return t instanceof r}lookup(t){}unmap(){return{}}}e.Env=r,e.MapEnv=class extends r{constructor(t,e){super(),this.entries=t,this.parent=e}lookup(t){if(this.entries.hasOwnProperty(t)){const e=this.entries[t];
2if(void 0!==e)return e}return this.parent?this.parent.lookup(t):void 0}unmap(){const t=this.parent?this.parent.unmap():{};for(const e in this.entries)this.entries.hasOwnProperty(e)&&(t[e]=this.entries[e]);return t}}},8284:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.evaluateJsonExpr=void 0;const i=r(7259),n=r(8023);e.evaluateJsonExpr=function(t,e,r){return n.Expr.fromJSON(t,r).evaluate(new i.MapEnv(e),n.ExprScope.Value)}},8023:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.InterpolateExpr=e.StepExpr=e.CaseExpr=e.MatchExpr=e.LookupExpr=e.CallExpr=e.HasAttributeExpr=e.ObjectLiteralExpr=e.StringLiteralExpr=e.NumberLiteralExpr=e.BooleanLiteralExpr=e.NullLiteralExpr=e.LiteralExpr=e.VarExpr=e.Expr=e.ExprScope=e.ExprDependencies=void 0;const s=r(5448),o=r(6815),a=r(6577),u=r(2302),l=r(908),h=r(8628),c=r(1017),d=r(1324),p=r(7610),f=r(5771);n(r(7259),e);const m=new u.ExprEvaluator,y=new l.ExprInstantiator;class g{constructor(){this.properties=new Set}}e.ExprDependencies=g;class x{static of(t){const e=new g;return t.accept(this.instance,e),e}visitNullLiteralExpr(t,e){}visitBooleanLiteralExpr(t,e){}visitNumberLiteralExpr(t,e){}visitStringLiteralExpr(t,e){}visitObjectLiteralExpr(t,e){}visitVarExpr(t,e){e.properties.add(t.name)}visitHasAttributeExpr(t,e){e.properties.add(t.name)}visitCallExpr(t,e){switch(t.args.forEach((t=>t.accept(this,e))),t.op){case"dynamic-properties":e.volatile=!0;break;case"feature-state":e.featureState=!0,e.properties.add("$state"),e.properties.add("$id");break;case"id":e.properties.add("$id");break;case"zoom":case"world-ppi-scale":case"world-discrete-ppi-scale":e.properties.add("$zoom");break;case"pixel-world-scale":e.properties.add("$pixelToMeters");break;case"geometry-type":e.properties.add("$geometryType")}}visitLookupExpr(t,e){return this.visitCallExpr(t,e)}visitMatchExpr(t,e){t.value.accept(this,e),t.branches.forEach((([t,r])=>r.accept(this,e))),t.fallback.accept(this,e)}visitCaseExpr(t,e){t.branches.forEach((([t,r])=>{t.accept(this,e),r.accept(this,e)})),t.fallback.accept(this,e)}visitStepExpr(t,e){t.input.accept(this,e),t.defaultValue.accept(this,e),t.stops.forEach((([t,r])=>r.accept(this,e)))}visitInterpolateExpr(t,e){t.input.accept(this,e),t.stops.forEach((([t,r])=>r.accept(this,e)))}}var v;x.instance=new x,function(t){t[t.Value=0]="Value",t[t.Condition=1]="Condition",t[t.Dynamic=2]="Dynamic"}(v=e.ExprScope||(e.ExprScope={}));class b{static isExpr(t){return t instanceof b}static fromJSON(t,e,r,i){return I(t,void 0!==e?{definitions:e,lockedNames:new Set,cache:null!=r?r:new Map,referencedDefinitions:null!=i?i:new Set}:void 0)}evaluate(t,e=v.Value,r){return this.accept(m,new u.ExprEvaluatorContext(m,t,e,r))}instantiate(t){return this.accept(y,t)}dependencies(){return this.m_dependencies||(this.m_dependencies=x.of(this)),this.m_dependencies}intern(t){return t.add(this)}toJSON(){return(new V).serialize(this)}isDynamic(){return void 0===this.m_isDynamic&&(this.m_isDynamic=this.exprIsDynamic()),this.m_isDynamic}getPoolKey(t=!1){return"E"}}e.Expr=b;class w extends b{constructor(t){super(),this.name=t}accept(t,e){return t.visitVarExpr(this,e)}exprIsDynamic(){return!1}getPoolKey(){return this.name}}e.VarExpr=w;class _ extends b{static fromValue(t,e){switch(typeof t){case"boolean":return new E(t);case"number":return new T(t);case"string":return new S(t);case"object":return null===t?M.instance:new A(t,e);default:throw new Error(`failed to create a literal from \'${t}\'`)}}exprIsDynamic(){return!1}}e.LiteralExpr=_;class M extends _{constructor(){super(),this.value=null}accept(t,e){return t.visitNullLiteralExpr(this,e)}exprIsDynamic(){return!1}getPoolKey(){return"N"}}e.NullLiteralExpr=M,M.instance=new M;class E extends _{constructor(t){super(),this.value=t}accept(t,e){return t.visitBooleanLiteralExpr(this,e)}getPoolKey(){return"B"}}e.BooleanLiteralExpr=E,E.trueInstance=new E(!0),E.falseInstance=new E(!1);class T extends _{constructor(t){super(),this.value=t}accept(t,e){return t.visitNumberLiteralExpr(this,e)}getPoolKey(){return this.value}}e.NumberLiteralExpr=T;class S extends _{constructor(t){super(),this.value=t}get promotedValue(){var t,e,r;return void 0===this.m_promotedValue&&(this.m_promotedValue=null!==(e=null!==(t=p.RGBA.parse(this.value))&&void 0!==t?t:d.Pixels.parse(this.value))&&void 0!==e?e:null),null!==(r=this.m_promotedValue)&&void 0!==r?r:void 0}accept(t,e){return t.visitStringLiteralExpr(this,e)}getPoolKey(){return this.value.length}}e.StringLiteralExpr=S;class A extends _{constructor(t,e){super(),this.value=t,this.id=e}get isArrayLiteral(){return Array.isArray(this.value)}accept(t,e){return t.visitObjectLiteralExpr(this,e)}static get nextID(){return this.m_nextID++}}e.ObjectLiteralExpr=A,A.m_nextID=0;class z extends b{constructor(t){super(),this.name=t}accept(t,e){return t.visitHasAttributeExpr(this,e)}exprIsDynamic(){return!1}getPoolKey(){return this.name}}e.HasAttributeExpr=z;class P extends b{constructor(t,e){super(),this.op=t,this.args=e}get children(){return this.args}accept(t,e){return t.visitCallExpr(this,e)}exprIsDynamic(){var t,e;const r=null!==(t=this.descriptor)&&void 0!==t?t:u.ExprEvaluator.getOperator(this.op);return!!(null===(e=null==r?void 0:r.isDynamicOperator)||void 0===e?void 0:e.call(r,this))||this.args.some((t=>t.isDynamic()))}getPoolKey(t=!1){return t?this.args[0].getPoolKey():this.op}}e.CallExpr=P;class L extends P{static parseArray(t,e){const r=t[1];if(void 0===r)throw new Error("missing lookup table in \'lookup\' expression");const i=I(r,e);if(!(Array.isArray(r)&&i instanceof A))throw new Error("Invalid lookup table expression for operator \'lookup\'. It must be a literal or a ref to one.");const n=i.value;if(!(Array.isArray(n)||n instanceof Map))throw new Error(`Invalid lookup table type (${typeof n}) for operator \'lookup\'`);const s=t.slice(2).map((t=>I(t,e)));return s.unshift(i),new L(s)}constructor(t){super("lookup",t),this.args=t}accept(t,e){return t.visitLookupExpr(this,e)}}e.LookupExpr=L;class O extends b{static isValidMatchLabel(t){switch(typeof t){case"number":case"string":return!0;case"object":if(!Array.isArray(t)||0===t.length)return!1;const e=typeof t[0];return("number"===e||"string"===e)&&t.every((t=>typeof t===e));default:return!1}}constructor(t,e,r){super(),this.value=t,this.branches=e,this.fallback=r}accept(t,e){return t.visitMatchExpr(this,e)}exprIsDynamic(){return this.value.isDynamic()||this.branches.some((([t,e])=>e.isDynamic()))||this.fallback.isDynamic()}getPoolKey(){return this.fallback.getPoolKey()}}e.MatchExpr=O;class C extends b{constructor(t,e){super(),this.branches=t,this.fallback=e}accept(t,e){return t.visitCaseExpr(this,e)}exprIsDynamic(){return this.branches.some((([t,e])=>t.isDynamic()||e.isDynamic()))||this.fallback.isDynamic()}getPoolKey(t=!1){return t?this.fallback.getPoolKey():this.branches.length}}e.CaseExpr=C;class k extends b{constructor(t,e,r){super(),this.input=t,this.defaultValue=e,this.stops=r}accept(t,e){return t.visitStepExpr(this,e)}exprIsDynamic(){return this.input.isDynamic()||this.defaultValue.isDynamic()||this.stops.some((([t,e])=>e.isDynamic()))}getPoolKey(t=!1){return t?this.defaultValue.getPoolKey():this.stops.length}}e.StepExpr=k;class j extends b{constructor(t,e,r){super(),this.mode=t,this.input=e,this.stops=r}accept(t,e){return t.visitInterpolateExpr(this,e)}exprIsDynamic(){return this.input.isDynamic()||this.stops.some((([t,e])=>e.isDynamic()))}getPoolKey(t=!1){return t?this.stops[0][0]:this.stops.length}}e.InterpolateExpr=j;class V{serialize(t){return t.accept(this,void 0)}visitNullLiteralExpr(t,e){return null}visitBooleanLiteralExpr(t,e){return t.value}visitNumberLiteralExpr(t,e){return t.value}visitStringLiteralExpr(t,e){return t.value}visitObjectLiteralExpr(t,e){if(t.value instanceof s.Vector2)return["make-vector",t.value.x,t.value.y];if(t.value instanceof o.Vector3)return["make-vector",t.value.x,t.value.y,t.value.z];if(t.value instanceof a.Vector4)return["make-vector",t.value.x,t.value.y,t.value.z,t.value.w];const r=["literal",t.value];return void 0!==t.id&&(r[2]=t.id),r}visitVarExpr(t,e){return["get",t.name]}visitHasAttributeExpr(t,e){return["has",t.name]}visitCallExpr(t,e){return[t.op,...t.args.map((t=>this.serialize(t)))]}visitLookupExpr(t,e){return this.visitCallExpr(t,e)}visitMatchExpr(t,e){const r=[];for(const[e,i]of t.branches)r.push(e,this.serialize(i));return["match",this.serialize(t.value),...r,this.serialize(t.fallback)]}visitCaseExpr(t,e){const r=[];for(const[e,i]of t.branches)r.push(this.serialize(e),this.serialize(i));return["case",...r,this.serialize(t.fallback)]}visitStepExpr(t,e){const r=["step"];return r.push(this.serialize(t.input)),r.push(this.serialize(t.defaultValue)),t.stops.forEach((([t,e])=>{r.push(t),r.push(this.serialize(e))})),r}visitInterpolateExpr(t,e){const r=["interpolate",t.mode];return r.push(this.serialize(t.input)),t.stops.forEach((([t,e])=>{r.push(t),r.push(this.serialize(e))})),r}}function I(t,e){if(Array.isArray(t))return R(t,e);if(null===t)return M.instance;switch(typeof t){case"number":return new T(t);case"string":return new S(t);case"boolean":return new E(t);default:if(p.RGBA.isRGBA(t))return new A(t);throw new Error(`failed to create expression from: ${JSON.stringify(t)}`)}}function R(t,e){const r=t[0];if("string"!=typeof r)throw new Error("expected a builtin function name");switch(r){case"!has":case"!in":return new P("!",[R([r.slice(1),...t.slice(1)])]);case"ref":return function(t,e){if("string"!=typeof t[1])throw new Error("expected the name of an attribute");
2if(void 0===e)throw new Error("ref used with no definitions");const r=t[1];if(e.lockedNames.has(r))throw new Error(`circular reference to \'${r}\'`);if(!(r in e.definitions))throw new Error(`definition \'${r}\' not found`);e.referencedDefinitions.add(r);const i=e.cache.get(r);if(void 0!==i)return i;let n,s=e.definitions[r];const o=(0,f.getDefinitionValue)(s);if((0,h.isInterpolatedPropertyDefinition)(o))return b.fromJSON((0,h.interpolatedPropertyDefinitionToJsonExpr)(s));if(!(0,c.isJsonExpr)(o))return b.fromJSON(o);if(s=o,!(0,c.isJsonExpr)(s))throw new Error(`unsupported definition ${r}`);e.lockedNames.add(r);try{n=I(s,e)}finally{e.lockedNames.delete(r)}return e.cache.set(r,n),n.isCached=!0,n}(t,e);case"get":return function(t,e){if(void 0!==t[2])return B("get",t,e);const r=t[1];if("string"!=typeof r)throw new Error("expected the name of an attribute");return new w(r)}(t,e);case"has":return function(t,e){if(void 0!==t[2])return B("has",t,e);const r=t[1];if("string"!=typeof r)throw new Error("expected the name of an attribute");return new z(r)}(t,e);case"literal":return function(t){const e=t[1];if(null===e||"object"!=typeof e)throw new Error("expected an object or array literal");const r=t[2];return new A(e,r)}(t);case"match":return function(t,e){if(t.length<4)throw new Error("not enough arguments");if(!(t.length%2))throw new Error("fallback is missing in \'match\' expression");const r=I(t[1],e),i=[];for(let r=2;r<t.length-1;r+=2){const n=t[r];if(!O.isValidMatchLabel(n))throw new Error(`\'${JSON.stringify(n)}\' is not a valid label for \'match\'`);const s=I(t[r+1],e);i.push([n,s])}const n=I(t[t.length-1],e);return new O(r,i,n)}(t,e);case"case":return function(t,e){if(t.length<3)throw new Error("not enough arguments");if(t.length%2)throw new Error("fallback is missing in \'case\' expression");const r=[];for(let i=1;i<t.length-1;i+=2){const n=I(t[i],e),s=I(t[i+1],e);r.push([n,s])}const i=I(t[t.length-1],e);return new C(r,i)}(t,e);case"interpolate":return function(t,e){const r=t[1];if(!function(t){if(!Array.isArray(t))return!1;switch(t[0]){case"discrete":case"linear":case"cubic":case"exponential":return!0;default:return!1}}(r))throw new Error("expected an interpolation type");if("exponential"===r[0]&&"number"!=typeof r[1])throw new Error("expected the base of the exponential interpolation");const i=void 0!==t[2]?I(t[2],e):void 0;if(!b.isExpr(i))throw new Error("expected the input of the interpolation");if(3===t.length||!(t.length%2))throw new Error("invalid number of samples");const n=[];for(let r=3;r<t.length-1;r+=2){const i=t[r],s=I(t[r+1],e);n.push([i,s])}return new j(r,i,n)}(t,e);case"step":return function(t,e){if(t.length<2)throw new Error("expected the input of the \'step\' operator");if(t.length<3||!(t.length%2))throw new Error("not enough arguments");const r=I(t[1],e),i=I(t[2],e),n=[];for(let r=3;r<t.length;r+=2){const i=t[r],s=I(t[r+1],e);n.push([i,s])}return new k(r,i,n)}(t,e);case"lookup":return L.parseArray(t,e);default:return B(r,t,e)}}function B(t,e,r){return new P(t,e.slice(1).map((t=>I(t,r))))}},2302:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExprEvaluator=e.ExprEvaluatorContext=void 0;const i=r(3096),n=r(3334),s=r(5448),o=r(6815),a=r(6577),u=r(8023),l=r(6073),h=r(7290),c=r(4672),d=r(8998),p=r(1954),f=r(2181),m=r(202),y=r(4054),g=r(9764),x=r(7029),v=r(3501),b=r(5113),w=r(545),_=r(1324),M=r(7610),E=new Map;function T(t,e){var r,i,n;if(e instanceof u.StringLiteralExpr)return null!==(r=e.promotedValue)&&void 0!==r?r:e.value;const s=t.evaluate(e);return"string"==typeof s&&null!==(n=null!==(i=M.RGBA.parse(s))&&void 0!==i?i:_.Pixels.parse(s))&&void 0!==n?n:s}e.ExprEvaluatorContext=class{constructor(t,e,r,i){this.evaluator=t,this.env=e,this.scope=r,this.cache=i}evaluate(t){var e,r;if(void 0===t)throw new Error("Failed to evaluate expression");const i=null===(e=this.cache)||void 0===e?void 0:e.get(t);if(void 0!==i)return i;const n=t.accept(this.evaluator,this);return null===(r=this.cache)||void 0===r||r.set(t,n),n}wrapValue(t,e){return u.Expr.isExpr(t)?t:u.LiteralExpr.fromValue(t,e)}};class S{static defineOperator(t,e){E.set(t,e)}static defineOperators(t){Object.getOwnPropertyNames(t).forEach((e=>{this.defineOperator(e,t[e])}))}static getOperator(t){return E.get(t)}visitVarExpr(t,e){const r=e.env.lookup(t.name);return void 0!==r?r:null}visitNullLiteralExpr(t,e){return null}visitBooleanLiteralExpr(t,e){return t.value}visitNumberLiteralExpr(t,e){return t.value}visitStringLiteralExpr(t,e){return t.value}visitObjectLiteralExpr(t,e){return t.value}visitHasAttributeExpr(t,e){return void 0!==e.env.lookup(t.name)}visitMatchExpr(t,e){const r=e.evaluate(t.value);for(const[i,n]of t.branches){if(Array.isArray(i)&&i.includes(r))return e.evaluate(n);if(i===r)return e.evaluate(n)}return e.evaluate(t.fallback)}visitCaseExpr(t,e){if(e.scope===u.ExprScope.Value){const r=t.branches.findIndex((([t,e])=>t.isDynamic()));if(-1!==r){let i;for(let n=0;n<t.branches.length;++n){const[s,o]=t.branches[n],a=e.evaluate(s),l=e.evaluate(o);if(n<r&&Boolean(a))return l;if((u.Expr.isExpr(a)||Boolean(a))&&(void 0===i&&(i=[]),null==i||i.push([e.wrapValue(a),e.wrapValue(l)]),!u.Expr.isExpr(a)&&Boolean(a)))return new u.CaseExpr(i,u.LiteralExpr.fromValue(null))}const n=e.evaluate(t.fallback);return void 0===i?n:new u.CaseExpr(i,e.wrapValue(n))}}for(const[r,i]of t.branches)if(e.evaluate(r))return e.evaluate(i);return e.evaluate(t.fallback)}visitCallExpr(t,e){var r;const i=null!==(r=t.descriptor)&&void 0!==r?r:E.get(t.op);if(i){let r;if(t.descriptor=i,e.scope===u.ExprScope.Value&&t.isDynamic()){if(t.descriptor.partialEvaluate)return t.descriptor.partialEvaluate(e,t);const i=t.args.map((t=>e.wrapValue(e.evaluate(t),t.id)));if(i.every(((e,r)=>e===t.args[r])))return t;r=new u.CallExpr(t.op,i)}else r=i.call(e,t);return r}throw new Error(`undefined operator \'${t.op}\'`)}visitLookupExpr(t,e){return this.visitCallExpr(t,e)}visitStepExpr(t,e){if(e.scope===u.ExprScope.Value){const r=e.evaluate(t.input),i=e.evaluate(t.defaultValue);return new u.StepExpr(e.wrapValue(r),e.wrapValue(i),t.stops.map((([t,r])=>{const i=e.evaluate(r);return[t,e.wrapValue(i)]})))}{const r=e.evaluate(t.input);if("number"!=typeof r)throw new Error(`input \'${r}\' must be a number`);if(r<t.stops[0][0])return e.evaluate(t.defaultValue);let i=t.stops.findIndex((t=>t[0]>r));return-1===i&&(i=t.stops.length),e.evaluate(t.stops[i-1][1])}}visitInterpolateExpr(t,e){if(e.scope===u.ExprScope.Value){const r=e.evaluate(t.input);return new u.InterpolateExpr(t.mode,e.wrapValue(r),t.stops.map((([t,r])=>{const i=e.evaluate(r);return[t,e.wrapValue(i)]})))}{const r=e.evaluate(t.input);if("number"!=typeof r)throw new Error("input must be a number");if("cubic"===t.mode[0])return function(t,e,r){if(r<e.stops[0][0])return T(t,e.stops[0][1]);if(r>=e.stops[e.stops.length-1][0])return T(t,e.stops[e.stops.length-1][1]);const u=e.stops.findIndex((t=>t[0]>r)),l=Math.max(0,u-1),h=0===l?u:l-1,c=u<e.stops.length-1?u+1:u-1,d=e.stops[h][
20],p=e.stops[l][0],f=e.stops[u][0],m=.5*(f-p),y=m/(p-d),g=m/(e.stops[c][0]-f),x=(r-p)/(f-p),v=x*x,b=v*x,w=-y*b+2*y*v-y*x,E=(1+y)*b+(-1.5-2*y)*v+(-.5+y)*x+1,S=(-1-g)*b+(1.5+g)*v+.5*x,A=g*b-g*v,z=T(t,e.stops[h][1]),P=T(t,e.stops[l][1]),L=T(t,e.stops[u][1]),O=T(t,e.stops[c][1]);if("number"==typeof z&&"number"==typeof P&&"number"==typeof L&&"number"==typeof O)return w*z+E*P+S*L+A*O;if(z instanceof M.RGBA&&P instanceof M.RGBA&&L instanceof M.RGBA&&O instanceof M.RGBA)return new M.RGBA((0,n.clamp)(w*z.r+E*P.r+S*L.r+A*O.r,0,1),(0,n.clamp)(w*z.g+E*P.g+S*L.g+A*O.g,0,1),(0,n.clamp)(w*z.b+E*P.b+S*L.b+A*O.b,0,1),(0,n.clamp)(w*z.a+E*P.a+S*L.a+A*O.a,0,1));if(z instanceof _.Pixels&&P instanceof _.Pixels&&L instanceof _.Pixels&&O instanceof _.Pixels)return new _.Pixels(w*z.value+E*P.value+S*L.value+A*O.value);if(z instanceof i.Color&&P instanceof i.Color&&L instanceof i.Color&&O instanceof i.Color)return new i.Color(w*z.r+E*P.r+S*L.r+A*O.r,w*z.g+E*P.g+S*L.g+A*O.g,w*z.b+E*P.b+S*L.b+A*O.b);if(z instanceof s.Vector2&&P instanceof s.Vector2&&L instanceof s.Vector2&&O instanceof s.Vector2)return new s.Vector2(w*z.x+E*P.x+S*L.x+A*O.x,w*z.y+E*P.y+S*L.y+A*O.y);if(z instanceof o.Vector3&&P instanceof o.Vector3&&L instanceof o.Vector3&&O instanceof o.Vector3)return new o.Vector3(w*z.x+E*P.x+S*L.x+A*O.x,w*z.y+E*P.y+S*L.y+A*O.y,w*z.z+E*P.z+S*L.z+A*O.z);if(z instanceof a.Vector4&&P instanceof a.Vector4&&L instanceof a.Vector4&&O instanceof a.Vector4)return new a.Vector4(w*z.x+E*P.x+S*L.x+A*O.x,w*z.y+E*P.y+S*L.y+A*O.y,w*z.z+E*P.z+S*L.z+A*O.z,w*z.w+E*P.w+S*L.w+A*O.w);if(Array.isArray(z)&&Array.isArray(P)&&Array.isArray(L)&&Array.isArray(O)){const t=z.length,e=[];for(let r=0;r<t;++r)e[r]=w*z[r]+E*P[r]+S*L[r]+A*O[r];return e}throw new Error("failed to interpolate values")}(e,t,r);const u=t.stops.findIndex((t=>t[0]>r));if(-1===u)return e.evaluate(t.stops[t.stops.length-1][1]);if(0===u)return e.evaluate(t.stops[0][1]);const[l,h]=t.stops[u],[c,d]=t.stops[u-1],p=T(e,d);let f=0;switch(t.mode[0]){case"discrete":return p;case"linear":f=(r-c)/(l-c);break;case"exponential":{const e=t.mode[1];f=1===e?(r-c)/(l-c):(Math.pow(e,r-c)-1)/(Math.pow(e,l-c)-1);break}default:throw new Error(`interpolation mode ${JSON.stringify(t.mode)} is not supported`)}const m=T(e,h);if("number"==typeof p&&"number"==typeof m)return(0,n.lerp)(p,m,f);if(p instanceof M.RGBA&&m instanceof M.RGBA)return p.clone().lerp(m,f);if(p instanceof _.Pixels&&m instanceof _.Pixels)return new _.Pixels((0,n.lerp)(p.value,m.value,f));if(p instanceof i.Color&&m instanceof i.Color)return p.clone().lerp(m,f);if(p instanceof s.Vector2&&m instanceof s.Vector2)return p.clone().lerp(m,f);if(p instanceof o.Vector3&&m instanceof o.Vector3)return p.clone().lerp(m,f);if(p instanceof a.Vector4&&m instanceof a.Vector4)return p.clone().lerp(m,f);if(Array.isArray(p)&&Array.isArray(m)&&p.length===m.length)return p.map(((t,e)=>(0,n.lerp)(t,m[e],f)));throw new Error(`todo: mix(${JSON.stringify(p)}, ${JSON.stringify(m)}, ${f})`)}}}e.ExprEvaluator=S,S.defineOperators(h.CastOperators),S.defineOperators(d.ComparisonOperators),S.defineOperators(y.MathOperators),S.defineOperators(v.StringOperators),S.defineOperators(c.ColorOperators),S.defineOperators(b.TypeOperators),S.defineOperators(g.MiscOperators),S.defineOperators(f.FlowOperators),S.defineOperators(l.ArrayOperators),S.defineOperators(x.ObjectOperators),S.defineOperators(p.FeatureOperators),S.defineOperators(m.MapOperators),S.defineOperators(w.VectorOperators)},908:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExprInstantiator=void 0;const i=r(7259),n=r(8023),s=new i.Env;e.ExprInstantiator=class{visitNullLiteralExpr(t,e){return t}visitBooleanLiteralExpr(t,e){return t}visitNumberLiteralExpr(t,e){return t}visitStringLiteralExpr(t,e){return t}visitObjectLiteralExpr(t,e){return t}visitVarExpr(t,e){if(e.preserve&&e.preserve.has(t.name))return t;const r=e.env.lookup(t.name);return n.LiteralExpr.fromValue(void 0!==r?r:null)}visitHasAttributeExpr(t,e){if(e.preserve&&e.preserve.has(t.name))return t;const r=void 0!==e.env.lookup(t.name);return n.LiteralExpr.fromValue(r)}visitCallExprImpl(t,e,r){const i=t.args.map((t=>t.accept(this,e)));return i.some(((e,r)=>e!==t.args[r]))?r(t.op,i):t}visitCallExpr(t,e){return this.visitCallExprImpl(t,e,((t,e)=>new n.CallExpr(t,e)))}visitLookupExpr(t,e){return this.visitCallExprImpl(t,e,((t,e)=>new n.LookupExpr(e)))}visitMatchExpr(t,e){const r=t.value.accept(this,e);if(r instanceof n.LiteralExpr){const i=r.value;for(const[r,n]of t.branches){if(Array.isArray(r)&&r.includes(i))return n.accept(this,e);if(r===i)return n.accept(this,e)}return t.fallback.accept(this,e)}let i=t.value!==r;const s=t.branches.map((([t,r])=>{const n=r.accept(this,e);return n!==r&&(i=!0),[t,n]})),o=t.fallback.accept(this,e);return o!==t.fallback&&(i=!0),i?new n.MatchExpr(r,s,o):t}visitCaseExpr(t,e){const r=[];let i=!1;for(const[o,a]of t.branches){const t=o.accept(this,e),u=t.dependencies();if(o.isDynamic()||0!==u.properties.size)t!==o&&(i=!0),r.push([t,a]);else if(Boolean(t.evaluate(s,n.ExprScope.Condition)))return a.accept(this,e)}if(0===r.length)return t.fallback.accept(this,e);r.length!==t.branches.length&&(i=!0),r.forEach((t=>{const r=t[1].accept(this,e);r!==t[1]&&(i=!0),t[1]=r}));const o=t.fallback.accept(this,e);return o!==t.fallback&&(i=!0),i?new n.CaseExpr(r,o):t}visitStepExpr(t,e){const r=t.input.accept(this,e),i=t.defaultValue.accept(this,e),s=t.stops.map((([t,r])=>[t,r.accept(this,e)]));return new n.StepExpr(r,i,s)}visitInterpolateExpr(t,e){const r=t.input.accept(this,e),i=t.stops.map((([t,r])=>[t,r.accept(this,e)]));return new n.InterpolateExpr(t.mode,r,i)}}},8797:(t,e,r)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.ExprPool=e.INTERNED=void 0;const i=r(797),n=r(8023);var s;!function(t){t[t.CALL=0]="CALL",t[t.LOOKUP=1]="LOOKUP"}(s||(s={})),e.INTERNED=Symbol("i");const o=(t,e=!1)=>{var r,i,n,s;let a;return a=t instanceof Object?Array.isArray(t)?o(null!==(r=t[1])&&void 0!==r?r:t[0],e):null!==(s=null!==(n=null===(i=null==t?void 0:t.getPoolKey)||void 0===i?void 0:i.call(t,e))&&void 0!==n?n:null==t?void 0:t.constructor.name.substring(0,3))&&void 0!==s?s:"?":"number"==typeof t?t:String(t).substring(0,3),a};e.ExprPool=class{constructor(){this.m_numberLiterals=new Map,this.m_stringLiterals=new Map,this.m_objectLiteralsByID=new Map,this.m_objectLiterals=[],this.m_arrayLiterals=[],this.m_varExprs=new Map,this.m_hasAttributeExprs=new Map,this.m_matchExprs=[],this.m_caseExprs=new Map,this.m_interpolateExprs=new Map,this.m_stepExprs=[],this.m_callExprs=new Map,this.m_arrays=new Map,this.m_objects=new Map}add(t){return t.accept(this,void 0)}clear(){this.m_numberLiterals.clear(),this.m_stringLiterals.clear(),this.m_objectLiteralsByID.clear(),this.m_objectLiterals.length=0,this.m_arrayLiterals.length=0,this.m_varExprs.clear(),this.m_hasAttributeExprs.clear(),this.m_matchExprs.length=0,this.m_caseExprs.clear(),this.m_interpolateExprs.clear(),this.m_stepExprs.length=0,this.m_callExprs.clear(),this.m_arrays.clear(),this.m_objects.clear()}stats(){const t=new Map;t.set("m_numberLiterals",this.m_numberLiterals.size),t.set("m_stringLiterals",this.m_stringLiterals.size),t.set("m_objectLiteralsByID",this.m_objectLiteralsByID.size),t.set("m_objectLiterals",this.m_objectLiterals.length),t.set("m_arrayLiterals",this.m_arrayLiterals.length),t.set("m_varExprs",this.m_varExprs.size),t.set("m_hasAttributeExprs",this.m_varExprs.size),t.set("m_matchExprs",this.m_matchExprs.length),t.set("m_caseExprs",Array.from(this.m_caseExprs).reduce(((t,e)=>Array.from(e[1]).reduce(((t,e)=>t+e[1].length),t)),0)),t.set("m_interpolateExprs",Array.from(this.m_interpolateExprs).reduce(((t,e)=>t+e[1].length),0)),t.set("m_stepExprs",this.m_stepExprs.length),t.set("m_callExprs",Array.from(this.m_callExprs).reduce(((t,e)=>Array.from(e[1]).reduce(((t,e)=>t+e[1].length),t)),0)),t.set("m_arrays",Array.from(this.m_arrays).reduce(((t,e)=>Array.from(e[1]).reduce(((t,e)=>Array.from(e[1]).reduce(((t,e)=>t+e[1].length),t)),t)),0)),t.set("m_objects",Array.from(this.m_objects).reduce(((t,e)=>Array.from(e[1]).reduce(((t,e)=>Array.from(e[1]).reduce(((t,e)=>t+e[1].length),t)),t)),0)),t.set("TOTAL interned",Array.from(t).reduce(((t,e)=>t+e[1]),0)),console.dir(t)}internValue(t,r){if(null==t?void 0:t[e.INTERNED])return t;let i;return i=Array.isArray(t)?this.internArray(t,r):t instanceof n.Expr?t.accept(this,r):null!==t&&t instanceof Object?this.internObject(t):t,i}internArray(t,r){if(t[e.INTERNED])return t;const i=this.m_arrays;let n=t.length,s=i.get(n);s||i.set(n,s=new Map);let a=o(t[0]),u=s.get(a);u||s.set(a,u=new Map);const l=a;a=n<2?o(t[0],!0):o(t[1]),a===l&&(a=o(t[0],!0));let h=u.get(a);h||u.set(a,h=[]);let c=0;for(const e of t)t[c++]=this.internValue(e);for(const e of h){for(c=n;c--&&e[c]===t[c];);if(c<0)return e}return h.push(t),t[e.INTERNED]=!0,t}internObject(t,r){var i,n;if(t[e.INTERNED])return t;const s=this.m_objects,o=Object.keys(t);let a=o.length,u=s.get(a);u||s.set(a,u=new Map),a=o[0];let l=u.get(a);l||u.set(a,l=new Map);let h=t[a];if(h instanceof Object)for(const t in h){h=h[t];break}a=h instanceof Object?null!==(n=null===(i=null==h?void 0:h.getPoolKey)||void 0===i?void 0:i.call(h))&&void 0!==n?n:h.constructor.name:h;let c=l.get(a);c||l.set(a,c=[]);for(const e of o)t[e]=this.internValue(t[e]);for(const e of c){let r=0;for(const i of o){if(e[i]!==t[i])break;r++}if(r===a)return e}return c.push(t),t[e.INTERNED]=!0,t}visitNullLiteralExpr(t,e){return n.NullLiteralExpr.instance}visitBooleanLiteralExpr(t,e){return t.value?n.BooleanLiteralExpr.trueInstance:n.BooleanLiteralExpr.falseInstance}visitNumberLiteralExpr(t,e){var r;const i=this.m_numberLiterals,n=t.value;return null!==(r=i.get(n))&&void 0!==r?r:(i.set(n,t),t)}visitStringLiteralExpr(t,e){var r;
2const i=this.m_stringLiterals,n=t.value;return null!==(r=i.get(n))&&void 0!==r?r:(i.set(n,t),t)}visitObjectLiteralExpr(t,e){let r;const s=t.id;if(void 0!==s){if(r=this.m_objectLiteralsByID.get(s),!r){const e=this.internValue(t.value);r=new n.ObjectLiteralExpr(e,s),this.m_objectLiteralsByID.set(s,r)}}else{(0,i.assert)(!1,"ObjectLiteralExpr without id");const e=t.isArrayLiteral?this.m_arrayLiterals:this.m_objectLiterals;if(e.includes(t))r=t;else{const i=this.internValue(t.value);for(const t of e)if(t.value===i){r=t;break}r||(r=new n.ObjectLiteralExpr(i),e.push(r))}}return r}visitVarExpr(t,e){var r;const i=this.m_varExprs,n=t.name;return null!==(r=i.get(n))&&void 0!==r?r:(i.set(n,t),t)}visitHasAttributeExpr(t,e){var r;const i=this.m_hasAttributeExprs,n=t.name;return null!==(r=i.get(n))&&void 0!==r?r:(i.set(n,t),t)}visitMatchExpr(t,e){const r=this.m_matchExprs;if(r.includes(t))return t;const i=t.value.accept(this,e),s=this.internArray(t.branches,e),o=t.fallback.accept(this,e);for(const t of r)if(t.value===i&&t.branches===s&&t.fallback===o)return t;const a=new n.MatchExpr(i,s,o);return r.push(a),a}visitCaseExpr(t,e){const r=this.m_caseExprs;let i=t.branches.length,s=r.get(i);s||r.set(i,s=new Map),i=t.branches[0][0].getPoolKey();let o=s.get(i);if(o){if(o.includes(t))return t}else s.set(i,o=[]);const a=this.internArray(t.branches),u=t.fallback.accept(this,e);for(const t of o)if(t.branches===a&&t.fallback===u)return t;const l=new n.CaseExpr(a,u);return o.push(l),l}visitCallExprImpl(t,e,r){if(t.isCached)return t;const i=this.m_callExprs;let a=t.op,u=i.get(a);u||i.set(a,u=new Map),a=o(t.args[0]);let l=u.get(a);l||u.set(a,l=[]);const h=this.internArray(t.args);for(const t of l)if(t.args===h)return t;const c=r===s.CALL?new n.CallExpr(t.op,h):new n.LookupExpr(h);return t.descriptor&&(c.descriptor=t.descriptor),l.push(c),c}visitCallExpr(t,e){return this.visitCallExprImpl(t,e,s.CALL)}visitLookupExpr(t,e){return this.visitCallExprImpl(t,e,s.LOOKUP)}visitStepExpr(t,e){const r=this.m_stepExprs;if(r.includes(t))return t;const i=t.input.accept(this,e),s=t.defaultValue.accept(this,e),o=this.internArray(t.stops);for(const t of r)if(t.input===i&&t.defaultValue===s&&t.stops===o)return t;const a=new n.StepExpr(i,s,o);return r.push(a),a}visitInterpolateExpr(t,e){const r=this.m_interpolateExprs,i=t.stops.length*(t.stops[0][0]+3);let s=r.get(i);if(s){if(s.includes(t))return t}else r.set(i,s=[]);const o=this.internArray(t.mode),a=t.input.accept(this,e),u=this.internArray(t.stops);for(const t of s)if(t.mode===o&&t.input===a&&t.stops===u)return t;const l=new n.InterpolateExpr(o,a,u);return s.push(l),l}}},8628:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.interpolatedPropertyDefinitionToJsonExpr=e.isInterpolatedPropertyDefinition=e.InterpolationMode=void 0,(r=e.InterpolationMode||(e.InterpolationMode={}))[r.Discrete=0]="Discrete",r[r.Linear=1]="Linear",r[r.Cubic=2]="Cub
2ic",r[r.Exponential=3]="Exponential",e.isInterpolatedPropertyDefinition=function(t){return!!(t&&void 0===t.interpolationMode&&Array.isArray(t.values)&&t.values.length>0&&void 0!==t.values[0]&&Array.isArray(t.zoomLevels)&&t.zoomLevels.length>0&&void 0!==t.zoomLevels[0]&&t.values.length===t.zoomLevels.length)},e.interpolatedPropertyDefinitionToJsonExpr=function(t){if(void 0===t.interpolation||"Discrete"===t.interpolation){const e=["step",["zoom"],t.values[0]];for(let r=1;r<t.zoomLevels.length;++r)e.push(t.zoomLevels[r],t.values[r]);return e}const e=["interpolate"];switch(t.interpolation){case"Linear":e.push(["linear"]);break;case"Cubic":e.push(["cubic"]);break;case"Exponential":e.push(["exponential",void 0!==t.exponent?t.exponent:2]);break;default:throw new Error(`interpolation mode \'${t.interpolation}\' is not supported`)}e.push(["zoom"]);for(let r=0;r<t.zoomLevels.length;++r)e.push(t.zoomLevels[r],t.values[r]);return e}},1017:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isJsonExpr=void 0,e.isJsonExpr=function(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]}},1324:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Pixels=void 0;const r=/^((?=\\.\\d|\\d)(?:\\d+)?(?:\\.?\\d*))px$/;class i{static parse(t){const e=r.exec(t);if(null!==e)return new i(Number(e[1]))}constructor(t){this.value=t}toJSON(){return`${this.value}px`}}e.Pixels=i},7610:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RGBA=void 0;const i=r(3334),n=r(6577),s=r(1667),o=r(6331);class a{static parse(t){const e=(0,o.parseStringEncodedColor)(t);
2if(void 0!==e)return s.ColorUtils.getRgbaFromHex(e)}static isRGBA(t){return t instanceof a}constructor(t=1,e=1,r=1,i=1,n=!0){this.r=t,this.g=e,this.b=r,this.a=i,this.isRGBA=n}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}equals(t){return this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a}clone(){return new a(this.r,this.g,this.b,this.a)}fromVector(t){return this.r=t.x,this.g=t.y,this.b=t.z,this.a=t.w,this}toVector(t){return t||(t=new n.Vector4),t.set(this.r,this.g,this.b,this.a),t}fromHex(t){return s.ColorUtils.getRgbaFromHex(t,this),this}getHex(){return s.ColorUtils.getHexFromRgba(this.r,this.g,this.b,this.a)}lerp(t,e){return this.r=(0,i.lerp)(this.r,t.r,e),this.g=(0,i.lerp)(this.g,t.g,e),this.b=(0,i.lerp)(this.b,t.b,e),this.a=(0,i.lerp)(this.a,t.a,e),this}toJSON(){return`rgba(${255*this.r|0}, ${255*this.g|0}, ${255*this.b|0}, ${this.a})`}}e.RGBA=a},6331:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseStringEncodedColor=e.parseStringEncodedNumeral=e.StringEncodedNumeralFormatMaxSize=e.StringEncodedNumeralFormats=e.StringEncodedColorFormats=e.StringEncodedMetricFormats=e.StringEncodedNumeralType=void 0;const i=r(6925),n=r(797),s=r(1667);var o;!function(t){t[t.Meters=0]="Meters",t[t.Pixels=1]="Pixels",t[t.Hex=2]="Hex"}(o=e.StringEncodedNumeralType||(e.StringEncodedNumeralType={}));const a={type:o.Meters,size:1,regExp:/^((?=\\.\\d|\\d)(?:\\d+)?(?:\\.?\\d*))m$/,decoder:(t,e)=>{const r=a.regExp.exec(t);return!!r&&void 0!==(e[0]=Number(r[1]))}},u={type:o.Pixels,size:1,mask:1,regExp:/^((?=\\.\\d|\\d)(?:\\d+)?(?:\\.?\\d*))px$/,decoder:(t,e)=>{const r=u.regExp.exec(t);return null!==r&&(e[0]=Number(r[1]),!0)}},l={type:o.Hex,size:4,regExp:/^\\#((?:[0-9A-Fa-f][0-9A-Fa-f]){4}|[0-9A-Fa-f]{4})$/,decoder:(t,e)=>{const r=l.regExp.exec(t);if(null===r)return!1;const i=r[1],s=i.length;return(0,n.assert)(4===s||8===s,"Matched incorrect hex color format"),4===s?(e[0]=parseInt(i.charAt(0)+i.charAt(0),16)/255,e[1]=parseInt(i.charAt(1)+i.charAt(1),16)/255,e[2]=parseInt(i.charAt(2)+i.charAt(2),16)/255,e[3]=4===s?parseInt(i.charAt(3)+i.charAt(3),16)/255:1):8===s&&(e[0]=parseInt(i.charAt(0)+i.charAt(1),16)/255,e[1]=parseInt(i.charAt(2)+i.charAt(3),16)/255,e[2]=parseInt(i.charAt(4)+i.charAt(5),16)/255,e[3]=8===s?parseInt(i.charAt(6)+i.charAt(7),16)/255:1),!0}};e.StringEncodedMetricFormats=[a,u];const h=e.StringEncodedMetricFormats.reduce(((t,e)=>Math.max(t,e.size)),0);e.StringEncodedColorFormats=[l];const c=e.StringEncodedColorFormats.reduce(((t,e)=>Math.max(t,e.size)),0);e.StringEncodedNumeralFormats=[...e.StringEncodedMetricFormats,...e.StringEncodedColorFormats],e.StringEncodedNumeralFormatMaxSize=Math.max(c,h);const d=new Array(e.StringEncodedNumeralFormatMaxSize);function p(t,e,r=1){const n=e.find((e=>!!e.decoder(t,d)));if(void 0===n){const e=(0,i.parseCSSColor)(t);return Array.isArray(e)&&!e.some((t=>isNaN(t)))?s.ColorUtils.getHexFromRgba(e[0]/255,e[1]/255,e[2]/255,e[3]):void 0}switch(null==n?void 0:n.type){case o.Pixels:return d[0]*r;case o.Hex:return s.ColorUtils.getHexFromRgba(d[0],d[1],d[2],d[3]);default:return d[0]}}e.parseStringEncodedNumeral=function(t,r=1){return p(t,e.StringEncodedNumeralFormats,r)},e.parseStringEncodedColor=function(t){return p(t,e.StringEncodedColorFormats)}},1370:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.isTextureBuffer=e.PlacementToken=e.transientToPickability=e.Pickability=e.TextureCoordinateType=void 0,(n=e.TextureCoordinateType||(e.TextureCoordinateType={})).TileSpace="tile-space",n.EquirectangularSpace="equirectangular-space",n.FeatureSpace="feature-space",function(t){t.onlyVisible="only-visible",t.transient="transient",t.all="all"}(r=e.Pickability||(e.Pickability={})),e.transientToPickability=function(t){let e=r.onlyVisible;return null!=t&&(e="string"==typeof t?t:!0===t?r.transient:r.onlyVisible),e},(i=e.PlacementToken||(e.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",e.isTextureBuffer=function(t){return t&&t.buffer&&"string"==typeof t.type}}
2,1216:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setTechniqueRenderOrderOrPriority=e.addBuffersToTransferList=e.textureCoordinateType=e.supportsTextures=e.needsVertexNormals=e.isLabelRejectionLineTechnique=e.isTextTechnique=e.isTerrainTechnique=e.isStandardTechnique=e.isExtrudedPolygonTechnique=e.isPolygonTechnique=e.isStandardExtrudedLineTechnique=e.isBasicExtrudedLineTechnique=e.isExtrudedLineTechnique=e.isSegmentsTechnique=e.isSpecialDashesLineTechnique=e.isRasterTechnique=e.isSolidLineTechnique=e.isLineTechnique=e.isLineMarkerTechnique=e.isIconTextTechnique=e.isSquaresTechnique=e.isCirclesTechnique=e.TRANSPARENCY_PROPERTY_KEYS=e.TEXTURE_PROPERTY_KEYS=void 0;const i=r(1370);function n(t){return"labeled-icon"===t.name}function s(t){return"line-marker"===t.name}function o(t){return"solid-line"===t.name||"dashed-line"===t.name}function a(t){return"extruded-line"===t.name}function u(t){return a(t)&&"standard"===t.shading}function l(t){return"polygon"===t.name}function h(t){return"extruded-polygon"===t.name}function c(t){return"standard"===t.name}function d(t){return"terrain"===t.name}function p(t){return"text"===t.name}function f(t){return l(t)||c(t)||h(t)||d(t)||o(t)}e.TEXTURE_PROPERTY_KEYS=["map","normalMap","displacementMap","roughnessMap","emissiveMap","alphaMap","metalnessMap","bumpMap","dash-image"],e.TRANSPARENCY_PROPERTY_KEYS=["opacity","transparent"],e.isCirclesTechnique=function(t){return"circles"===t.name},e.isSquaresTechnique=function(t){return"squares"===t.name},e.isIconTextTechnique=n,e.isLineMarkerTechnique=s,e.isLineTechnique=function(t){return"line"===t.name},e.isSolidLineTechnique=o,e.isRasterTechnique=function(t){return"raster"===t.name},e.isSpecialDashesLineTechnique=function(t){return("solid-line"===t.name||"dashed-line"===t.name)&&void 0!==t.dashes&&"Square"!==t.dashes},e.isSegmentsTechnique=function(t){return"segments"===t.name},e.isExtrudedLineTechnique=a,e.isBasicExtrudedLineTechnique=function(t){return a(t)&&"basic"===t.shading},e.isStandardExtrudedLineTechnique=u,e.isPolygonTechnique=l,e.isExtrudedPolygonTechnique=h,e.isStandardTechnique=c,e.isTerrainTechnique=d,e.isTextTechnique=p,e.isLabelRejectionLineTechnique=function(t){return"label-rejection-line"===t.name},e.needsVertexNormals=function(t){return h(t)||l(t)||c(t)||d(t)||u(t)},e.supportsTextures=f,e.textureCoordinateType=function(t){return f(t)?t.textureCoordinateType:void 0},e.addBuffersToTransferList=function(t,r){if(c(t)||h(t)||d(t))for(const n of e.TEXTURE_PROPERTY_KEYS){const e=t[n];(0,i.isTextureBuffer)(e)&&e.buffer instanceof ArrayBuffer&&r.push(e.buffer)}},e.setTechniqueRenderOrderOrPriority=function(t,e,r){if(p(t)||n(t)||s(t)){if(r&&"string"==typeof t._category){const e=r.indexOf(t._category);-1!==e&&(t.priority=r.length-e)}}else if(e&&void 0!==t._layer){const r=r=>{const i=null==e?void 0:e.findIndex((e=>e.layer===t._layer&&e.category===r));return void 0!==i&&-1!==i?10*(i+1):void 0};if("string"==typeof t._category){const e=r(t._category);void 0!==e&&(t.renderOrder=e)}}}},5771:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isConditionalExtendsEntry=e.isDirectionalLight=e.isAmbientLight=e.getStyles=e.isStylesDictionary=e.isJsonExprReference=e.getDefinitionValue=e.isVerboseDefinition=void 0;const i=r(1017);function n(t){return void 0!==(null==t?void 0:t.value)}function s(t){return void 0!==t&&!Array.isArray(t)}e.isVerboseDefinition=n,e.getDefinitionValue=function(t){return n(t)?t.value:t},e.isJsonExprReference=function(t){return Array.isArray(t)&&2===t.length&&"ref"===t[0]&&"string"==typeof t[1]},e.isStylesDictionary=s,e.getStyles=function(t){return void 0===t?[]:s(t)?function(t){const e=[];for(const r in t)t[r].forEach((t=>{void 0===t.layer&&(t.layer=r),e.push(t)}));return e}(t):t},e.isAmbientLight=function(t){return"ambient"===t.type},e.isDirectionalLight=function(t){return"directional"===t.type},e.isConditionalExtendsEntry=function(t){return void 0!==t&&(0,i.isJsonExpr)(t.when)&&/^(object|string)$/.test(typeof t.value)}},8131:(t,e,r)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.ThemeVisitor=void 0;const i=r(1017),n=r(5771);e.ThemeVisitor=class{constructor(t){this.theme=t}visitStyles(t){const e=e=>!(0,i.isJsonExpr)(e)&&!!t(e);if(void 0!==this.theme.styles)for(const t of(0,n.getStyles)(this.theme.styles))if(e(t))return!0;return!1}}},797:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assert=void 0,e.assert=function(t,e){}},6304:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getPropertyValue=void 0;const i=r(8023),n=r(1324),s=r(7610),o=r(6331);e.getPropertyValue=function(t,e,r){var a,u,l;if(i.Expr.isExpr(t)){let o=t.evaluate(e,i.ExprScope.Dynamic,r);return"string"==typeof o&&(o=null!==(u=null!==(a=s.RGBA.parse(o))&&void 0!==a?a:n.Pixels.parse(o))&&void 0!==u?u:o),o instanceof s.RGBA?o.getHex():o instanceof n.Pixels?o.value*(null!==(l=Number(e.lookup("$pixelToMeters")))&&void 0!==l?l:1):o}if(null==t)return null;if("string"!=typeof t)return t;{const r=e.lookup("$pixelToMeters")||1,i=(0,o.parseStringEncodedNumeral)(t,r);return void 0!==i?i:t}}},6073:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ArrayOperators=void 0;const i=r(8023),n=["boolean","number","string"];function s(t,e){if(!(t instanceof i.StringLiteralExpr&&n.includes(t.value)))throw new Error(`expected "boolean", "number" or "string" instead of \'${JSON.stringify(t)}\'`);const r=t.value;e.forEach(((t,e)=>{if(typeof t!==r)throw new Error(`expected array element at index ${e} to have type \'${r}\'`)}))}function o(t,e){const r=t.evaluate(e);if(!Array.isArray(r))throw new Error(`\'${r}\' is not an array`);return r}const a={array:{call:(t,e)=>{switch(e.args.length){case 0:throw new Error("not enough arguments");case 1:return o(t,e.args[0]);case 2:{const r=o(t,e.args[1]);return s(e.args[0],r),r}case 3:{const r=o(t,e.args[2]);return function(t,e){if(!(t instanceof i.NumberLiteralExpr))throw new Error("missing expected number of elements");const r=t.value;if(e.length!==r)throw new Error(`the array must have ${r} element(s)`)}(e.args[1],r),s(e.args[0],r),r}default:throw new Error("too many arguments")}}},"make-array":{call:(t,e)=>{if(0===e.args.length)throw new Error("not enough arguments");return[...e.args.map((e=>t.evaluate(e)))]}},at:{call:(t,e)=>{const r=e.args,i=t.evaluate(r[0]);if("number"!=typeof i)throw new Error("expected the index of the element to retrieve");const n=t.evaluate(r[1]);if(!Array.isArray(n))throw new Error("expected an array");return i>=0&&i<n.length?n[i]:null}},slice:{call:(t,e)=>{if(e.args.length<2)throw new Error("not enough arguments");const r=t.evaluate(e.args[0]);if("string"!=typeof r&&!Array.isArray(r))throw new Error("input must be a string or an array");const i=t.evaluate(e.args[1]);if("number"!=typeof i)throw new Error("expected an index");let n;if(e.args.length>2&&(n=t.evaluate(e.args[2]),"number"!=typeof n))throw new Error("expected an index");return r.slice(i,n)}}};e.ArrayOperators=a},7290:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CastOperators=void 0;const r={"to-boolean":{call:(t,e)=>Boolean(t.evaluate(e.args[0]))},"to-string":{call:(t,e)=>String(t.evaluate(e.args[0]))},"to-number":{call:(t,e)=>{for(const r of e.args){const e=Number(t.evaluate(r));if(!isNaN(e))return e}throw new Error("cannot convert the value to a number")}}};e.CastOperators=r},4672:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ColorOperators=void 0;const i=r(3334),n=r(1667),s=r(7610),o=r(6331),a={alpha:{call:(t,e)=>{let r=t.evaluate(e.args[0]);return"string"==typeof r&&(r=(0,o.parseStringEncodedColor)(r)),"number"==typeof r?n.ColorUtils.getAlphaFromHex(r):1}},rgba:{call:(t,e)=>{const r=t.evaluate(e.args[0]),s=t.evaluate(e.args[1]),o=t.evaluate(e.args[2]),a=t.evaluate(e.args[3]);if("number"==typeof r&&"number"==typeof s&&"number"==typeof o&&"number"==typeof a&&r>=0&&s>=0&&o>=0&&a>=0&&a<=1)return function(t,e,r,s){return n.ColorUtils.getHexFromRgba((0,i.clamp)(t,0,255)/255,(0,i.clamp)(e,0,255)/255,(0,i.clamp)(r,0,255)/255,(0,i.clamp)(s,0,1))}(r,s,o,a);throw new Error(`unknown color \'rgba(${r},${s},${o},${a})\'`)}},rgb:{call:(t,e)=>{const r=t.evaluate(e.args[0]),s=t.evaluate(e.args[1]),o=t.evaluate(e.args[2]);if("number"==typeof r&&"number"==typeof s&&"number"==typeof o&&r>=0&&s>=0&&o>=0)return function(t,e,r){return n.ColorUtils.getHexFromRgb((0,i.clamp)(t,0,255)/255,(0,i.clamp)(e,0,255)/255,(0,i.clamp)(r,0,255)/255)}(r,s,o);throw new Error(`unknown color \'rgb(${r},${s},${o})\'`)}},hsl:{call:(t,e)=>{const r=t.evaluate(e.args[0]),s=t.evaluate(e.args[1]),o=t.evaluate(e.args[2]);if("number"==typeof r&&"number"==typeof s&&"number"==typeof o&&r>=0&&s>=0&&o>=0)return function(t,e,r){return n.ColorUtils.getHexFromHsl((0,i.euclideanModulo)(t,360)/360,(0,i.clamp)(e,0,100)/100,(0,i.clamp)(r,0,100)/100)}(r,s,o);throw new Error(`unknown color \'hsl(${r},${s}%,${o}%)\'`)}},"to-color":{call:(t,e)=>h(t.evaluate(e.args[0]))},darken:{call:(t,e)=>{const r=h(t.evaluate(e.args[0])),i=t.evaluate(e.args[1]);if(Number(i)!==i)throw new Error(`invalid darken amount \'${i}\'`);return n.ColorUtils.darken(r.clone(),i)}},"scale-color":{call:(t,e)=>{const r=e.args,i=r.length,s=h(t.evaluate(r[0]));u.h=u.s=u.l=u.a=0;for(let e=1;e<i;){const i=t.evaluate(r[e++]);if(!l.test(i))throw new Error(`invalid component "${i}"`);const n=t.evaluate(r[e++]);if(n!==Number(n))throw new Error(`invalid factor "${n}"`);u[i]=n}return n.ColorUtils.scaleColor(s.clone(),u)}}},u={h:0,s:0,l:0,a:0},l=/^[sla]$/;function h(t){const e=t;return s.RGBA.isRGBA(t)?t:(null==e?void 0:e.isRGBA)?new s.RGBA(e.r,e.g,e.b,e.a):n.ColorUtils.getRgbaFromHex(function(t){if("string"==typeof t){const e=(0,o.parseStringEncodedColor)(t);
2if(void 0!==e)return e}throw new Error(`unknown color \'${t}\'`)}(t))}e.ColorOperators=a},8998:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ComparisonOperators=void 0;const i=r(1667),n=r(8023);function s(t,e,r=!1){const i=t.evaluate(e.args[0]),n=t.evaluate(e.args[1]),s=typeof i;if(("number"!==s&&"string"!==s||s!==typeof n)&&r)throw new Error(`invalid operands \'${i}\' and \'${n}\' for operator \'${e.op}\'`);switch(e.op){case"<":return i<n;case">":return i>n;case"<=":return i<=n;case">=":return i>=n;default:throw new Error(`invalid comparison operator \'${e.op}\'`)}}function o(t,e,r=!1){if("number"!=typeof t||isNaN(t)){if(r)throw new Error(`invalid operand \'${t}\' for operator \'${e}\'`);return NaN}return t}const a={"!":{call:(t,e)=>!t.evaluate(e.args[0])},"==":{call:(t,e)=>{var r;const n=t.evaluate(e.args[0]),s=t.evaluate(e.args[1]);return null!==(r=i.ColorUtils.comparePotentiallyRGBA(n,s,!0))&&void 0!==r?r:n===s}},"!=":{call:(t,e)=>{var r;const n=t.evaluate(e.args[0]),s=t.evaluate(e.args[1]);return null!==(r=i.ColorUtils.comparePotentiallyRGBA(n,s,!1))&&void 0!==r?r:n!==s}},"<":{call:(t,e)=>s(t,e)},">":{call:(t,e)=>s(t,e)},"<=":{call:(t,e)=>s(t,e)},">=":{call:(t,e)=>s(t,e)},"inside-range":{call:(t,e)=>{const r=e.args;let i,s,a,u,l;r[1]instanceof n.ObjectLiteralExpr&&r[1].isArrayLiteral?(i=r[1].value,a=2,s=0,u=0,l=!0):(i=r,a=3,s=1,u=1,l=!1);let h=i.length,c=!1;if(h>=a&&h%2===u){const n=o(t.evaluate(r[0]),e.op);for(isNaN(n)&&(c=null);!1===c&&h>s;){const r=o(l?i[--h]:t.evaluate(i[--h]),e.op),s=o(l?i[--h]:t.evaluate(i[--h]),e.op);c=isNaN(s)||isNaN(r)?null:n>=s&&n<r}}else c=null;return c}}};e.ComparisonOperators=a},1954:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureOperators=void 0;const i=r(7259),n=r(8023),s={"geometry-type":{call:(t,e)=>{switch(t.env.lookup("$geometryType")){case"point":return"Point";case"line":return"LineString";case"polygon":return"Polygon";default:return null}}},"feature-state":{isDynamicOperator:()=>!0,call:(t,e)=>{var r,s;if(t.scope!==n.ExprScope.Dynamic)throw new Error("feature-state cannot be used in this context");const o=t.evaluate(e.args[0]);if("string"!=typeof o)throw new Error("expected the name of the property of the feature state");const a=t.env.lookup("$state");return i.Env.isEnv(a)?null!==(r=a.lookup(o))&&void 0!==r?r:null:a instanceof Map&&null!==(s=a.get(o))&&void 0!==s?s:null}},id:{call:(t,e)=>{var r;return null!==(r=t.env.lookup("$id"))&&void 0!==r?r:null}}};e.FeatureOperators=s},2181:(t,e)=>{"use strict";function r(t,e,r){switch(e){case"boolean":case"number":case"string":for(const i of r){const r=t.evaluate(i);if(typeof r===e)return r}throw new Error(`expected a \'${e}\'`);default:throw new Error(`invalid type \'${e}\'`)}}Object.defineProperty(e,"__esModule",{value:!0}),e.FlowOperators=void 0;const i={all:{call:(t,e)=>{for(const r of e.args)if(!t.evaluate(r))return!1;return!0}},any:{call:(t,e)=>{for(const r of e.args)if(t.evaluate(r))return!0;return!1}},none:{call:(t,e)=>{for(const r of e.args)if(t.evaluate(r))return!1;return!0}},boolean:{call:(t,e)=>r(t,"boolean",e.args)},number:{call:(t,e)=>r(t,"number",e.args)},string:{call:(t,e)=>r(t,"string",e.args)}};e.FlowOperators=i},202:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MapOperators=void 0;const i=r(8023),n={"ppi-scale":{call:(t,e)=>t.evaluate(e.args[0])*(e.args[1]?t.evaluate(e.args[1]):1)},"world-ppi-scale":{isDynamicOperator:()=>!0,call:(t,e)=>{const r=t.evaluate(e.args[0]),i=e.args[1]?t.evaluate(e.args[1]):1,n=t.env.lookup("$zoom");return r*(Math.pow(2,17)/Math.pow(2,n))*i}},"world-discrete-ppi-scale":{isDynamicOperator:()=>!0,call:(t,e)=>{const r=t.evaluate(e.args[0]),i=t.env.lookup("$zoom");return r*(40075016.68557849/(256*Math.pow(2,Math.floor(i))))}},"pixel-world-scale":{isDynamicOperator:()=>!0,call:(t,e)=>t.evaluate(e.args[0])*(t.env.lookup("$pixelToMeters")||1)},ppi:{call:t=>{const e=t.env.lookup("$ppi");return"number"==typeof e?e:72}},zoom:{isDynamicOperator:()=>!0,call:(t,e)=>{var r;return t.scope===i.ExprScope.Value?e:null!==(r=t.env.lookup("$zoom"))&&void 0!==r?r:null}}};e.MapOperators=n},4054:(t,e,r)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.MathOperators=void 0;const i=r(3334),n=r(5448),s=r(6815),o=r(6577),a={"^":{call:(t,e)=>{const r=t.evaluate(e.args[0]),i=t.evaluate(e.args[1]);if("number"!=typeof r||"number"!=typeof i)throw new Error(`invalid operands \'${typeof r}\' and \'${typeof i}\' for operator \'^\'`);return Math.pow(r,i)}},"-":{call:(t,e)=>{if(1===e.args.length){const r=t.evaluate(e.args[0]);if("number"!=typeof r)throw new Error(`ìnvalid operand \'${typeof r} for operator \'-\'`);return-r}const r=t.evaluate(e.args[0]),i=t.evaluate(e.args[1]);if("number"!=typeof r||"number"!=typeof i)throw new Error(`invalid operands \'${typeof r}\' and \'${typeof i}\' for operator \'-\'`);return r-i}},"/":{call:(t,e)=>{const r=t.evaluate(e.args[0]),i=t.evaluate(e.args[1]);if("number"!=typeof r||"number"!=typeof i)throw new Error(`invalid operands \'${typeof r}\' and \'${typeof i}\' for operator \'/\'`);return r/i}},"%":{call:(t,e)=>{const r=t.evaluate(e.args[0]),i=t.evaluate(e.args[1]);if("number"!=typeof r||"number"!=typeof i)throw new Error(`invalid operands \'${typeof r}\' and \'${typeof i}\' for operator \'%\'`);return r%i}},"+":{call:(t,e)=>e.args.reduce(((e,r)=>Number(e)+Number(t.evaluate(r))),0)},"*":{call:(t,e)=>{const r=t.evaluate(e.args[0]),i=t.evaluate(e.args[1]),a="number"==typeof r,u="number"==typeof i;let l;if(a&&u)l=r*i;else if(u&&(r instanceof n.Vector2||r instanceof s.Vector3||r instanceof o.Vector4))l=r.clone().multiplyScalar(i);else{if(!a||!(i instanceof n.Vector2||i instanceof s.Vector3||i instanceof o.Vector4))throw new Error(`invalid operands \'${typeof r}\' and \'${typeof i}\' for operator \'*\'`);l=i.clone().multiplyScalar(r)}return l}},abs:{call:(t,e)=>{const r=t.evaluate(e.args[0]);if("number"!=typeof r)throw new Error(`invalid operand \'${r}\' for operator \'abs\'`);return Math.abs(r)}},acos:{call:(t,e)=>{const r=t.evaluate(e.args[0]);if("number"!=typeof r)throw new Error(`invalid operand \'${r}\' for operator \'acos\'`);return Math.acos(r)}},asin:{call:(t,e)=>{const r=t.evaluate(e.args[0]);if("number"!=typeof r)throw new Error(`invalid operand \'${r}\' for operator \'asin\'`);return Math.asin(r)}},atan:{call:(t,e)=>{const r=t.evaluate(e.args[0]);if("number"!=typeof r)throw new Error(`invalid operand \'${r}\' for operator \'atan\'`);return Math.atan(r)}},ceil:{call:(t,e)=>{const r=t.evaluate(e.args[0]);if("number"!=typeof r)throw new Error(`invalid operand \'${r}\' for operator \'ceil\'`);return Math.ceil(r)}},cos:{call:(t,e)=>{const r=t.evaluate(e.args[0]);if("number"!=typeof r)throw new Error(`invalid operand \'${r}\' for operator \'cos\'`);return Math.cos(r)}},e:{call:()=>Math.E},floor:{call:(t,e)=>{const r=t.evaluate(e.args[0]);if("number"!=typeof r)throw new Error(`invalid operand \'${r}\' for operator \'floor\'`);return Math.floor(r)}},ln:{call:(t,e)=>{const r=t.evaluate(e.args[0]);if("number"!=typeof r)throw new Error(`invalid operand \'${r}\' for operator \'ln\'`);return Math.log(r)}},ln2:{call:(t,e)=>{const r=t.evaluate(e.args[0]);if("number"!=typeof r)throw new Error(`invalid operand \'${r}\' for operator \'ln2\'`);return Math.log2(r)}},log10:{call:(t,e)=>{const r=t.evaluate(e.args[0]);if("number"!=typeof r)throw new Error(`invalid operand \'${r}\' for operator \'log10\'`);return Math.log10(r)}},max:{call:(t,e)=>Math.max(...e.args.map((e=>Number(t.evaluate(e)))))},min:{call:(t,e)=>Math.min(...e.args.map((e=>Number(t.evaluate(e)))))},clamp:{call:(t,e)=>{const r=t.evaluate(e.args[0]),n=t.evaluate(e.args[1]),s=t.evaluate(e.args[2]);if("number"!=typeof r||"number"!=typeof n||"number"!=typeof s)throw new Error(`invalid operands \'${r}\', ${n}, ${s} for operator \'clamp\'`);return(0,i.clamp)(r,n,s)}},pi:{call:()=>Math.PI}
2,round:{call:(t,e)=>{const r=t.evaluate(e.args[0]);if("number"!=typeof r)throw new Error(`invalid operand \'${r}\' for operator \'round\'`);return Math.round(r)}},sin:{call:(t,e)=>{const r=t.evaluate(e.args[0]);if("number"!=typeof r)throw new Error(`invalid operand \'${r}\' for operator \'sin\'`);return Math.sin(r)}},sqrt:{call:(t,e)=>{const r=t.evaluate(e.args[0]);if("number"!=typeof r)throw new Error(`invalid operand \'${r}\' for operator \'sqrt\'`);return Math.sqrt(r)}},tan:{call:(t,e)=>{const r=t.evaluate(e.args[0]);if("number"!=typeof r)throw new Error(`invalid operand \'${r}\' for operator \'tan\'`);return Math.tan(r)}}};e.MathOperators=a},9764:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MiscOperators=void 0;const i=r(797),n=r(8023);function s(t){return t.join("&")}function o(t,e){return t+"="+JSON.stringify(e)}function a(t,e=0){if(e>=t.length)return[];const r=a(t,e+1),i=r.length;for(let n=0;n<i;n+=1)r.push([...r[n],t[e]]);return r.push([t[e]]),r}function u(t,e){const r=t.args.slice(1),i=[];for(let t=0;t<r.length;
2t+=2){const n=e.evaluate(r[t+1]);if(null===n)continue;const s=e.evaluate(r[t]);i.push(o(s,n))}return i.sort().reverse(),function(t){t.sort(((t,e)=>e.length-t.length));const e=t.map((t=>s(t)));return e.push(""),e}(a(i))}const l={length:{call:(t,e)=>{const r=t.evaluate(e.args[0]);if(Array.isArray(r)||"string"==typeof r)return r.length;throw new Error(`invalid operand \'${r}\' for operator \'length\'`)}},coalesce:{call:(t,e)=>{for(const r of e.args){const e=t.evaluate(r);if(null!==e)return e}return null}},lookup:{call:(t,e)=>{(0,i.assert)(e.args.length>0,"missing lookup table");const r=u(e,t);let a=t.evaluate(e.args[0]);if((0,i.assert)(Array.isArray(a)||a instanceof Map,"wrong lookup table type"),Array.isArray(a)){a=function(t){const e=new Map;for(const r of t){if("object"!=typeof r)throw new Error(`Invalid lookup table entry type (${typeof r})`);if(!r.keys)throw new Error("Lookup table entry has no \'keys\' property.");if(!r.attributes)throw new Error("Lookup table entry has no \'attributes\' property.");const t=s(Object.getOwnPropertyNames(r.keys).sort().map((t=>o(t,r.keys[t]))));e.set(t,r.attributes)}return e}(a);const t=new n.ObjectLiteralExpr(a,e.args[0].id);e.args[0]=t}return function(t,e){for(const r of t){const t=e.get(r);if(t)return t}return null}(r,a)}},trace:{call:(t,e)=>{const r=[];for(const i of e.args)r.push(t.evaluate(i));return console.error("trace: ",...r),r[0]}}};e.MiscOperators=l},7029:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ObjectOperators=void 0;const i=r(7259),n=r(8023),s=Object.prototype.hasOwnProperty;var o;function a(t,e,r){var n;const a=t.evaluate(e[0]);if("string"!=typeof a)throw new Error("expected the name of an attribute");const u=t.evaluate(e[1]);if(u&&"object"==typeof u){if(i.Env.isEnv(u)){const t=null!==(n=u.lookup(a))&&void 0!==n?n:null;return r===o.get?t:null!==t}if(s.call(u,a))return r!==o.get||u[a]}return r===o.get&&null}!function(t){t[t.get=0]="get",t[t.has=1]="has"}(o||(o={}));const u={in:{call:(t,e)=>{const r=t.evaluate(e.args[0]),i=t.evaluate(e.args[1]);return("string"==typeof r&&"string"==typeof i||!!Array.isArray(i))&&i.includes(r)}},get:{call:(t,e)=>a(t,e.args,o.get)},has:{call:(t,e)=>a(t,e.args,o.has)},"dynamic-properties":{isDynamicOperator:()=>!0,call:(t,e)=>t.scope===n.ExprScope.Dynamic?t.env:e}};e.ObjectOperators=u},3501:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StringOperators=void 0;const r={concat:{call:(t,e)=>"".concat(...e.args.map((e=>String(t.evaluate(e)))))},downcase:{call:(t,e)=>String(t.evaluate(e.args[0])).toLocaleLowerCase()},upcase:{call:(t,e)=>String(t.evaluate(e.args[0])).toLocaleUpperCase()},"regex-replace":{call:(t,e)=>{const r=t.evaluate(e.args[0]),i=t.evaluate(e.args[1]),n=t.evaluate(e.args[2]);return"string"==typeof r&&"string"==typeof i&&"string"==typeof n?r.replace(new RegExp(i,"g"),n):r}},"~=":{call:(t,e)=>{const r=t.evaluate(e.args[0]),i=t.evaluate(e.args[1]);return"string"==typeof r&&"string"==typeof i&&r.includes(i)}},"^=":{call:(t,e)=>{const r=t.evaluate(e.args[0]),i=t.evaluate(e.args[1]);return"string"==typeof r&&"string"==typeof i&&r.startsWith(i)}},"$=":{call:(t,e)=>{const r=t.evaluate(e.args[0]),i=t.evaluate(e.args[1]);return"string"==typeof r&&"string"==typeof i&&r.endsWith(i)}},split:{call:(t,e)=>{const r=t.evaluate(e.args[0]),i=t.evaluate(e.args[1]);if("string"==typeof r&&"string"==typeof i)return r.split(i);throw new Error(`expected \'${r}\' and \'${i}\' to be a string`)}}};e.StringOperators=r},5113:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeOperators=void 0,e.TypeOperators={typeof:{call:(t,e)=>typeof t.evaluate(e.args[0])}}},545:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VectorOperators=void 0;const i=r(5448),n=r(6815),s=r(6577),o=r(8023);function a(t,e,r){let o;switch(r){case"vector2":o=i.Vector2;break;case"vector3":o=n.Vector3;break;case"vector4":o=s.Vector4}for(const r of e.args){const e=t.evaluate(r);if(e instanceof o)return e}throw new Error(`expected a "${r}"`)}function u(t,e,r){let o,a;switch(r){case"vector2":o=i.Vector2,a=2;break;case"vector3":o=n.Vector3,a=3;break;
2case"vector4":o=s.Vector4,a=4}for(const r of e.args){const e=t.evaluate(r);if(e instanceof o)return e;if(Array.isArray(e)&&e.length===a&&e.every((t=>"number"==typeof t)))return(new o).fromArray(e)}throw new Error(`expected a "${r}"`)}const l={"make-vector":{call:(t,e)=>{if(void 0!==e._value)return e._value;if(e.args.length<2)throw new Error("not enough arguments");if(e.args.length>4)throw new Error("too many arguments");const r=e.args.map((e=>t.evaluate(e)));let a;switch(r.forEach(((t,e)=>{if("number"!=typeof t)throw new Error(`expected vector component at index ${e} to have type "number"`)})),r.length){case 2:a=(new i.Vector2).fromArray(r);break;case 3:a=(new n.Vector3).fromArray(r);break;case 4:a=(new s.Vector4).fromArray(r);break;default:throw new Error("too many arguments")}return e.args.every((t=>t instanceof o.NumberLiteralExpr))&&(e._value=a),a}},vector2:{call:(t,e)=>a(t,e,"vector2")},vector3:{call:(t,e)=>a(t,e,"vector3")},vector4:{call:(t,e)=>a(t,e,"vector4")},"to-vector2":{call:(t,e)=>u(t,e,"vector2")},"to-vector3":{call:(t,e)=>u(t,e,"vector3")},"to-vector4":{call:(t,e)=>u(t,e,"vector4")}};e.VectorOperators=l},6463:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(4992),e),n(r(5337),e),n(r(197),e),n(r(9172),e),n(r(5200),e),n(r(8154),e),n(r(9246),e),n(r(5681),e),n(r(7314),e),n(r(4954),e),n(r(173),e),n(r(34),e),n(r(7250),e),n(r(5177),e),n(r(4713),e),n(r(9276),e),n(r(5704),e),n(r(7427),e),n(r(9206),e)},4342:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(6463),e),n(r(5323),e)},7427:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5681:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7314:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContextLogger=void 0,e.ContextLogger=class{constructor(t,e){this.m_logger=t,this.headerMessage=e,this.context=[],this.m_headerLogged=!1,this.warn=this.createLogMethod("warn"),this.info=this.createLogMethod("info"),this.error=this.createLogMethod("error")}pushAttr(t){this.context.push(`${this.context.length>0?".":""}${t}`)}pushIndex(t){this.context.push(`[${t}]`)}pop(){this.context.pop()}createLogMethod(t){return(e,...r)=>{this.m_headerLogged||(this.m_logger.info(this.headerMessage),this.m_headerLogged=!0),this.m_logger[t](`${this.context.join("")}: ${e}`,...r)}}}},4992:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DOMUtils=void 0,function(t){function e(t){return t.substring(0,2)}t.getBrowserLanguages=function(){if(void 0!==navigator.languages&&navigator.languages.length>0){const t=[];for(const r of navigator.languages)t.push(e(r));return t}if(void 0!==navigator.language)return[e(navigator.language)]}}(e.DOMUtils||(e.DOMUtils={}))},9276:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.chainCallbacks=void 0,e.chainCallbacks=function(t,e){return function(...r){return t&&t.apply(this,r),e.apply(this,r)}}},9206:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.convertFragmentShaderToWebGL2=e.convertVertexShaderToWebGL2=void 0,e.convertVertexShaderToWebGL2=function(t){return["#define attribute in","#define varying out","#define texture2D texture"].join("\\n")+"\\n"+t},e.convertFragmentShaderToWebGL2=function(t){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"+t}},5337:(t,e)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.GroupedPriorityList=e.PriorityListGroup=void 0;class r{constructor(t,e,r=new Array){this.priority=t,this.zOrder=e,this.elements=r}}e.PriorityListGroup=r,e.GroupedPriorityList=class{constructor(){this.groups=new Map}getGroupKey(t){return`${t.priority}_${t.zOrder}`}add(t){this.getGroup(t).elements.push(t)}clear(){this.groups.clear()}forEachElement(t){this.forEachGroup((e=>{e.elements.forEach(t)}))}forEachGroup(t){for(const[,e]of this.groups)t(e)}count(){let t=0;for(const[,e]of this.groups)t+=e.elements.length;return t}findGroup(t){return this.groups.get(t)}getGroup(t){const e=this.getGroupKey(t);let i=this.findGroup(e);return void 0===i&&(i=new r(t.priority,t.zOrder),this.groups.set(e,i)),i}}},4015:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConsoleChannel=void 0,e.ConsoleChannel=class{error(t,...e){console.error(t,...e)}debug(t,...e){console.debug(t,...e)}info(t,...e){console.info(t,...e)}log(t,...e){console.log(t,...e)}trace(t,...e){console.trace(t,...e)}warn(t,...e){console.warn(t,...e)}}},3140:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6781:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.LoggerOptions=e.LogLevel=void 0,(r=e.LogLevel||(e.LogLevel={}))[r.Trace=0]="Trace",r[r.Debug=1]="Debug",r[r.Log=2]="Log",r[r.Info=3]="Info",r[r.Warn=4]="Warn",r[r.Error=5]="Error",r[r.None=6]="None",e.LoggerOptions=class{}},8648:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Logger=void 0;const i=r(6781);e.Logger=class{constructor(t,e,r){this.name=t,this.m_channel=e,this.enabled=!0,this.level=i.LogLevel.Trace,void 0!==r&&this.update(r)}error(t,...e){this.enabled&&this.level<=i.LogLevel.Error&&this.m_channel.error(this.prefix,t,...e)}debug(t,...e){this.enabled&&this.level<=i.LogLevel.Debug&&this.m_channel.debug(this.prefix,t,...e)}info(t,...e){this.enabled&&this.level<=i.LogLevel.Info&&this.m_channel.info(this.prefix,t,...e)}log(t,...e){this.enabled&&this.level<=i.LogLevel.Log&&this.m_channel.log(this.prefix,t,...e)}trace(t,...e){this.enabled&&this.level<=i.LogLevel.Trace&&this.m_channel.trace(this.prefix,t,...e)}warn(t,...e){this.enabled&&this.level<=i.LogLevel.Warn&&this.m_channel.warn(this.prefix,t,...e)}update(t){this.enabled=void 0===t.enabled?this.enabled:t.enabled,this.level=void 0===t.level?this.level:t.level}get prefix(){return this.name+":"}}},6562:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LoggerManager=void 0;const i=r(2531);e.LoggerManager=class{static get instance(){return this.m_instance||(this.m_instance=new i.LoggerManagerImpl)}}},2531:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LoggerManagerImpl=void 0;const i=r(4015),n=r(8648),s=r(7698);e.LoggerManagerImpl=class{constructor(){this.m_loggers=[],this.channel="undefined"==typeof self||void 0!==self.document?new i.ConsoleChannel:new s.WorkerChannel}getLoggerNames(){return this.m_loggers.map((t=>t.name))}getLogger(t){return this.m_loggers.find((e=>e.name===t))}create(t,e={}){void 0!==this.m_levelSetForAll&&(void 0===e.level||e.level<this.m_levelSetForAll)&&(e.level=this.m_levelSetForAll);const r=new n.Logger(t,this.channel,e);return this.m_loggers.push(r),r}dispose(t){const e=this.m_loggers.indexOf(t);if(e<0)throw new Error(`Cannot unregister "${t}" : no such logger registered.`);this.m_loggers.splice(e,1)}updateAll(t){for(const e of this.m_loggers)e.update(t)}update(t,e){for(const r of this.m_loggers)r.name===t&&r.update(e)}enableAll(t){for(const e of this.m_loggers)e.enabled=t}enable(t,e){this.update(t,{enabled:e})}setLogLevelForAll(t){this.m_levelSetForAll=t;for(const e of this.m_loggers)e.level=t}setLogLevel(t,e){this.update(t,{level:e})}setChannel(t){this.channel=t}}},3069:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MultiChannel=void 0,e.MultiChannel=class{constructor(...t){this.channels=[],this.channels=t}error(t,...e){for(const r of this.channels)r.error(t,...e)}debug(t,...e){for(const r of this.channels)r.debug(t,...e)}info(t,...e){for(const r of this.channels)r.info(t,...e)}log(t,...e){for(const r of this.channels)r.log(t,...e)}trace(t,...e){for(const r of this.channels)r.trace(t,...e)}warn(t,...e){for(const r of this.channels)r.warn(t,...e)}}},7698:(t,e,r)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerChannel=e.WORKERCHANNEL_MSG_TYPE=void 0;const i=r(6781);e.WORKERCHANNEL_MSG_TYPE="worker-channel-message",e.WorkerChannel=class{error(t,...r){const n={message:[t,...r],type:e.WORKERCHANNEL_MSG_TYPE,level:i.LogLevel.Error};self.postMessage(n)}debug(t,...r){const n={message:[t,...r],type:e.WORKERCHANNEL_MSG_TYPE,level:i.LogLevel.Debug};self.postMessage(n)}info(t,...r){const n={message:[t,...r],type:e.WORKERCHANNEL_MSG_TYPE,level:i.LogLevel.Info};self.postMessage(n)}log(t,...r){const n={message:[t,...r],type:e.WORKERCHANNEL_MSG_TYPE,level:i.LogLevel.Log};self.postMessage(n)}trace(t,...r){const n={message:[t,...r],type:e.WORKERCHANNEL_MSG_TYPE,level:i.LogLevel.Trace};self.postMessage(n)}warn(t,...r){const n={message:[t,...r],type:e.WORKERCHANNEL_MSG_TYPE,level:i.LogLevel.Warn};self.postMessage(n)}}},197:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(4015),e),n(r(3140),e),n(r(6781),e),n(r(8648),e),n(r(6562),e),n(r(3069),e),n(r(7698),e)},9172:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Math2D=void 0,function(t){function e(t,e,r,i){return(t-r)*(t-r)+(e-i)*(e-i)}t.Box=class{constructor(t=0,e=0,r=0,i=0){this.x=t,this.y=e,this.w=r,this.h=i}set(t,e,r,i){this.x=t,this.y=e,this.w=r,this.h=i}copy(t){this.x=t.x,this.y=t.y,this.w=t.w,this.h=t.h}contains(t,e){return this.x<=t&&this.x+this.w>=t&&this.y<=e&&this.y+this.h>=e}containsBox(t){const e=t.x+t.w,r=t.y+t.h;return this.contains(t.x,t.y)&&this.contains(e,t.y)&&this.contains(t.x,r)&&this.contains(e,r)}intersects(t){return this.x<=t.x+t.w&&this.x+this.w>=t.x&&this.y<=t.y+t.h&&this.y+this.h>=t.y}},t.distSquared=e,t.computeSquaredLineLength=function(t){let e=0;const r=t.length-4;for(let i=0;i<r;i+=3){const r=t[i+3]-t[i],n=t[i+4]-t[i+1];e+=r*r+n*n}return e},t.distToSegmentSquared=function(t,r,i,n,s,o){const a=e(i,n,s,o);if(0===a)return e(t,r,i,n);let u=((t-i)*(s-i)+(r-n)*(o-n))/a;return u=Math.max(0,Math.min(1,u)),e(t,r,i+u*(s-i),n+u*(o-n))},t.intersectLineAndCircle=function(t,e,r,i,n,s=0,o=0){const a=r-t,u=i-e,l=a*a+u*u,h=t*i-r*e-u*s+a*o,c=n*n*l-h*h;if(c<-1e-10)return;const d=h*u,p=-h*a;if(c<1e-10)return{x1:s+d/l,y1:o+p/l};const f=Math.sqrt(c),m=(u<0?-1:1)*a*f,y=Math.abs(u)*f;return{x1:s+(d+m)/l,y1:o+(p+y)/l,x2:s+(d-m)/l,y2:o+(p-y)/l}},t.intersectLines=function(t,e,r,i,n,s,o,a,u={x:0,y:0}){const l=(t-r)*(s-a)-(e-i)*(n-o);if(0===l)return;const h=((t*i-e*r)*(n-o)-(t-r)*(n*a-s*o))/l,c=((t*i-e*r)*(s-a)-(e-i)*(n*a-s*o))/l;return u.x=h,u.y=c,u}}(e.Math2D||(e.Math2D={}))},5200:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MathUtils=void 0,function(t){function e(t,e,r){return t<e?e:t>r?r:t}t.clamp=e,t.smoothStep=function(t,r,i){return(i=e((i-t)/(r-t),0,1))*i*(3-2*i)},t.smootherStep=function(t,r,i){return(i=e((i-t)/(r-t),0,1))*i*i*(i*(6*i-15)+10)},t.map=function(t,e,r,i,n){return(t-e)*(n-i)/(r-e)+i},t.min2=function(t,e){let r;return void 0!==t&&(r=t),void 0!==e&&(r=void 0===r?e:Math.min(r,e)),r},t.max2=function(t,e){let r;return void 0!==t&&(r=t),void 0!==e&&(r=void 0===r?e:Math.max(r,e)),r},t.isWithinBounds=function(t,e,r){return!(void 0!==e&&t<e||void 0!==r&&t>r)},t.easeInOutCubic=function(t,e,r){return t+(e-t)*(r<.5?4*r*r*r:(r-1)*(2*r-2)*(2*r-2)+1)}}(e.MathUtils||(e.MathUtils={}))},8154:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.applyMixinsWithoutProperties=e.applyMixins=void 0,e.applyMixins=function(t,e){e.forEach((e=>{Object.getOwnPropertyNames(e.prototype).forEach((r=>{t.prototype[r]=e.prototype[r]}))}))},e.applyMixinsWithoutProperties=function(t,e){e.forEach((e=>{Object.getOwnPropertyNames(e.prototype).forEach((r=>{const i=Object.getOwnPropertyDescriptor(e.prototype,r);void 0!==i&&void 0===i.get&&"constructor"!==r&&(t.prototype[r]=e.prototype[r])}))}))}},173:(t,e)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.pick=e.cloneDeep=void 0,e.cloneDeep=function(t){const e=new Map,r=function t(r){if(null===r)return null;if("object"==typeof r){const i=e.get(r);if(void 0!==i)return i;if(Array.isArray(r)){const i=[];e.set(r,i),i.length=r.length;for(let e=0;e<i.length;++e)i[e]=t(r[e]);return i}if(r instanceof Date){const t=new Date(r.getTime());return e.set(r,t),t}if(r instanceof RegExp){const t=new RegExp(r.source,r.flags);return e.set(r,t),t}if(r.constructor!==Object)throw new Error("cloneDeep doesn\'t support objects with custom prototypes");{const i={};e.set(r,i);for(const e in r)r.hasOwnProperty(e)&&(i[e]=t(r[e]));return i}}return r}(t);return e.clear(),r},e.pick=function(t,e){const r={};for(const i of e)t.hasOwnProperty(i)&&(r[i]=t[i]);return r}},34:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getOptionValue=void 0,e.getOptionValue=function(...t){for(const e of t)if(null!=e)return e}},4954:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PerformanceTimer=void 0;class r{static now(){return r.nowFunc()}static getNowFunc(){return"undefined"!=typeof performance&&void 0!==performance.now?()=>performance.now():()=>(new Date).getTime()}}e.PerformanceTimer=r,r.instance=new r,r.nowFunc=r.getNowFunc()},5704:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sampleBilinear=void 0,e.sampleBilinear=function(t,e,r,i,n){const s=e-1,o=r-1,a=i*s,u=Math.floor(a),l=n*o,h=Math.floor(l),c=h*e+u,d=u<s?c+1:c,p=h<o?c+e:c,f=u<s?p+1:p,m=t[c],y=t[d],g=t[p],x=t[f],v=Number.isInteger(a)?0:a-u,b=1-v,w=Number.isInteger(l)?0:l-h,_=1-w;return m*b*_+y*v*_+g*b*w+x*v*w}},7250:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TaskQueue=void 0,e.TaskQueue=class{constructor(t){var e;this.m_options=t,this.m_taskLists=new Map,null===(e=this.m_options.groups)||void 0===e||e.forEach((t=>{this.m_taskLists.set(t,[])})),this.m_options.prioSortFn&&(this.sort=this.m_options.prioSortFn)}update(t){if(void 0===t)this.m_taskLists.forEach((t=>{this.updateTaskList(t)}));else{const e=this.getTaskList(t);e&&this.updateTaskList(e)}}add(t){var e;if(this.m_taskLists.has(t.group)){const r=this.m_taskLists.get(t.group);if(!(null==r?void 0:r.includes(t)))return null===(e=this.m_taskLists.get(t.group))||void 0===e||e.push(t),!0}return!1}remove(t){var e,r;if(this.m_taskLists.has(t.group)){const i=null===(e=this.m_taskLists.get(t.group))||void 0===e?void 0:e.indexOf(t);if(-1!==i)return null===(r=this.m_taskLists.get(t.group))||void 0===r||r.splice(i,1),!0}return!1}numItemsLeft(t){var e,r;let i=0;return void 0===t?this.m_taskLists.forEach((t=>{i+=t.length})):i+=null!==(r=null===(e=this.getTaskList(t))||void 0===e?void 0:e.length)&&void 0!==r?r:0,i}processNext(t,e,r=1){if(!this.getTaskList(t)||this.numItemsLeft(t)<=0)return!1;for(let i=0;i<r&&this.numItemsLeft(t)>0;i++){const r=this.pull(t,!0);void 0!==r&&(!e||(null==e?void 0:e(r))?r.execute():this.add(r))}return!0}clear(){this.m_taskLists.clear()}pull(t,e=!1){var r,i;let n;return this.getTaskList(t)&&(n=null===(r=this.getTaskList(t))||void 0===r?void 0:r.pop(),e&&n&&(null===(i=n.isExpired)||void 0===i?void 0:i.call(n)))?this.pull(t,e):n}sort(t,e){return e.getPriority()-t.getPriority()}getTaskList(t){return this.m_taskLists.get(t)}updateTaskList(t){var e;for(let r=0;r<t.length;r++){const i=t[r];(null===(e=null==i?void 0:i.isExpired)||void 0===e?void 0:e.call(i))&&(t.splice(r,1),r--)}t.sort(this.sort)}}},5177:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5323:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getAppBaseUrl=void 0;const i=r(4713);e.getAppBaseUrl=function(){return"undefined"==typeof window?`file://${process.cwd()}/`:(0,i.baseUrl)(window.location.href)}},4713:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getUrlHostAndProtocol=e.getUrlOrigin=e.baseUrl=e.resolveReferenceUri=void 0,e.resolveReferenceUri=function(t,e){return r.test(e)?e:e.startsWith("/")?n(t)+e:(e.startsWith("./")&&(e=e.substr(2)),i(t)+e)};const r=new RegExp("^(((?:[a-z]+:)?//)|(file:/)|(data:))","i");function i(t){if(void 0===t)return"./";let e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),e=t.indexOf("?"),-1!==e&&(t=t.slice(0,e)),e=t.lastIndexOf("/"),-1===e?"./":t.substring(0,e+1)}function n(t){if(void 0===t)return"";const e=s(t);return"file:"===e.protocol?"file://":e.host&&e.protocol?e.protocol+"//"+e.host:e.host?"//"+e.host:e.protocol?e.protocol+"//":""}function s(t){const e=new RegExp(/^(?:([a-z]+:))?\\/\\/([^\\/]*)/,"i"),r=t.match(e);if(!r)throw new Error(`getUrlHostAndProtocol: unable to parse URL \'${t}\'`);return{protocol:r[1],host:r[2]}}e.baseUrl=i,e.getUrlOrigin=n,e.getUrlHostAndProtocol=s},9246:(t,e)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.assertExists=e.assert=void 0,e.assert=function(t,e){},e.assertExists=function(t,e){return t}},952:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(1503),e),n(r(6133),e),n(r(9959),e),n(r(5863),e)},9287:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.computeLineAnchorPoints=e.MAX_SEARCH_DEPTH=void 0;const i=r(6815),n=new i.Vector3,s=new i.Vector3;e.MAX_SEARCH_DEPTH=3,e.computeLineAnchorPoints=function(t,r){if(t.count<2)return(new Float64Array).buffer;const i=function(t){const e=[];let r=0;for(let i=0;i<t.count-1;++i)r+=n.fromBufferAttribute(t,i).distanceTo(s.fromBufferAttribute(t,i+1)),e.push(r);return e}(t);if(i[i.length-1]<=Number.EPSILON)return(new Float64Array).buffer;const o=function(t,r,i){const o=[],a=t[t.length-1],u=Math.min(e.MAX_SEARCH_DEPTH+1,Math.floor(Math.log2(a/r))),l=u>0?Math.pow(2,u):0,h=l+1,c=a/l;let d=0;for(let e=0;e<h;e++){const r=1===h?a/2:e*c;let u=t.length-1;for(;u!==d;){const e=Math.floor((u+d)/2);r>=t[e]?d=e+1:u=e}const l=t[d],p=1-(l-r)/(l-(0===d?0:t[d-1])),f=n.fromBufferAttribute(i,d).lerp(s.fromBufferAttribute(i,d+1),p);o.push(...f.toArray())}return o}(i,r,t);return new Float64Array(o).buffer}},5863:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},9252:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DecodeInfo=void 0;const i=r(2754),n=r(6815),s=r(2616);e.DecodeInfo=class{constructor(t,e,r=0){this.targetProjection=t,this.tileKey=e,this.storageLevelOffset=r,this.projectedBoundingBox=new s.OrientedBox3,this.tileBounds=new i.Box3,this.tileSize=new n.Vector3,this.center=new n.Vector3,this.geoBox=this.tilingScheme.getGeoBox(e),this.targetProjection.projectBox(this.geoBox,this.projectedBoundingBox),this.projectedBoundingBox.getCenter(this.center),this.tilingScheme.getWorldBox(e,this.tileBounds),this.tileBounds.getSize(this.tileSize),this.tileSizeOnScreen=256*Math.pow(2,-this.storageLevelOffset),this.columnCount=s.webMercatorTilingScheme.subdivisionScheme.getLevelDimensionX(this.tileKey.level),this.rowCount=s.webMercatorTilingScheme.subdivisionScheme.getLevelDimensionY(this.tileKey.level)}get tilingScheme(){return s.webMercatorTilingScheme}get sourceProjection(){return this.tilingScheme.projection}}},6133:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GeoJsonTilerService=void 0;const i=r(2626),n=r(9959);e.GeoJsonTilerService=class{static start(){i.WorkerServiceManager.getInstance().register({serviceType:n.GEOJSON_TILER_SERVICE_TYPE,factory:t=>i.TilerService.start(t)})}}},9959:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.GEOJSON_TILER_SERVICE_TYPE=e.VECTOR_TILE_DECODER_SERVICE_TYPE=e.OmvGeometryType=void 0,(r=e.OmvGeometryType||(e.OmvGeometryType={}))[r.UNKNOWN=0]="UNKNOWN",r[r.POINT=1]="POINT",r[r.LINESTRING=2]="LINESTRING",r[r.POLYGON=3]="POLYGON",e.VECTOR_TILE_DECODER_SERVICE_TYPE="vector-tile-decoder",e.GEOJSON_TILER_SERVICE_TYPE="geojson-tiler"},7305:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OmvPoliticalViewFeatureModifier=void 0,e.OmvPoliticalViewFeatureModifier=class{constructor(t){this.m_countryCode=t}doProcessPointFeature(t,e,r){return this.processFeature(t,e)}doProcessLineFeature(t,e,r){return this.processFeature(t,e)}doProcessPolygonFeature(t,e,r){return!0}rewriteEnvironment(t,e){this.isPoliticalViewLayer(t)&&this.updateEnvironment(e,this.m_countryCode,"kind")}updateEnvironment(t,e,r){const i=this.getAlternativePov(t,e,r);void 0!==i&&(t.entries[r]=i)}getAlternativePov(t,e,r){const i=e,n=t.lookup(`${r}:${i}`);return"string"==typeof n&&n.length>0?n:void 0}isPoliticalViewLayer(t){return"boundaries"===t||"places"===t}processFeature(t,e){let r=!1;if(this.isPoliticalViewLayer(t)){const i=Object.keys(e.unmap()).filter((t=>t.includes("kind:"))).length>0,n=!!e.lookup(`kind:${this.m_countryCode}`),s=!!e.lookup("kind"),o=Boolean(this.m_countryCode);r=!o&&!s&&i||o&&(!s&&i&&!n||s&&n),!r&&o&&n&&this.rewriteEnvironment(t,e)}return!r}}},6441:(t,e,r)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.webMercatorTile2TargetTile=e.webMercatorTile2TargetWorld=e.world2tile=e.tile2world=e.createWorldTileTransformationCookie=e.tile2lat=e.lat2tile=e.isArrayBufferLike=void 0;const i=r(6815),n=r(2616);function s(t,e){return Math.round((1-Math.log(Math.tan(t*Math.PI/180)+1/Math.cos(t*Math.PI/180))/Math.PI)/2*Math.pow(2,e))}function o(t,e){const{north:r,west:i}=e.geoBox,n=Math.log2(t),o=Math.pow(2,e.tileKey.level+n);return{extents:t,scale:o,top:s(r,e.tileKey.level+n),left:Math.round((i+180)/360*o)}}function a(t,e,r,i=!1,s){void 0!==e.worldTileProjectionCookie&&e.worldTileProjectionCookie.extents===t||(e.worldTileProjectionCookie=o(t,e));const{top:a,left:u,scale:l}=e.worldTileProjectionCookie,h=n.EarthConstants.EQUATORIAL_CIRCUMFERENCE;return s.x=(u+r.x)/l*h,s.y=(a+(i?-r.y:r.y))/l*h,s.z=(0,n.isVector3Like)(r)?r.z:0,s}function u(t,e,r,s,o,u=!1){a(t,e,r,u,s),e.targetProjection.reprojectPoint(n.webMercatorProjection,s,s),r instanceof i.Vector3&&o&&(s.z*=e.targetProjection.getScaleFactor(s))}e.isArrayBufferLike=function(t){return"undefined"!=typeof SharedArrayBuffer?t instanceof ArrayBuffer||t instanceof SharedArrayBuffer:t instanceof ArrayBuffer},e.lat2tile=s,e.tile2lat=function(t,e){const r=Math.PI-2*Math.PI*t/Math.pow(2,e);return 180/Math.PI*Math.atan(.5*(Math.exp(r)-Math.exp(-r)))},e.createWorldTileTransformationCookie=o,e.tile2world=a,e.world2tile=function(t,e,r,i=!1,s){void 0!==e.worldTileProjectionCookie&&e.worldTileProjectionCookie.extents===t||(e.worldTileProjectionCookie=o(t,e));const{top:a,left:u,scale:l}=e.worldTileProjectionCookie,h=n.EarthConstants.EQUATORIAL_CIRCUMFERENCE;return s.x=Math.round(r.x/h*l-u),s.y=Math.round((i?-1:1)*(r.y/h*l-a)),(0,n.isVector3Like)(s)&&(s.z=r.z),s},e.webMercatorTile2TargetWorld=u,e.webMercatorTile2TargetTile=function(t,e,r,i,n,s=!1){u(t,e,r,i,n,s),i.sub(e.center)}},627:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Ring=void 0;const i=r(9776);e.Ring=class{constructor(t,e,r=4096,n=!1){if(this.points=t,this.textureCoords=e,this.extents=r,this.hasClipInfo=n,void 0!==e&&e.length!==t.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!==e&&(this.vertexStride=this.vertexStride+2),this.area=i.ShapeUtils.area(this.points),this.winding=this.area<0}toArray(t=[],e=0){var r;return this.points.forEach(((r,i)=>r.toArray(t,e+this.vertexStride*i))),null===(r=this.textureCoords)||void 0===r||r.forEach(((r,i)=>r.toArray(t,e+this.vertexStride*i+2))),t}isProperEdge(t){const e=this.extents,r=(t+1)%this.points.length,i=this.points[t],n=this.points[r];if(this.hasClipInfo){if(i.x!==n.x&&i.y!==n.y)return!0;if(i.x%this.extents!=0&&i.y%this.extents!=0)return!0;if(n.x%this.extents!=0&&n.y%this.extents!=0)return!0;const t=!0===i.isClipped,e=!0===n.isClipped;return!t&&!e}return!(i.x<=0&&n.x<=0||i.x>=e&&n.x>=e||i.y<=0&&n.y<=0||i.y>=e&&n.y>=e)}}},1140:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VectorTileDataEmitter=void 0;const i=r(6782),n=r(9365),s=r(1405),o=r(9776),a=r(2754),u=r(3096),l=r(414),h=r(3334),c=r(5448),d=r(6815),p=r(8152),f=r(3561),m=r(2982),y=r(6525),g=r(6189),x=r(2616),v=r(4388),b=r(3711),w=r(5033),_=r(1984),M=r(4342),E=r(9287),T=r(6441),S=r(627),A=M.LoggerManager.instance.create("OmvDecodedTileEmitter"),z=new d.Vector3,P=new d.Vector3,L=new d.Vector3,O=new d.Vector3,C=new c.Vector2,k=new c.Vector2,j=new d.Vector3,V=new d.Vector3,I=new d.Vector3,R=new c.Vector2,B=new c.Vector2,q=new c.Vector2,N=new d.Vector3,D=new d.Vector3,F=new d.Vector3,G=new d.Vector3,U=new d.Vector3,W=new l.Line3,$=Math.PI/8;function H(t,e,r="index"){const i=e>65535?"uint32":"uint16";return{itemCount:1,name:r,buffer:("uint32"===i?new Uint32Array(t):new Uint16Array(t)).buffer,type:i}}class X{constructor(t){this.type=t,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
2dImageTextures=[],this.featureStarts=[],this.edgeFeatureStarts=[],this.objInfos=[],this.offsetDirections=[]}addText(t){let e=this.stringCatalog.indexOf(t);return e<0&&(e=this.stringCatalog.length,this.stringCatalog.push(t)),e}}var Y;!function(t){t[t.Simple=0]="Simple",t[t.Complex=1]="Complex"}(Y||(Y={}));const K=new u.Color;e.VectorTileDataEmitter=class{constructor(t,e,r={}){var i,n,s;this.m_decodeInfo=t,this.m_styleSetEvaluator=e,this.m_options=r,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=r.gatherFeatureAttributes)&&void 0!==i&&i,this.m_options.skipShortLabels=null===(n=r.skipShortLabels)||void 0===n||n,this.m_options.enableElevationOverlay=null!==(s=r.enableElevationOverlay)&&void 0!==s&&s}get projection(){return this.m_decodeInfo.targetProjection}get center(){return this.m_decodeInfo.center}processPointFeature(t,e,r,i,n){var s;const o=i.env;this.processFeatureCommon(o);const{tileKey:a,columnCount:u,rowCount:l}=this.m_decodeInfo,h=a.column+1<u?e-1:e,c=a.row+1<l?e-1:e,d=r.filter((t=>t.x>=0&&t.x<=h&&t.y>=0&&t.y<=c));if(0!==d.length)for(const t of n){if(void 0===t)continue;const r=t._index,n=this.findOrCreateMeshBuffers(r,p.GeometryType.Point);if(void 0===n)continue;const{positions:a,texts:u,imageTextures:l,textBackgroundImageTextures:h,objInfos:c,offsetDirections:m}=n,y=(0,_.isTextTechnique)(t)||(0,_.isIconTextTechnique)(t);let g,v;const b=(0,_.isIconTextTechnique)(t);if(b){const e=t;g=(0,f.evaluateTechniqueAttr)(i,e.imageTexture),void 0!==e["background-image"]&&(v=(0,f.evaluateTechniqueAttr)(i,e["background-image"]))}const w=(0,p.scaleHeight)(i,t,this.m_decodeInfo.tileKey.level),M=(0,p.getFeatureId)(o.entries);for(const r of d){if(y){const e=t,r=(0,p.getFeatureText)(i,e,this.m_options.languages);void 0!==r?u.push(n.addText(r)):u.push(-1)}y?(0,T.webMercatorTile2TargetWorld)(e,this.m_decodeInfo,r,j,w):(0,T.webMercatorTile2TargetTile)(e,this.m_decodeInfo,r,j,w);const d=this.projection.type===x.ProjectionType.Planar?j.z:r.z;d>this.m_maxGeometryHeight?this.m_maxGeometryHeight=d:d<this.m_minGeometryHeight&&(this.m_minGeometryHeight=d),a.push(j.x,j.y,j.z),c.push(this.m_options.gatherFeatureAttributes?o.entries:M),m.push(null!==(s=o.lookup("offset_direction"))&&void 0!==s?s:0),b&&(void 0===g?l.push(-1):l.push(n.addText(g)),void 0===v?h.push(-1):h.push(n.addText(v)))}}}processLineFeature(t,e,r,i,s){var o;const a=i.env;this.processFeatureCommon(a);const u=[],l=[],h=[],c=[],m=this.m_decodeInfo.projectedBoundingBox;let y;const g=2*m.extents.x,x=2*m.extents.y,v=Math.max(g,x);let w,S;const z=void 0!==r[0].untiledPositions,P=!1;let L=!1,O=!1;for(const t of s)if(void 0!==t){if(w){const e=this.getTextureCoordinateType(t);(0,M.assert)(void 0===e||S===e)}else w=this.getComputeTexCoordsFunc(t),S=this.getTextureCoordinateType(t);L=L||(0,_.isSpecialDashesLineTechnique)(t),O=O||!L}for(const t of r){const r=[];let i=0;if(z&&(this.m_decodeInfo.targetProjection.projectPoint(t.untiledPositions[0],V),t.untiledPositions.forEach((t=>{this.m_decodeInfo.targetProjection.projectPoint(t,j),i+=j.distanceTo(V),V.copy(j),this.m_decodeInfo.targetProjection.projectPoint(t.normalized(),j),r.push(j.x,j.y,j.z,i)}))),L){y=[];let n=0;const s=t.positions.length;if(s>1){let o=0;for(let a=0;a<s-1;a++){const s=[],u=[],d=[],p=[],f=t.positions[a],m=t.positions[a+1];if((0,T.webMercatorTile2TargetWorld)(e,this.m_decodeInfo,f,j,P),u.push(j.x,j.y,j.z),(0,T.webMercatorTile2TargetWorld)(e,this.m_decodeInfo,m,I,P),u.push(I.x,I.y,I.z),w&&(w(f,e).toArray(d,d.length),w(m,e).toArray(d,d.length)),z){let t=this.findRelativePositionInLine(j,r)/i;p.push(t),t=this.findRelativePositionInLine(I,r)/i,p.push(t)}else{p.push(o);const t=j.distanceTo(I);n+=t,o+=t,p.push(o)}j.sub(this.m_decodeInfo.center),s.push(j.x,j.y,j.z),I.sub(this.m_decodeInfo.center),s.push(I.x,I.y,I.z),y.push(s),l.push(u),h.push(d),c.push(p)}}if(!z&&n>0)for(const t of c)t.forEach(((e,r)=>{t[r]=e/n}))}if(O){const n=[],s=[],o=[],a=[];t.positions.forEach((t=>
2{if((0,T.webMercatorTile2TargetWorld)(e,this.m_decodeInfo,t,j,P),s.push(j.x,j.y,j.z),w&&w(t,e).toArray(o,o.length),z){const t=this.findRelativePositionInLine(j,r)/i;a.push(t)}j.sub(this.m_decodeInfo.center),n.push(j.x,j.y,j.z)})),u.push(n),l.push(s),h.push(o),c.push(a)}}const C=this.m_decodeInfo.tileKey.level>=11;for(const t of s){if(void 0===t)continue;const e=t._index,r=t.name;if((0,_.isLineTechnique)(t)||(0,_.isSolidLineTechnique)(t)){const r=(0,_.isLineTechnique)(t)?this.m_simpleLines:this.m_solidLines,n=(0,_.isLineTechnique)(t)?Y.Simple:Y.Complex;L&&((0,M.assert)(void 0!==y,"OmvDecodedTileEmitter#processLineFeature: Internal error - No localLineSegments"),this.applyLineTechnique(r,t,e,n,a.entries,y,i,this.getTextureCoordinateType(t)?h:void 0,c)),u.length>0&&this.applyLineTechnique(r,t,e,n,a.entries,u,i,this.getTextureCoordinateType(t)?h:void 0,z?c:void 0)}else if((0,_.isTextTechnique)(t)||(0,_.isIconTextTechnique)(t)||(0,_.isLineMarkerTechnique)(t)){const r=t,s=(0,p.getFeatureText)(i,r,this.m_options.languages);if(void 0===s&&!(0,_.isIconTextTechnique)(t)&&!(0,_.isLineMarkerTechnique)(t))continue;if((0,_.isTextTechnique)(t)){let t=[];if(this.m_options.skipShortLabels){const e=v/this.m_decodeInfo.tileSizeOnScreen,r=5*String(s).length*e*.5,i=r*r;t=this.splitJaggyLines(l,i,$)}else t=l;if(0===t.length)continue;for(const r of t){const t=M.Math2D.computeSquaredLineLength(r);this.m_textPathGeometries.push({technique:e,path:r,pathLengthSqr:t,text:String(s),objInfos:this.m_options.gatherFeatureAttributes?a.entries:(0,p.getFeatureId)(a.entries)})}}else{const r=t,u=(0,f.evaluateTechniqueAttr)(i,r.imageTexture),h=Math.max(Number.EPSILON,null!==(o=(0,f.evaluateTechniqueAttr)(i,r["anchor-point-density"]))&&void 0!==o?o:20),c=this.m_decodeInfo.projectedBoundingBox.extents,d=2*Math.min(c.x,c.y)/h,m=new n.BufferAttribute(new Float64Array,3);for(const t of l)m.array=t,m.count=t.length/m.itemSize,this.m_iconTextGeometries.push({technique:e,positions:{name:"position",type:"float",buffer:(0,E.computeLineAnchorPoints)(m,d),itemCount:m.itemSize},texts:[0],stringCatalog:[s,u],imageTextures:[1],objInfos:this.m_options.gatherFeatureAttributes?[a.entries]:[(0,p.getFeatureId)(a.entries)]})}}else if((0,_.isLabelRejectionLineTechnique)(t))for(const t of l){const e=[];for(let r=0;r<t.length;r+=3)e.push((new d.Vector3).fromArray(t,r));this.m_pathGeometries.push({path:e})}else if((0,_.isExtrudedLineTechnique)(t)){const r=this.findOrCreateMeshBuffers(e,p.GeometryType.ExtrudedLine);if(void 0===r)continue;const{positions:n,indices:s,groups:o,featureStarts:l,objInfos:h}=r,c=s.length,d=(0,f.evaluateTechniqueAttr)(i,t.width);if(void 0===d)continue;const m=(0,f.evaluateTechniqueAttr)(i,t.cap,"Circle"),y=C&&"Circle"===m;u.forEach((t=>{(0,b.triangulateLine)(t,d,n,s,y),l.push(c),h.push(this.m_options.gatherFeatureAttributes?a.entries:(0,p.getFeatureId)(a.entries))}));const g=s.length-c;o.push({start:c,count:g,technique:e})}else A.warn(`OmvDecodedTileEmitter#processLineFeature: Invalid line technique\\n ${r} for layer: ${a.entries.$layer} `)}}processPolygonFeature(t,e,r,i,n){const s=i.env;this.processFeatureCommon(s);const u=!1;n.forEach((t=>{if(void 0===t)return;const n=t._index;if(void 0===n)throw new Error("OmvDecodedTileEmitter#processPolygonFeature: Internal error - No technique index");let l;const h=s.lookup("bbox");if(Array.isArray(h)){const[t,e,r,i]=h,n=new x.GeoBox(new x.GeoCoordinates(e,t),new x.GeoCoordinates(i,r));l=new a.Box3,x.webMercatorProjection.projectBox(n,l)}const c=[],d=(0,_.isExtrudedPolygonTechnique)(t),p=(0,_.isPolygonTechnique)(t),f=(0,_.isStandardTechnique)(t),y=d||p||f,g=this.getComputeTexCoordsFunc(t,l),v=y&&!d;for(const t of r){const r=[];for(let i=0;i<t.rings.length;i++){const n=0===i;let s=t.rings[i];v&&s.some((t=>t.x<0||t.x>e||t.y<0||t.y>e))&&(s=(0,m.clipPolygon)(s,e));const a=o.ShapeUtils.area(s);if(n&&0===a)break;if(0!==a){let t;void 0!==g&&(t=s.map((t=>g(t,e)))),r.push(new S.Ring(s,t,e,v))}}r.length>0&&c.push(r)}const b=(0,_.isSolidLineTechnique)(t)||(0,_.isLineTechnique)(t);if(y)this.applyPolygonTechnique(c,t,n,i,e);else if(b){const r="line"===t.name?this.m_simpleLines:this.m_solidLines,o="line"===t.name?Y.Simple:Y.Complex,a=(0,_.isSpecialDashesLineTechnique)(t);
2c.forEach((l=>{const h=[],c=a?[]:void 0;l.forEach((t=>{const r=t.points.length;let i=[],n=0,s=0,o=a?[]:void 0;for(let l=0;l<r;++l){a&&i.length>0&&(i=[],o=[]);const d=(l+1)%r,p=t.points[l],f=t.points[d],m=t.isProperEdge(l);if(m||0===i.length){if(m&&0===i.length&&((0,T.webMercatorTile2TargetTile)(e,this.m_decodeInfo,C.copy(p),j,u),i.push(j.x,j.y,j.z),a)){(0,T.webMercatorTile2TargetTile)(e,this.m_decodeInfo,C.copy(f),I,u),i.push(I.x,I.y,I.z),o.push(s);const t=j.distanceTo(I);n+=t,s+=t,o.push(s)}}else h.push(i),i=[];m&&!a&&((0,T.webMercatorTile2TargetTile)(e,this.m_decodeInfo,C.copy(f),j,u),i.push(j.x,j.y,j.z)),a&&i.length>0&&n>0&&(o.forEach(((t,e)=>{o[e]=t/n})),h.push(i),c.push(o))}!a&&i.length>0&&h.push(i)})),0!==h.length&&this.applyLineTechnique(r,t,n,o,s.entries,h,i,void 0,c)}))}}))}getDecodedTile(){this.createGeometries(),this.processSimpleLines(this.m_simpleLines),this.processLines(this.m_solidLines);const t={techniques:this.m_styleSetEvaluator.decodedTechniques,geometries:this.m_geometries,decodeTime:void 0};return this.m_textGeometries.length>0&&(t.textGeometries=this.m_textGeometries),this.m_iconTextGeometries.length>0&&(t.iconTextGeometries=this.m_iconTextGeometries),this.m_textPathGeometries.length>0&&(t.textPathGeometries=this.m_textPathGeometries),this.m_pathGeometries.length>0&&(t.pathGeometries=this.m_pathGeometries),0!==this.m_sources.length&&(t.copyrightHolderIds=this.m_sources),t.maxGeometryHeight=this.m_maxGeometryHeight,t.minGeometryHeight=this.m_minGeometryHeight,t}splitJaggyLines(t,e,r){const i=[],n=(t,e,r)=>{let i=Number.MAX_SAFE_INTEGER,n=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;for(let a=e;a<r;a+=3){const e=t[a],r=t[a+1];e<i&&(i=e),e>n&&(n=e),r<s&&(s=r),r>o&&(o=r)}return(n-i)*(n-i)+(o-s)*(o-s)},s=t.slice();for(;s.length>0;){const t=s.pop();if(void 0===t||t.length<6)continue;let o=-1;for(let e=0;e<t.length-3;e+=3){R.set(t[e],t[e+1]),B.set(t[e+3],t[e+4]);const i=B.sub(R).normalize();if(e>0){const t=Math.atan2(q.x*i.y-i.x*q.y,i.dot(q));if(Math.abs(t)>r){o=e;break}}q.set(i.x,i.y)}if(o>0){const r=n(t,0,o+3),a=n(t,o,t.length);r>e&&i.push(t.slice(0,o+3)),a>e&&s.push(t.slice(o))}else n(t,0,t.length)>e&&i.push(t)}return i}getTextureCoordinateType(t){return((0,_.isPolygonTechnique)(t)||(0,_.isSolidLineTechnique)(t)||(0,_.isExtrudedPolygonTechnique)(t))&&this.m_options.enableElevationOverlay?_.TextureCoordinateType.TileSpace:(0,_.textureCoordinateType)(t)}getComputeTexCoordsFunc(t,e){switch(this.getTextureCoordinateType(t)){case _.TextureCoordinateType.TileSpace:return(t,e)=>{const r=t.clone().divideScalar(e);return r.y=1-r.y,r};case _.TextureCoordinateType.EquirectangularSpace:return(t,e)=>{const r=(0,T.tile2world)(e,this.m_decodeInfo,t,!1,V),i=x.normalizedEquirectangularProjection.reprojectPoint(x.webMercatorProjection,r);return new c.Vector2(i.x,i.y)};case _.TextureCoordinateType.FeatureSpace:if(!e)return;return(t,r)=>{const i=(0,T.tile2world)(r,this.m_decodeInfo,t,!1,V),n=new c.Vector2(i.x,i.y);return e&&(n.x-=e.min.x,n.y-=e.min.y,n.x/=e.max.x-e.min.x,n.y/=e.max.y-e.min.y),n.y=1-n.y,n};default:return}}applyLineTechnique(t,e,r,i=Y.Complex,n,s,o,a,u){let l;const h=t.find((t=>t.technique===r)),c=void 0!==a;if(void 0===h){l=new v.LineGroup(c,void 0,i===Y.Simple);const e={type:i===Y.Complex?p.GeometryType.SolidLine:p.GeometryType.Line,technique:r,lines:l};this.m_options.gatherFeatureAttributes&&(e.objInfos=[n],e.featureStarts=[0]),t.push(e)}else l=h.lines,this.m_options.gatherFeatureAttributes&&h.objInfos&&h.featureStarts&&(h.objInfos.push(n),h.featureStarts.push(l.indices.length));let d=0;s.forEach((t=>{l.add(this.m_decodeInfo.center,t,this.projection,u?u[d]:void 0,a?a[d]:void 0),d++}))}applyPolygonTechnique(t,e,r,o,a){var u,l;if(0===t.length)return;const c=(0,_.isExtrudedPolygonTechnique)(e),d=c?p.GeometryType.ExtrudedPolygon:p.GeometryType.Polygon,m=this.findOrCreateMeshBuffers(r,d);if(void 0===m)return;const v=e,b=e,E=!0===v.boundaryWalls,S=(0,_.isPolygonTechnique)(e),I=this.getTextureCoordinateType(e);let R=(0,f.evaluateTechniqueAttr)(o,v.height),B=(0,f.evaluateTechniqueAttr)(o,v.floorHeight);if(void 0===R){const t=o.env.lookup("height"),e=(0,f.evaluateTechniqueAttr)(o,v.defaultHeight);R=void 0!==t?t:void 0!==e?e:0}if(void 0===B){const t=o.env.lookup("min_height");B=void 0===t||S?0:t}R=Math.max(B+w.ExtrusionFeatureDefs.MIN_BUILDING_HEIGHT,R);const q=this.m_decodeInfo.tileKey.level,N=c&&(0,p.scaleHeight)(o,v,q);this.m_decodeInfo.tileBounds.getCenter(z);const{positions:D,normals:F,textureCoordinates:G,colors:U,extrusionAxis:W,indices:$,edgeIndices:X,groups:Y}=m,Z=this.m_decodeInfo.targetProjection.type===x.ProjectionType.Spherical,J=c?null!==(u=v.lineWidth)&&void 0!==u?u:0:S&&null!==(l=b.lineWidth)&&void 0!==l?l:0,Q="number"!=typeof J||J>0;let tt;if((0,_.isExtrudedPolygonTechnique)(e)&&(0,M.getOptionValue)(e.vertexColors,!1)){let t=(0,f.evaluateTechniqueAttr)(o,e.color);
2if(void 0===t){const e=o.env.lookup("color");this.isColorStringValid(e)&&(t=String(e))}void 0===t&&(t=(0,f.evaluateTechniqueAttr)(o,e.defaultColor,0)),void 0===t&&(t=0),K.set(t),tt=K}for(const e of t){const t=$.length,u=X.length,l=[],d=D.length/3,p=e[0],f=p.vertexStride,b=f+2;for(let t=0;t<p.points.length;++t){const e=p.points[t];l.push(e.x,-e.y),void 0!==p.textureCoords&&l.push(p.textureCoords[t].x,p.textureCoords[t].y);const r=(t+1)%p.points.length,i=p.isProperEdge(t);l.push(i?r:-1,E||i?r:-1)}const w=[];let _=1;for(;_<e.length;){const t=l.length/b;w.push(t);const r=e[_++];for(let e=0;e<r.points.length;++e){const i=(e+1)%r.points.length,n=r.points[e];l.push(n.x,-n.y),void 0!==r.textureCoords&&l.push(r.textureCoords[e].x,r.textureCoords[e].y);const s=r.isProperEdge(e);l.push(s?t+i:-1,E||s?t+i:-1)}}try{const t=i.Earcut.triangulate(l,w,b),e=l.length/b;if(Z){const e=new s.BufferGeometry,r=[],i=[],o=[],u=[];for(let t=0;t<l.length;t+=b){const e=(0,T.tile2world)(a,this.m_decodeInfo,C.set(l[t],l[t+1]),!0,V);r.push(e.x,e.y,0),void 0!==I&&i.push(l[t+2],l[t+3]),o.push(l[t+f]),u.push(l[t+f+1])}const c=new n.BufferAttribute(new Float32Array(r),3);let d;e.setAttribute("position",c),void 0!==I&&(d=new n.BufferAttribute(new Float32Array(i),2),e.setAttribute("uv",d));const p=new n.BufferAttribute(new Float32Array(o),1);e.setAttribute("edge",p);const m=new n.BufferAttribute(new Float32Array(u),1);e.setAttribute("wall",p);const v=H(t,c.count-1),w="uint32"===v.type?new n.Uint32BufferAttribute(v.buffer,1):new n.Uint16BufferAttribute(v.buffer,1);e.setIndex(w);const _=this.m_decodeInfo.tileKey.level;if(_>=3&&_<9){const t=Math.pow(2,9-_),{geoBox:r}=this.m_decodeInfo;new y.EdgeLengthGeometrySubdivisionModifier(t,r,y.SubdivisionMode.NoDiagonals,x.webMercatorProjection).modify(e)}new g.SphericalGeometrySubdivisionModifier((0,h.degToRad)(10),x.webMercatorProjection).modify(e),l.length=0,t.length=0;for(let t=0;t<c.array.length;t+=3){const e=(0,T.world2tile)(a,this.m_decodeInfo,j.set(c.array[t],c.array[t+1],0),!0,k);l.push(e.x,e.y),void 0!==I&&(l.push(d.array[t/3*2]),l.push(d.array[t/3*2+1])),l.push(p.array[t/3]),l.push(m.array[t/3])}const M=e.getIndex();null!==M&&t.push(...M.array)}P.set(0,0,1);for(let t=0;t<l.length;t+=b){(0,T.webMercatorTile2TargetWorld)(a,this.m_decodeInfo,C.set(l[t],l[t+1]),j,!1,!0);const e=N?this.m_decodeInfo.targetProjection.getScaleFactor(j):1;this.m_maxGeometryHeight=Math.max(this.m_maxGeometryHeight,e*R),this.m_minGeometryHeight=Math.min(this.m_minGeometryHeight,e*R),Z&&P.set(j.x,j.y,j.z).normalize(),j.sub(this.center),L.copy(P).multiplyScalar(B*e),D.push(j.x+L.x,j.y+L.y,j.z+L.z),void 0!==I&&G.push(l[t+2],l[t+3]),this.m_options.enableElevationOverlay&&F.push(...P.toArray()),c&&(O.copy(P).multiplyScalar(R*e),D.push(j.x+O.x,j.y+O.y,j.z+O.z),W.push(0,0,0,0,O.x-L.x,O.y-L.y,O.z-L.z,1),void 0!==I&&G.push(l[t+2],l[t+3]),this.m_options.enableElevationOverlay&&F.push(...P.toArray()),void 0!==tt&&U.push(tt.r,tt.g,tt.b,tt.r,tt.g,tt.b))}for(let e=0;e<t.length;e+=3)if(c){const r=d+2*t[e+0]+1,i=d+2*t[e+1]+1,n=d+2*t[e+2]+1;$.push(r,i,n)}else{const r=d+t[e+0],i=d+t[e+1],n=d+t[e+2];$.push(r,i,n)}Q&&this.addEdges(d,e,b,f,D,l,X,c,v.footprint,v.maxSlope),c&&this.addWalls(d,e,b,f,l,$)}catch(t){A.error("cannot triangulate geometry",t)}this.m_options.gatherFeatureAttributes&&(m.objInfos.push(o.env.entries),m.featureStarts.push(t),m.edgeFeatureStarts.push(u));const M=$.length-t;M>0&&Y.push({start:t,count:M,technique:r})}}createGeometries(){this.m_meshBuffers.forEach(((t,e)=>{if(0===t.positions.length)return;if(!this.m_styleSetEvaluator.techniques||this.m_styleSetEvaluator.techniques.length<=e)throw new Error("Invalid technique index");const r=this.m_styleSetEvaluator.techniques[e];if(void 0===r)return;if(t.texts.length>0){const i={positions:{name:"position",type:"float",buffer:new Float64Array(t.positions).buffer,itemCount:3},texts:t.texts,technique:e,stringCatalog:t.stringCatalog,objInfos:t.objInfos};if((0,_.isTextTechnique)(r))this.m_textGeometries.push(i);else{(0,M.assert)((0,_.isIconTextTechnique)(r));const e=i;
2e.imageTextures=t.imageTextures,e.textBackgroundImageTextures=t.textBackgroundImageTextures,e.offsetDirections=t.offsetDirections,this.m_iconTextGeometries.push(e)}return}const i=new Float32Array(t.positions);0===t.groups.length&&t.groups.push({start:0,count:i.length/3,technique:e});const n=[{name:"position",buffer:i.buffer,itemCount:3,type:"float"}],s={type:t.type,vertexAttributes:n,groups:t.groups};if(t.normals.length>0){const e=new Float32Array(t.normals);(0,M.assert)(e.length===i.length,"length of normals buffer is different than the length of the position buffer"),n.push({name:"normal",buffer:e.buffer,itemCount:3,type:"float"})}if(t.colors.length>0){const e=new Float32Array(t.colors);(0,M.assert)(e.length===i.length,"length of colors buffer is different than the length of the position buffer"),n.push({name:"color",buffer:e.buffer,itemCount:3,type:"float"})}const o=t.positions.length/3;if(t.textureCoordinates.length>0){const e=t.textureCoordinates.length/2;(0,M.assert)(e===o,"length of textureCoordinates buffer is different than the length of theposition buffer");const r=new Float32Array(t.textureCoordinates);n.push({name:"uv",buffer:r.buffer,itemCount:2,type:"float"})}if(t.extrusionAxis.length>0){const e=new Float32Array(t.extrusionAxis);(0,M.assert)(e.length/4==i.length/3,"length of extrusionAxis buffer is different than the length of the position buffer"),n.push({name:"extrusionAxis",buffer:e.buffer,itemCount:4,type:"float"})}t.indices.length>0&&(s.index=H(t.indices,o-1)),t.edgeIndices.length>0&&(s.edgeIndex=H(t.edgeIndices,o-1,"edgeIndex")),s.featureStarts=t.featureStarts,s.edgeFeatureStarts=t.edgeFeatureStarts,s.objInfos=t.objInfos,this.m_geometries.push(s)}))}processLines(t){t.forEach((t=>{const{vertices:e,indices:r}=t.lines,i=t.technique,n=new Float32Array(e).buffer,s=H(r,e.length/t.lines.stride-1),o={type:"float",stride:t.lines.stride,buffer:n,attributes:t.lines.vertexAttributes},a={type:p.GeometryType.SolidLine,index:s,interleavedVertexAttributes:[o],groups:[{start:0,count:r.length,technique:i}],vertexAttributes:[],featureStarts:t.featureStarts,objInfos:t.objInfos};this.m_geometries.push(a)}))}processSimpleLines(t){t.forEach((t=>{const{vertices:e,indices:r}=t.lines,i=t.technique,n={buffer:new Float32Array(e).buffer,itemCount:3,type:"float",name:"position"},s={type:p.GeometryType.Line,index:H(r,e.length/n.itemCount-1),vertexAttributes:[n],groups:[{start:0,count:r.length,technique:i}],featureStarts:t.featureStarts,objInfos:t.objInfos};this.m_geometries.push(s)}))}findOrCreateMeshBuffers(t,e){let r=this.m_meshBuffers.get(t);return void 0!==r?r.type!==e?void A.error(`MeshBuffer has been created with wrong type "${p.GeometryType[e]}"\\n instead of "${p.GeometryType[r.type]}"`):r:(r=new X(e),this.m_meshBuffers.set(t,r),r)}processFeatureCommon(t){const e=t.lookup("source");"string"==typeof e&&""!==e&&(this.m_sources.includes(e)||this.m_sources.push(e))}isColorStringValid(t){return"string"==typeof t&&t.length>0}addEdges(t,e,r,i,n,s,o,a,u,l){const h=new d.Vector3,c=new d.Vector3;let p,f,m=0,y=0;for(;m<e;){for(;m!==p;){void 0===p&&(p=m),m<e&&(y=Math.max(y,m));const d=s[m*r+i];if(d<0)break;if(a)if(!0===u&&o.push(t+2*m,t+2*d),o.push(t+2*m+1,t+2*d+1),void 0!==l){if(void 0!==f){const e=3*(t+2*f),r=3*(t+2*m),i=3*(t+2*d);h.set(n[r]-n[e],n[r+1]-n[e+1],n[r+2]-n[e+2]).normalize(),c.set(n[i]-n[r],n[i+1]-n[r+1],n[i+2]-n[r+2]).normalize(),h.dot(c)<=l&&o.push(t+2*m,t+2*m+1)}}else o.push(t+2*m,t+2*m+1);else o.push(t+m,t+d);f=m,m=d}m=y+1,p=void 0,f=void 0}}addWalls(t,e,r,i,n,s){let o,a=0,u=0;for(;a<e;){for(;a!==o;){void 0===o&&(o=a),a<e&&(u=Math.max(u,a));const l=n[a*r+i+1];if(l<0)break;s.push(t+2*a,t+2*a+1,t+2*l+1,t+2*l+1,t+2*l,t+2*a),a=l}a=u+1,o=void 0}}findRelativePositionInLine(t,e){let r=1/0,i=0;for(let n=0;n<e.length;n+=4){W.set(N.set(e[n],e[n+1],e[n+2]),D.set(e[n+4],e[n+5],e[n+6])),W.closestPointToPoint(t,!0,F);const s=F.distanceTo(t);s<r&&(G.copy(F),U.copy(N),r=s,i=e[n+3])}return i+G.distanceTo(U)}}},1503:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VectorTileDecoderService=e.VectorTileDecoder=e.VectorTileDataProcessor=void 0;const i=r(7769),n=r(2626),s=r(4342),o=r(5156),a=r(2926),u=r(4585),l=r(9252),h=r(9959),c=r(1140),d=s.LoggerManager.instance.create("VectorTileDecoder",{enabled:!1});class p{constructor(t,e,r,i,n={}){var s,o;this.m_tileKey=t,this.m_projection=e,this.m_styleSetEvaluator=r,this.m_dataAdapter=i,this.m_options=n,n.storageLevelOffset=null!==(s=n.storageLevelOffset)&&void 0!==s?s:0,n.showMissingTechniques=null!==(o=n.showMissingTechniques)&&void 0!==o&&o}getDecodedTile(t){this.m_styleSetEvaluator.resetTechniques();const e=new l.DecodeInfo(this.m_projection,this.m_tileKey,this.m_options.storageLevelOffset);return this.m_decodedTileEmitter=new c.VectorTileDataEmitter(e,this.m_styleSetEvaluator,this.m_options),this.m_dataAdapter.process(t,e,this),this.m_decodedTileEmitter.getDecodedTile()}
2processPointFeature(t,e,r,i,n){(0,s.assert)(void 0!==this.m_decodedTileEmitter),this.processFeature(t,e,r,"point",i,n,this.m_decodedTileEmitter.processPointFeature)}processLineFeature(t,e,r,i,n){(0,s.assert)(void 0!==this.m_decodedTileEmitter),this.processFeature(t,e,r,"line",i,n,this.m_decodedTileEmitter.processLineFeature)}processPolygonFeature(t,e,r,i,n){(0,s.assert)(void 0!==this.m_decodedTileEmitter),this.processFeature(t,e,r,"polygon",i,n,this.m_decodedTileEmitter.processPolygonFeature)}processFeature(t,e,r,i,n,s,o){const a=this.createMapEnv(n,s,t,i),u=this.m_styleSetEvaluator.getMatchingTechniques(a,t,i);if(0===u.length)return void(this.m_options.showMissingTechniques&&d.log("VectorTileDataProcessor#processFeature: no techniques for object:",JSON.stringify(a.unmap())));const l={env:a,cachedExprResults:new Map};this.m_decodedTileEmitter&&o.apply(this.m_decodedTileEmitter,[t,e,r,l,u])}createMapEnv(t,e,r,n){const s=this.m_tileKey.level;return new i.MapEnv(Object.assign(Object.assign({$layer:r,$id:null!=e?e:null,$level:s,$zoom:Math.max(0,s-this.m_options.storageLevelOffset),$geometryType:n},this.getLocalizedNames(t)),t))}getLocalizedNames(t){var e,r;const[i,n]=null!==(r=null===(e=this.m_options.languages)||void 0===e?void 0:e.map((e=>t[`name:${e}`])))&&void 0!==r?r:[];return{"$localized-name":null!=i?i:t.name,"$secondary-localized-name":n}}}e.VectorTileDataProcessor=p;class f extends n.ThemedTileDecoder{constructor(t){super(),this.m_dataAdapter=t,this.m_options={map:{},changed:!1},this.m_defaultDataAdapters=[],this.m_defaultDataAdapters.push(new u.OmvDataAdapter,new a.GeoJsonVtDataAdapter,new o.GeoJsonDataAdapter)}connect(){return Promise.resolve()}decodeThemedTile(t,e,r,i){const n=s.PerformanceTimer.now();if(!this.m_dataAdapter&&(this.m_dataAdapter=this.findDefaultDataAdapter(t),!this.m_dataAdapter))return Promise.reject(new Error("Unsupported data format."));const o=this.m_dataAdapter;if((0,s.assert)(o.canProcess(t)),this.m_options.changed){if(o instanceof u.OmvDataAdapter){const t=this.m_options.map;o.configure(t)}this.m_options.changed=!1}const a=new p(e,i,r,o,this.m_options.map).getDecodedTile(t);return a.decodeTime=s.PerformanceTimer.now()-n,Promise.resolve(a)}configure(t,e){super.configure(t,e),this.m_options.map=Object.assign(Object.assign(Object.assign({},this.m_options.map),t),e),this.m_options.changed=!0}findDefaultDataAdapter(t){for(const e of this.m_defaultDataAdapters)if(e.canProcess(t))return e}}e.VectorTileDecoder=f,e.VectorTileDecoderService=class{static start(){n.WorkerServiceManager.getInstance().register({serviceType:h.VECTOR_TILE_DECODER_SERVICE_TYPE,factory:t=>n.TileDecoderService.start(t,new f)})}}},2926:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GeoJsonVtDataAdapter=void 0;const i=r(9776),n=r(5448),s=r(6815),o=r(2616),a=r(6441),u=4096;var l;!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon"}(l||(l={}));const h=new s.Vector3;e.GeoJsonVtDataAdapter=class{canProcess(t){if((0,a.isArrayBufferLike)(t))return!1;const e=t;return void 0!==e.features&&void 0!==e.source&&void 0!==e.x&&void 0!==e.y&&void 0!==e.z}process(t,e,r){for(const c of t.features)switch(c.type){case l.Point:for(const e of c.geometry){const i=e[0],n=e[1],o=new s.Vector3(i,n,0);r.processPointFeature(t.layer,u,[o],c.tags,c.id)}break;case l.LineString:{const i=c.geometry;let s;const l=[];i.forEach((t=>{const e=null==s?void 0:s.positions[s.positions.length-1],[r,i]=t[0];if((null==e?void 0:e.x)===r&&(null==e?void 0:e.y)===i)for(let e=1;e<t.length;++e){const[r,i]=t[e];null==s||s.positions.push(new n.Vector2(r,i))}else{const e=t.map((([t,e])=>new n.Vector2(t,e)));l.push({positions:e}),s=l[l.length-1]}})),l.forEach((t=>{t.untiledPositions=t.positions.map((t=>((0,a.tile2world)(u,e,t,!1,h),o.webMercatorProjection.unprojectPoint(h))))}
2)),r.processLineFeature(t.layer,u,l,c.tags,c.id);break}case l.Polygon:{const e=[];let s;for(const t of c.geometry){const r=[];for(const[e,i]of t){const t=new n.Vector2(e,i);r.push(t)}i.ShapeUtils.area(r)>0&&(s={rings:[]},e.push(s)),null==s||s.rings.push(r)}r.processPolygonFeature(t.layer,u,e,c.tags,c.id);break}case l.Unknown:}}}},5156:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GeoJsonDataAdapter=void 0;const i=r(9776),n=r(5448),s=r(6815),o=r(6112),a=r(2616),u=r(6441),l=4096,h=new s.Vector3;function c(t,e,r){return a.webMercatorProjection.projectPoint(a.GeoCoordinates.fromGeoPoint(t),h),(0,u.world2tile)(l,e,h,!1,r)}function d(t,e){return{untiledPositions:t.map((t=>a.GeoCoordinates.fromGeoPoint(t))),positions:t.map((t=>c(t,e,new n.Vector2)))}}function p(t,e){return"LineString"===t.type?[d(t.coordinates,e)]:t.coordinates.map((t=>d(t,e)))}function f(t,e){return{rings:t.map(((t,r)=>{const n=0===r,{positions:s}=d(t,e),o=i.ShapeUtils.area(s)>0;return(n&&!o||!n&&o)&&s.reverse(),s}))}}function m(t,e){return"Polygon"===t.type?[f(t.coordinates,e)]:t.coordinates.map((t=>f(t,e)))}function y(t,e){return"Point"===t.type?[c(t.coordinates,e,new s.Vector3)]:t.coordinates.map((t=>c(t,e,new s.Vector3)))}e.GeoJsonDataAdapter=class{canProcess(t){return t&&"FeatureCollection"===t.type&&Array.isArray(t.features)}process(t,e,r,i="geojson"){if(Array.isArray(t.features)&&0!==t.features.length)for(const n of t.features)switch(n.geometry.type){case"LineString":case"MultiLineString":{let t=p(n.geometry,e);const s=[],a=100;t.forEach((t=>{(0,o.clipLineString)(t.positions,-a,-a,l+a,l+a).forEach((t=>{s.push({positions:t})}))})),t=s,t.length>0&&r.processLineFeature(i,l,s,n.properties,n.id);break}case"Polygon":case"MultiPolygon":{const t=m(n.geometry,e);r.processPolygonFeature(i,l,t,n.properties,n.id);break}case"Point":case"MultiPoint":{const t=y(n.geometry,e);r.processPointFeature(i,l,t,n.properties,n.id);break}}}}},9607:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GeometryCommands=e.FeatureAttributes=e.visitOmvLayer=e.visitOmv=e.isClosePathCommand=e.isLineToCommand=e.isMoveToCommand=e.CommandKind=void 0;const i=r(5448),n=r(3577);var s;function o(t,e){if((!e.visitLayer||e.visitLayer(t))&&t.features)for(const r of t.features)switch(r.type){case n.com.mapbox.pb.Tile.GeomType.UNKNOWN:break;case n.com.mapbox.pb.Tile.GeomType.POINT:e.visitPointFeature&&e.visitPointFeature(r);break;case n.com.mapbox.pb.Tile.GeomType.LINESTRING:e.visitLineFeature&&e.visitLineFeature(r);break;case n.com.mapbox.pb.Tile.GeomType.POLYGON:e.visitPolygonFeature&&e.visitPolygonFeature(r)}e.endVisitLayer&&e.endVisitLayer(t)}!function(t){t[t.MoveTo=1]="MoveTo",t[t.LineTo=2]="LineTo",t[t.ClosePath=7]="ClosePath"}(s=e.CommandKind||(e.CommandKind={})),e.isMoveToCommand=function(t){return t.kind===s.MoveTo},e.isLineToCommand=function(t){return t.kind===s.LineTo},e.isClosePathCommand=function(t){return t.kind===s.ClosePath},e.visitOmv=function(t,e){if(t.layers)for(const r of t.layers)e.visitLayer&&!e.visitLayer(r)||o(r,e),e.endVisitLayer&&e.endVisitLayer(r)},e.visitOmvLayer=o,e.FeatureAttributes=class{accept(t,e,r){const{keys:i,values:n}=t,s=e.tags;if(s&&i&&n)for(let t=0;t<s.length;t+=2){const e=i[s[t]],o=n[s[t+1]];if(!r.visitAttribute(e,o))break}}},e.GeometryCommands=class{accept(t,e){if(!t)return;const r=t.length;let n=0,o=0;const a=[],u=[],l=[];for(let h=0;h<r;){const r=7&t[h],c=t[h]>>3;if(++h,r===s.MoveTo||r===s.LineTo)for(let s=0;s<c;++s){const s=t[h++],c=t[h++];n+=s>>1^-(1&s),o+=c>>1^-(1&c),"Polygon"===e.type&&(a.push(n),u.push(o));const d=new i.Vector2(n,o);l.push({kind:r,position:d})}else{for(const t of l)e.visitCommand(t);e.visitCommand({kind:r}),a.length=0,u.length=0,l.length=0}}if(l.length>0)for(const t of l)e.visitCommand(t)}}},4585:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OmvDataAdapter=e.asGeometryType=void 0;const i=r(5133),n=r(9776),s=r(6815),o=r(7769),a=r(4342),u=r(9959),l=r(7305),h=r(6441),c=r(9607),d=r(3577),p=["stringValue","floatValue","doubleValue","intValue","uintValue","sintValue","boolValue"],f=a.LoggerManager.instance.create("OmvDataAdapter",{enabled:!1}),m=i.fromNumber(Number.MAX_SAFE_INTEGER,!0),y=i.fromNumber(Number.MIN_SAFE_INTEGER,!1);function g(t,e,r){if(void 0!==e.id&&null!==e.id)return e.id;if(t.hasOwnProperty("id")){const e=t.id;if("number"==typeof e)return e;if(e)return void 0!==r&&e.greaterThan(Number.MAX_SAFE_INTEGER)&&r.error("Invalid ID: Larger than largest available Number in feature: ",t),e.toNumber()}}function x(t){if(void 0===t)return u.OmvGeometryType.UNKNOWN;switch(t.type){case d.com.mapbox.pb.Tile.GeomType.UNKNOWN:return u.OmvGeometryType.UNKNOWN;case d.com.mapbox.pb.Tile.GeomType.POINT:return u.OmvGeometryType.POINT;case d.com.mapbox.pb.Tile.GeomType.LINESTRING:return u.OmvGeometryType.LINESTRING;
2case d.com.mapbox.pb.Tile.GeomType.POLYGON:return u.OmvGeometryType.POLYGON;default:return u.OmvGeometryType.UNKNOWN}}function v(t,e){t.forEach((t=>{t.x===e-1&&(t.x=e)}))}e.asGeometryType=x,e.OmvDataAdapter=class{constructor(){this.m_geometryCommands=new c.GeometryCommands,this.m_roundUpCoordinatesIfNeeded=!1}configure(t){var e;const r=t.politicalView;this.m_dataFilter=void 0,this.m_featureModifiers=[new l.OmvPoliticalViewFeatureModifier(null!=r?r:"")],this.m_roundUpCoordinatesIfNeeded=null!==(e=t.roundUpCoordinatesIfNeeded)&&void 0!==e&&e}canProcess(t){return(0,h.isArrayBufferLike)(t)}process(t,e,r){const{tileKey:i}=e,n=new Uint8Array(t),s=d.com.mapbox.pb.Tile.decode(n);this.m_tileKey=i,this.m_processor=r,(0,c.visitOmv)(s,this)}visitLayer(t){this.m_layer=t;const e=this.m_tileKey.level,r=t.name;return!(void 0!==this.m_dataFilter&&!this.m_dataFilter.wantsLayer(r,e))}visitPointFeature(t){var e;if(void 0===t.geometry)return;const r=this.filterAndModifyFeature(t,"doProcessPointFeature","wantsPointFeature");if(!r)return;const i=this.m_layer.name,n=null!==(e=this.m_layer.extent)&&void 0!==e?e:4096,o=[];this.m_geometryCommands.accept(t.geometry,{type:"Point",visitCommand:t=>{(0,c.isMoveToCommand)(t)&&o.push(new s.Vector3(t.position.x,t.position.y,0))}}),0!==o.length&&this.m_processor.processPointFeature(i,n,o,r,g(t,r,f))}visitLineFeature(t){var e;if(void 0===t.geometry)return;const r=this.filterAndModifyFeature(t,"doProcessLineFeature","wantsLineFeature");if(!r)return;const i=this.m_layer.name,n=null!==(e=this.m_layer.extent)&&void 0!==e?e:4096,s=[];let o;this.m_geometryCommands.accept(t.geometry,{type:"Line",visitCommand:t=>{(0,c.isMoveToCommand)(t)?(o=[t.position],s.push({positions:o})):(0,c.isLineToCommand)(t)&&o.push(t.position)}}),0!==s.length&&(this.mustRoundUpCoordinates&&function(t,e){t.forEach((t=>v(t.positions,e)))}(s,n),this.m_processor.processLineFeature(i,n,s,r,g(t,r,f)))}visitPolygonFeature(t){var e;if(void 0===t.geometry)return;const r=this.filterAndModifyFeature(t,"doProcessPolygonFeature","wantsPolygonFeature");if(!r)return;const i=this.m_layer.name,s=null!==(e=this.m_layer.extent)&&void 0!==e?e:4096,o=[];let a,u,l;this.m_geometryCommands.accept(t.geometry,{type:"Polygon",visitCommand:t=>{if((0,c.isMoveToCommand)(t))u=[t.position];else if((0,c.isLineToCommand)(t))u.push(t.position);else if((0,c.isClosePathCommand)(t)&&void 0!==u&&u.length>0){const t=Math.sign(n.ShapeUtils.area(u));void 0===l&&(l=t),t===l&&(a={rings:[]},o.push(a)),u.push(u[0].clone()),null==a||a.rings.push(u)}}}),0!==o.length&&(this.mustRoundUpCoordinates&&function(t,e){t.forEach((t=>t.rings.forEach((t=>v(t,e)))))}(o,s),function(t){const e=t[0];if(void 0!==e&&0!==e.rings.length&&!(n.ShapeUtils.area(e.rings[0])>0))for(const e of t)for(const t of e.rings)t.reverse()}(o),this.m_processor.processPolygonFeature(i,s,o,r,g(t,r,f)))}filterAndModifyFeature(t,e,r){const n=this.m_tileKey.level,s=this.m_layer.name,a=x(t);if(this.m_dataFilter&&!1===this.m_dataFilter[r](s,a,n))return;const u=function(t,e){const r=new c.FeatureAttributes,n={};return r.accept(t,e,{visitAttribute:(t,e)=>(n[t]=function(t){const e=Object.prototype.hasOwnProperty;for(const r of p)if(e.call(t,r)){const e=t[r];if(void 0===e)throw new Error("unpexted undefined value");return i.isLong(e)?e.comp(m)>0||e.comp(y)<0?e.toString():e.toNumber():e}throw new Error("not happening")}(e),!0)}),n}(this.m_layer,t),l=new o.MapEnv(u);return this.m_featureModifiers&&this.m_featureModifiers.find((t=>!t[e](s,l,this.m_tileKey.level)))?void 0:u}get mustRoundUpCoordinates(){return this.m_roundUpCoordinatesIfNeeded&&this.m_tileKey.level<5&&this.m_tileKey.column===this.m_tileKey.columnCount()-1}}},6271:(t,e,r)=>{"use strict";r.d(e,{GUF:()=>n,KI_:()=>i,W2J:()=>o,ntt:()=>s});const i="srgb",n="srgb-linear",s="display-p3",o=35044},9365:(t,e,r)=>{"use strict";r.r(e),r.d(e,{BufferAttribute:()=>p,Float16BufferAttribute:()=>w,Float32BufferAttribute:()=>_,Float64BufferAttribute:()=>M,Int16BufferAttribute:()=>g,Int32BufferAttribute:()=>v,Int8BufferAttribute:()=>f,Uint16BufferAttribute:()=>x,Uint32BufferAttribute:()=>b,Uint8BufferAttribute:()=>m,Uint8ClampedBufferAttribute:()=>y});var i=r(6815),n=r(5448),s=r(3334),o=r(6271);const a=u();function u(){const t=new ArrayBuffer(4),e=new Float32Array(t),r=new Uint32Array(t),i=new Uint32Array(512),n=new Uint32Array(512);for(let t=0;t<256;++t){const e=t-127;e<-27?(i[t]=0,i[256|t]=32768,n[t]=24,n[256|t]=24):e<-14?(i[t]=1024>>-e-14,i[256|t]=1024>>-e-14|32768,n[t]=-e-1,n[256|t]=-e-1):e<=15?(i[t]=e+15<<10,i[256|t]=e+15<<10|32768,n[t]=13,n[256|t]=13):e<128?(i[t]=31744,i[256|t]=64512,n[t]=24,n[256|t]=24):(i[t]=31744,i[256|t]=64512,n[t]=13,n[256|t]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,r=0;for(;!(8388608&e);)e<<=1,r-=8388608;e&=-8388609,r+=947912704,s[t]=e|r}for(let t=1024;t<2048;++t)s[t]=939524096+(t-1024<<13);for(let t=1;t<31;++t)o[t]=t<<23;o[31]=1199570944,o[32]=2147483648;for(let t=33;t<63;++t)o[t]=2147483648+(t-32<<23);o[63]=3347054592;for(let t=1;t<64;
2++t)32!==t&&(a[t]=1024);return{floatView:e,uint32View:r,baseTable:i,shiftTable:n,mantissaTable:s,exponentTable:o,offsetTable:a}}function l(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=(0,s.clamp)(t,-65504,65504),a.floatView[0]=t;const e=a.uint32View[0],r=e>>23&511;return a.baseTable[r]+((8388607&e)>>a.shiftTable[r])}function h(t){const e=t>>10;return a.uint32View[0]=a.mantissaTable[a.offsetTable[e]+(1023&t)]+a.exponentTable[e],a.floatView[0]}const c=new i.Vector3,d=new n.Vector2;class p{constructor(t,e,r=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=r,this.usage=o.W2J,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,e,r){t*=this.itemSize,r*=e.itemSize;for(let i=0,n=this.itemSize;i<n;i++)this.array[t+i]=e.array[r+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,r=this.count;e<r;e++)d.fromBufferAttribute(this,e),d.applyMatrix3(t),this.setXY(e,d.x,d.y);else if(3===this.itemSize)for(let e=0,r=this.count;e<r;e++)c.fromBufferAttribute(this,e),c.applyMatrix3(t),this.setXYZ(e,c.x,c.y,c.z);return this}applyMatrix4(t){for(let e=0,r=this.count;e<r;e++)c.fromBufferAttribute(this,e),c.applyMatrix4(t),this.setXYZ(e,c.x,c.y,c.z);return this}applyNormalMatrix(t){for(let e=0,r=this.count;e<r;e++)c.fromBufferAttribute(this,e),c.applyNormalMatrix(t),this.setXYZ(e,c.x,c.y,c.z);return this}transformDirection(t){for(let e=0,r=this.count;e<r;e++)c.fromBufferAttribute(this,e),c.transformDirection(t),this.setXYZ(e,c.x,c.y,c.z);return this}set(t,e=0){return this.array.set(t,e),this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=(0,s.denormalize)(e,this.array)),e}setX(t,e){return this.normalized&&(e=(0,s.normalize)(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=(0,s.denormalize)(e,this.array)),e}setY(t,e){return this.normalized&&(e=(0,s.normalize)(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=(0,s.denormalize)(e,this.array)),e}setZ(t,e){return this.normalized&&(e=(0,s.normalize)(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=(0,s.denormalize)(e,this.array)),e}setW(t,e){return this.normalized&&(e=(0,s.normalize)(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,r){return t*=this.itemSize,this.normalized&&(e=(0,s.normalize)(e,this.array),r=(0,s.normalize)(r,this.array)),this.array[t+0]=e,this.array[t+1]=r,this}setXYZ(t,e,r,i){return t*=this.itemSize,this.normalized&&(e=(0,s.normalize)(e,this.array),r=(0,s.normalize)(r,this.array),i=(0,s.normalize)(i,this.array)),this.array[t+0]=e,this.array[t+1]=r,this.array[t+2]=i,this}setXYZW(t,e,r,i,n){return t*=this.itemSize,this.normalized&&(e=(0,s.normalize)(e,this.array),r=(0,s.normalize)(r,this.array),i=(0,s.normalize)(i,this.array),n=(0,s.normalize)(n,this.array)),this.array[t+0]=e,this.array[t+1]=r,this.array[t+2]=i,this.array[t+3]=n,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==o.W2J&&(t.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(t.updateRange=this.updateRange),t}copyColorsArray(){console.error("THREE.BufferAttribute: copyColorsArray() was removed in r144.")}copyVector2sArray(){console.error("THREE.BufferAttribute: copyVector2sArray() was removed in r144.")}copyVector3sArray(){console.error("THREE.BufferAttribute: copyVector3sArray() was removed in r144.")}copyVector4sArray(){console.error("THREE.BufferAttribute: copyVector4sArray() was removed in r144.")}}class f extends p{constructor(t,e,r){super(new Int8Array(t),e,r)}}class m extends p{constructor(t,e,r){super(new Uint8Array(t),e,r)}}class y extends p{constructor(t,e,r){super(new Uint8ClampedArray(t),e,r)}}class g extends p{constructor(t,e,r){super(new Int16Array(t),e,r)}}class x extends p{constructor(t,e,r){super(new Uint16Array(t),e,r)}}class v extends p{constructor(t,e,r){super(new Int32Array(t),e,r)}}class b extends p{constructor(t,e,r){super(new Uint32Array(t),e,r)}}class w extends p{constructor(t,e,r){super(new Uint16Array(t),e,r),this.isFloat16BufferAttribute=!0}getX(t){let e=h(this.array[t*this.itemSize]);return this.normalized&&(e=(0,s.denormalize)(e,this.array)),e}setX(t,e){return this.normalized&&(e=(0,s.normalize)(e,this.array)),this.array[t*this.itemSize]=l(e),this}getY(t){let e=h(this.array[t*this.itemSize+1]);return this.normalized&&(e=(0,s.denormalize)(e,this.array)),e}setY(t,e){return this.normalized&&(e=(0,s.normalize)(e,this.array)),this.array[t*this.itemSize+1]=l(e),this}getZ(t){let e=h(this.array[t*this.itemSize+2]);return this.normalized&&(e=(0,s.denormalize)(e,this.array)),e}setZ(t,e){return this.normalized&&(e=(0,s.normalize)(e,this.array)),this.array[t*this.itemSize+2]=l(e),this}getW(t){let e=h(this.array[t*this.itemSize+3]);return this.normalized&&(e=(0,s.denormalize)(e,this.array)),e}setW(t,e){return this.normalized&&(e=(0,s.normalize)(e,this.array)),this.array[t*this.itemSize+3]=l(e),this}setXY(t,e,r){return t*=this.itemSize,this.normalized&&(e=(0,s.normalize)(e,this.array),r=(0,s.normalize)(r,this.array)),this.array[t+0]=l(e),this.array[t+1]=l(r),this}setXYZ(t,e,r,i){return t*=this.itemSize,this.normalized&&(e=(0,s.normalize)(e,this.array),r=(0,s.normalize)(r,this.array),i=(0,s.normalize)(i,this.array)),this.array[t+0]=l(e),this.array[t+1]=l(r),this.array[t+2]=l(i),this}setXYZW(t,e,r,i,n){return t*=this.itemSize,this.normalized&&(e=(0,s.normalize)(e,this.array),r=(0,s.normalize)(r,this.array),i=(0,s.normalize)(i,this.array),n=(0,s.normalize)(n,this.array)),this.array[t+0]=l(e),this.array[t+1]=l(r),this.array[t+2]=l(i),this.array[t+3]=l(n),this}}class _ extends p{constructor(t,e,r){super(new Float32Array(t),e,r)}}class M extends p{constructor(t,e,r){super(new Float64Array(t),e,r)}}},1405:(t,e,r)=>{"use strict";r.r(e),r.d(e,{BufferGeometry:()=>D});var i=r(6815),n=r(5448),s=r(2754);class o{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const r=this._listeners;void 0===r[t]&&(r[t]=[]),-1===r[t].indexOf(e)&&r[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const r=this._listeners;return void 0!==r[t]&&-1!==r[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const r=this._listeners[t];if(void 0!==r){const t=r.indexOf(e);-1!==t&&r.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const r=e.slice(0);for(let e=0,i=r.length;e<i;e++)r[e].call(this,t);t.target=null}}}var a=r(9365);const u=new s.Box3,l=new i.Vector3,h=new i.Vector3;class c{constructor(t=new i.Vector3,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const r=this.center;void 0!==e?r.copy(e):u.setFromPoints(t).getCenter(r);let i=0;for(let e=0,n=t.length;e<n;e++)i=Math.max(i,r.distanceToSquared(t[e]));return this.radius=Math.sqrt(i),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const r=this.center.distanceToSquared(t);return e.copy(t),r>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}
vendor: 5,468 bytes, line 2
2applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;l.subVectors(t,this.center);const e=l.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),r=.5*(t-this.radius);this.center.addScaledVector(l,r/t),this.radius+=r}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(h.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(l.copy(t.center).add(h)),this.expandByPoint(l.copy(t.center).sub(h))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}var d=r(9747),p=r(8333),f=r(3334);const m=new p.Matrix4,y=new d._;class g{constructor(t=0,e=0,r=0,i=g.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=r,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,r,i=this._order){return this._x=t,this._y=e,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,r=!0){const i=t.elements,n=i[0],s=i[4],o=i[8],a=i[1],u=i[5],l=i[9],h=i[2],c=i[6],d=i[10];switch(e){case"XYZ":this._y=Math.asin((0,f.clamp)(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-s,n)):(this._x=Math.atan2(c,u),this._z=0);break;case"YXZ":this._x=Math.asin(-(0,f.clamp)(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(a,u)):(this._y=Math.atan2(-h,n),this._z=0);break;case"ZXY":this._x=Math.asin((0,f.clamp)(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,u)):(this._y=0,this._z=Math.atan2(a,n));break;case"ZYX":this._y=Math.asin(-(0,f.clamp)(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(c,d),this._z=Math.atan2(a,n)):(this._x=0,this._z=Math.atan2(-s,u));break;case"YZX":this._z=Math.asin((0,f.clamp)(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-l,u),this._y=Math.atan2(-h,n)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-(0,f.clamp)(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(c,u),this._y=Math.atan2(o,n)):(this._x=Math.atan2(-l,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===r&&this._onChangeCallback(),this}setFromQuaternion(t,e,r){return m.makeRotationFromQuaternion(t),this.setFromRotationMatrix(m,e,r)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return y.setFromEuler(this),this.setFromQuaternion(y,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}g.DEFAULT_ORDER="XYZ";class x{constructor(){this.mask=1}set(t){this.mask=1<<t>>>0}enable(t){this.mask|=1<<t}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t}disable(t){this.mask&=~(1<<t)}disableAll(){this.mask=0}test(t){return!!(this.mask&t.mask)}isEnabled(t){return!!(this.mask&1<<t)}}var v=r(8955);let b=0;const w=new i.Vector3,_=new d._,M=new p.Matrix4,E=new i.Vector3,T=new i.Vector3,S=new i.Vector3,A=new d._,z=new i.Vector3(1,0,0),P=new i.Vector3(0,1,0),L=new i.Vector3(0,0,1),O={type:"added"},C={type:"removed"};class k extends o{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:b++}),this.uuid=f.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=k.DEFAULT_UP.clone();const t=new i.Vector3,e=new g,r=new d._,n=new i.Vector3(1,1,1);e._onChange((function(){r.setFromEuler(e,!1)})),r._onChange((function(){e.setFromQuaternion(r,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new p.Matrix4},normalMatrix:{value:new v.V}}),this.matrix=new p.Matrix4,this.matrixWorld=new p.Matrix4,this.matrixAutoUpdate=k.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=k.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.layers=new x,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}
vendor: 4,207 bytes, line 2
2setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return _.setFromAxisAngle(t,e),this.quaternion.multiply(_),this}rotateOnWorldAxis(t,e){return _.setFromAxisAngle(t,e),this.quaternion.premultiply(_),this}rotateX(t){return this.rotateOnAxis(z,t)}rotateY(t){return this.rotateOnAxis(P,t)}rotateZ(t){return this.rotateOnAxis(L,t)}translateOnAxis(t,e){return w.copy(t).applyQuaternion(this.quaternion),this.position.add(w.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(z,t)}translateY(t){return this.translateOnAxis(P,t)}translateZ(t){return this.translateOnAxis(L,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(M.copy(this.matrixWorld).invert())}lookAt(t,e,r){t.isVector3?E.copy(t):E.set(t,e,r);const i=this.parent;this.updateWorldMatrix(!0,!1),T.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?M.lookAt(T,E,this.up):M.lookAt(E,T,this.up),this.quaternion.setFromRotationMatrix(M),i&&(M.extractRotation(i.matrixWorld),_.setFromRotationMatrix(M),this.quaternion.premultiply(_.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can\'t be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(O)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(C)),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=null,e.dispatchEvent(C)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),M.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),M.multiply(t.parent.matrixWorld)),t.applyMatrix4(M),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let r=0,i=this.children.length;r<i;r++){const i=this.children[r].getObjectByProperty(t,e);if(void 0!==i)return i}}getObjectsByProperty(t,e){let r=[];this[t]===e&&r.push(this);for(let i=0,n=this.children.length;i<n;i++){const n=this.children[i].getObjectsByProperty(t,e);n.length>0&&(r=r.concat(n))}return r}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(T,t,S),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(T,A,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let r=0,i=e.length;r<i;r++)e[r].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let r=0,i=e.length;r<i;r++)e[r].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let r=0,i=e.length;r<i;r++){const i=e[r];!0!==i.matrixWorldAutoUpdate&&!0!==t||i.updateMatrixWorld(t)}}updateWorldMatrix(t,e){const r=this.parent;if(!0===t&&null!==r&&!0===r.matrixWorldAutoUpdate&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix
vendor: 5,042 bytes, line 2
2):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const t=this.children;for(let e=0,r=t.length;e<r;e++){const r=t[e];!0===r.matrixWorldAutoUpdate&&r.updateWorldMatrix(!1,!0)}}}toJSON(t){const e=void 0===t||"string"==typeof t,r={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const i={};function n(e,r){return void 0===e[r.uuid]&&(e[r.uuid]=r.toJSON(t)),r.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),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.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(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=n(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const r=e.shapes;if(Array.isArray(r))for(let e=0,i=r.length;e<i;e++){const i=r[e];n(t.shapes,i)}else n(t.shapes,r)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(n(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let r=0,i=this.material.length;r<i;r++)e.push(n(t.materials,this.material[r]));i.material=e}else i.material=n(t.materials,this.material);if(this.children.length>0){i.children=[];for(let e=0;e<this.children.length;e++)i.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let e=0;e<this.animations.length;e++){const r=this.animations[e];i.animations.push(n(t.animations,r))}}if(e){const e=s(t.geometries),i=s(t.materials),n=s(t.textures),o=s(t.images),a=s(t.shapes),u=s(t.skeletons),l=s(t.animations),h=s(t.nodes);e.length>0&&(r.geometries=e),i.length>0&&(r.materials=i),n.length>0&&(r.textures=n),o.length>0&&(r.images=o),a.length>0&&(r.shapes=a),u.length>0&&(r.skeletons=u),l.length>0&&(r.animations=l),h.length>0&&(r.nodes=h)}return r.object=i,r;function s(t){const e=[];for(const r in t){const i=t[r];delete i.metadata,e.push(i)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){const r=t.children[e];this.add(r.clone())}return this}}k.DEFAULT_UP=new i.Vector3(0,1,0),k.DEFAULT_MATRIX_AUTO_UPDATE=!0,k.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0,Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;let j=0;const V=new p.Matrix4,I=new k,R=new i.Vector3,B=new s.Box3,q=new s.Box3,N=new i.Vector3;class D extends o{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:j++}),this.uuid=f.generateUUID(),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(t){return Array.isArray(t)?this.index=new(function(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}(t)?a.Uint32BufferAttribute:a.Uint16BufferAttribute)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,r=0){this.groups.push({start:t,count:e,materialIndex:r})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;
vendor: 1,488 bytes, line 2
2void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const r=this.attributes.normal;if(void 0!==r){const e=(new v.V).getNormalMatrix(t);r.applyNormalMatrix(e),r.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return V.makeRotationFromQuaternion(t),this.applyMatrix4(V),this}rotateX(t){return V.makeRotationX(t),this.applyMatrix4(V),this}rotateY(t){return V.makeRotationY(t),this.applyMatrix4(V),this}rotateZ(t){return V.makeRotationZ(t),this.applyMatrix4(V),this}translate(t,e,r){return V.makeTranslation(t,e,r),this.applyMatrix4(V),this}scale(t,e,r){return V.makeScale(t,e,r),this.applyMatrix4(V),this}lookAt(t){return I.lookAt(t),I.updateMatrix(),this.applyMatrix4(I.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(R).negate(),this.translate(R.x,R.y,R.z),this}setFromPoints(t){const e=[];for(let r=0,i=t.length;r<i;r++){const i=t[r];e.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new a.Float32BufferAttribute(e,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new s.Box3);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error(\'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "fal
2se".\',this),void this.boundingBox.set(new i.Vector3(-1/0,-1/0,-1/0),new i.Vector3(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,r=e.length;t<r;t++){const r=e[t];B.setFromBufferAttribute(r),this.morphTargetsRelative?(N.addVectors(this.boundingBox.min,B.min),this.boundingBox.expandByPoint(N),N.addVectors(this.boundingBox.max,B.max),this.boundingBox.expandByPoint(N)):(this.boundingBox.expandByPoint(B.min),this.boundingBox.expandByPoint(B.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 c);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error(\'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "fal
2se".\',this),void this.boundingSphere.set(new i.Vector3,1/0);if(t){const r=this.boundingSphere.center;if(B.setFromBufferAttribute(t),e)for(let t=0,r=e.length;t<r;t++){const r=e[t];q.setFromBufferAttribute(r),this.morphTargetsRelative?(N.addVectors(B.min,q.min),B.expandByPoint(N),N.addVectors(B.max,q.max),B.expandByPoint(N)):(B.expandByPoint(q.min),B.expandByPoint(q.max))}B.getCenter(r);let i=0;for(let e=0,n=t.count;e<n;e++)N.fromBufferAttribute(t,e),i=Math.max(i,r.distanceToSquared(N));if(e)for(let n=0,s=e.length;n<s;n++){const s=e[n],o=this.morphTargetsRelative;for(let e=0,n=s.count;e<n;e++)N.fromBufferAttribute(s,e),o&&(R.fromBufferAttribute(t,e),N.add(R)),i=Math.max(i,r.distanceToSquared(N))}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 t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const r=t.array,s=e.position.array,o=e.normal.array,u=e.uv.array,l=s.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new a.BufferAttribute(new Float32Array(4*l),4));const h=this.getAttribute("tangent").array,c=[],d=[];for(let t=0;t<l;t++)c[t]=new i.Vector3,d[t]=new i.Vector3;const p=new i.Vector3,f=new i.Vector3,m=new i.Vector3,y=new n.Vector2,g=new n.Vector2,x=new n.Vector2,v=new i.Vector3,b=new i.Vector3;function w(t,e,r){p.fromArray(s,3*t),f.fromArray(s,3*e),m.fromArray(s,3*r),y.fromArray(u,2*t),g.fromArray(u,2*e),x.fromArray(u,2*r),f.sub(p),m.sub(p),g.sub(y),x.sub(y);const i=1/(g.x*x.y-x.x*g.y);isFinite(i)&&(v.copy(f).multiplyScalar(x.y).addScaledVector(m,-g.y).multiplyScalar(i),b.copy(m).multiplyScalar(g.x).addScaledVector(f,-x.x).multiplyScalar(i),c[t].add(v),c[e].add(v),c[r].add(v),d[t].add(b),d[e].add(b),d[r].add(b))}let _=this.groups;0===_.length&&(_=[{start:0,count:r.length}]);for(let t=0,e=_.length;t<e;++t){const e=_[t],i=e.start;for(let t=i,n=i+e.count;t<n;t+=3)w(r[t+0],r[t+1],r[t+2])}const M=new i.Vector3,E=new i.Vector3,T=new i.Vector3,S=new i.Vector3;function A(t){T.fromArray(o,3*t),S.copy(T);const e=c[t];M.copy(e),M.sub(T.multiplyScalar(T.dot(e))).normalize(),E.crossVectors(S,e);const r=E.dot(d[t])<0?-1:1;h[4*t]=M.x,h[4*t+1]=M.y,h[4*t+2]=M.z,h[4*t+3]=r}for(let t=0,e=_.length;t<e;++t){const e=_[t],i=e.start;for(let t=i,n=i+e.count;t<n;t+=3)A(r[t+0]),A(r[t+1]),A(r[t+2])}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let r=this.getAttribute("normal");if(void 0===r)r=new a.BufferAttribute(new Float32Array(3*e.count),3),this.setAttribute("normal",r);else for(let t=0,e=r.count;t<e;t++)r.setXYZ(t,0,0,0);const n=new i.Vector3,s=new i.Vector3,o=new i.Vector3,u=new i.Vector3,l=new i.Vector3,h=new i.Vector3,c=new i.Vector3,d=new i.Vector3;if(t)for(let i=0,a=t.count;i<a;i+=3){const a=t.getX(i+0),p=t.getX(i+1),f=t.getX(i+2);n.fromBufferAttribute(e,a),s.fromBufferAttribute(e,p),o.fromBufferAttribute(e,f),c.subVectors(o,s),d.subVectors(n,s),c.cross(d),u.fromBufferAttribute(r,a),l.fromBufferAttribute(r,p),h.fromBufferAttribute(r,f),u.add(c),l.add(c),h.add(c),r.setXYZ(a,u.x,u.y,u.z),r.setXYZ(p,l.x,l.y,l.z),r.setXYZ(f,h.x,h.y,h.z)}else for(let t=0,i=e.count;t<i;t+=3)n.fromBufferAttribute(e,t+0),s.fromBufferAttribute(e,t+1),o.fromBufferAttribute(e,t+2),c.subVectors(o,s),d.subVectors(n,s),c.cross(d),r.setXYZ(t+0,c.x,c.y,c.z),r.setXYZ(t+1,c.x,c.y,c.z),r.setXYZ(t+2,c.x,c.y,c.z);this.normalizeNormals(),r.needsUpdate=!0}}merge(){return console.error("THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeGeometries() instead."),this}normalizeNormals(){const t=this.attributes.normal;for(let e=0,r=t.count;e<r;e++)N.fromBufferAttribute(t,e),N.normalize(),t.setXYZ(e,N.x,N.y,N.z)}toNonIndexed(){function t(t,e){const r=t.array,i=t.itemSize,n=t.normalized,s=new r.constructor(e.length*i);let o=0,u=0;for(let n=0,a=e.length;n<a;n++){o=t.isInterleavedBufferAttribute?e[n]*t.data.stride+t.offset:e[n]*i;for(let t=0;t<i;t++)s[u++]=r[o++]}return new a.BufferAttribute(s,i,n)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new D,r=this.index.array,i=this.attributes;for(const n in i){const s=t(i[n],r);e.setAttribute(n,s)}const n=this.morphAttributes;for(const i in n){const s=[],o=n[i];for(let e=0,i=o.length;e<i;e++){const i=t(o[e],r);s.push(i)}e.morphAttributes[i]=s}e.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let t=0,r=s.length;t<r;t++){const r=s[t];e.addGroup(r.start,r.count,r.materialIndex)}return e}toJSON(){const t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};
vendor: 7,441 bytes, line 2
2if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const r in e)void 0!==e[r]&&(t[r]=e[r]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const r=this.attributes;for(const e in r){const i=r[e];t.data.attributes[e]=i.toJSON(t.data)}const i={};let n=!1;for(const e in this.morphAttributes){const r=this.morphAttributes[e],s=[];for(let e=0,i=r.length;e<i;e++){const i=r[e];s.push(i.toJSON(t.data))}s.length>0&&(i[e]=s,n=!0)}n&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return null!==o&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const r=t.index;null!==r&&this.setIndex(r.clone(e));const i=t.attributes;for(const t in i){const r=i[t];this.setAttribute(t,r.clone(e))}const n=t.morphAttributes;for(const t in n){const r=[],i=n[t];for(let t=0,n=i.length;t<n;t++)r.push(i[t].clone(e));this.morphAttributes[t]=r}this.morphTargetsRelative=t.morphTargetsRelative;const s=t.groups;for(let t=0,e=s.length;t<e;t++){const e=s[t];this.addGroup(e.start,e.count,e.materialIndex)}const o=t.boundingBox;null!==o&&(this.boundingBox=o.clone());const a=t.boundingSphere;return null!==a&&(this.boundingSphere=a.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}},9044:(t,e,r)=>{"use strict";r.r(e),r.d(e,{InterleavedBuffer:()=>s});var i=r(3334),n=r(6271);class s{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=n.W2J,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=i.generateUUID()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,r){t*=this.stride,r*=e.stride;for(let i=0,n=this.stride;i<n;i++)this.array[t+i]=e.array[r+i];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=i.generateUUID()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(e,this.stride);return r.setUsage(this.usage),r}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=i.generateUUID()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}},6280:(t,e,r)=>{"use strict";r.r(e),r.d(e,{InterleavedBufferAttribute:()=>a});var i=r(6815),n=r(9365),s=r(3334);const o=new i.Vector3;class a{constructor(t,e,r,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=r,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,r=this.data.count;e<r;e++)o.fromBufferAttribute(this,e),o.applyMatrix4(t),this.setXYZ(e,o.x,o.y,o.z);return this}applyNormalMatrix(t){for(let e=0,r=this.count;e<r;e++)o.fromBufferAttribute(this,e),o.applyNormalMatrix(t),this.setXYZ(e,o.x,o.y,o.z);return this}transformDirection(t){for(let e=0,r=this.count;e<r;e++)o.fromBufferAttribute(this,e),o.transformDirection(t),this.setXYZ(e,o.x,o.y,o.z);return this}setX(t,e){return this.normalized&&(e=(0,s.normalize)(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=(0,s.normalize)(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=(0,s.normalize)(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=(0,s.normalize)(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=(0,s.denormalize)(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=(0,s.denormalize)(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=(0,s.denormalize)(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=(0,s.denormalize)(e,this.array)),e}setXY(t,e,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=(0,s.normalize)(e,this.array),r=(0,s.normalize)(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=r,this}setXYZ(t,e,r,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=(0,s.normalize)(e,this.array),r=(0,s.normalize)(r,this.array),i=(0,s.normalize)(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=r,this.data.array[t+2]=i,this}setXYZW(t,e,r,i,n){return t=t*this.data.stride+this.offset,this.normalized&&(e=(0,s.normalize)(e,this.array),r=(0,s.normalize)(r,this.array),i=(0,s.normalize)(i,this.array),n=(0,s.normalize)(n,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=r,this.data.array[t+2]=i,this.data.array[t+3]=n,this}clone(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const r=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[r+e])}return new n.BufferAttribute(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new a(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const r=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[r+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}},6782:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Earcut:()=>i});const i={triangulate:function(t,e,r=2){const i=e&&e.length,s=i?e[0]*r:t.length;let a=n(t,0,s,r,!0);const u=[];
2if(!a||a.next===a.prev)return u;let l,h,p,f,y,g,x;if(i&&(a=function(t,e,r,i){const s=[];let o,a,u,l,h;for(o=0,a=e.length;o<a;o++)u=e[o]*i,l=o<a-1?e[o+1]*i:t.length,h=n(t,u,l,i,!1),h===h.next&&(h.steiner=!0),s.push(m(h));for(s.sort(c),o=0;o<s.length;o++)r=d(s[o],r);return r}(t,e,a,r)),t.length>80*r){l=p=t[0],h=f=t[1];for(let e=r;e<s;e+=r)y=t[e],g=t[e+1],y<l&&(l=y),g<h&&(h=g),y>p&&(p=y),g>f&&(f=g);x=Math.max(p-l,f-h),x=0!==x?32767/x:0}return o(a,u,r,l,h,x,0),u}};function n(t,e,r,i,n){let s,o;if(n===function(t,e,r,i){let n=0;for(let s=e,o=r-i;s<r;s+=i)n+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return n}(t,e,r,i)>0)for(s=e;s<r;s+=i)o=T(s,t[s],t[s+1],o);else for(s=r-i;s>=e;s-=i)o=T(s,t[s],t[s+1],o);return o&&v(o,o.next)&&(S(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);let r,i=t;do{if(r=!1,i.steiner||!v(i,i.next)&&0!==x(i.prev,i,i.next))i=i.next;else{if(S(i),i=e=i.prev,i===i.next)break;r=!0}}while(r||i!==e);return e}function o(t,e,r,i,n,c,d){if(!t)return;!d&&c&&function(t,e,r,i){let n=t;do{0===n.z&&(n.z=f(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){let e,r,i,n,s,o,a,u,l=1;do{for(r=t,t=null,s=null,o=0;r;){for(o++,i=r,a=0,e=0;e<l&&(a++,i=i.nextZ,i);e++);for(u=l;a>0||u>0&&i;)0!==a&&(0===u||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,u--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;r=i}s.nextZ=null,l*=2}while(o>1)}(n)}(t,i,n,c);let p,m,y=t;for(;t.prev!==t.next;)if(p=t.prev,m=t.next,c?u(t,i,n,c):a(t))e.push(p.i/r|0),e.push(t.i/r|0),e.push(m.i/r|0),S(t),t=m.next,y=m.next;else if((t=m)===y){d?1===d?o(t=l(s(t),e,r),e,r,i,n,c,2):2===d&&h(t,e,r,i,n,c):o(s(t),e,r,i,n,c,1);break}}function a(t){const e=t.prev,r=t,i=t.next;if(x(e,r,i)>=0)return!1;const n=e.x,s=r.x,o=i.x,a=e.y,u=r.y,l=i.y,h=n<s?n<o?n:o:s<o?s:o,c=a<u?a<l?a:l:u<l?u:l,d=n>s?n>o?n:o:s>o?s:o,p=a>u?a>l?a:l:u>l?u:l;let f=i.next;for(;f!==e;){if(f.x>=h&&f.x<=d&&f.y>=c&&f.y<=p&&y(n,a,s,u,o,l,f.x,f.y)&&x(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function u(t,e,r,i){const n=t.prev,s=t,o=t.next;if(x(n,s,o)>=0)return!1;const a=n.x,u=s.x,l=o.x,h=n.y,c=s.y,d=o.y,p=a<u?a<l?a:l:u<l?u:l,m=h<c?h<d?h:d:c<d?c:d,g=a>u?a>l?a:l:u>l?u:l,v=h>c?h>d?h:d:c>d?c:d,b=f(p,m,e,r,i),w=f(g,v,e,r,i);let _=t.prevZ,M=t.nextZ;for(;_&&_.z>=b&&M&&M.z<=w;){if(_.x>=p&&_.x<=g&&_.y>=m&&_.y<=v&&_!==n&&_!==o&&y(a,h,u,c,l,d,_.x,_.y)&&x(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,M.x>=p&&M.x<=g&&M.y>=m&&M.y<=v&&M!==n&&M!==o&&y(a,h,u,c,l,d,M.x,M.y)&&x(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;_&&_.z>=b;){if(_.x>=p&&_.x<=g&&_.y>=m&&_.y<=v&&_!==n&&_!==o&&y(a,h,u,c,l,d,_.x,_.y)&&x(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;M&&M.z<=w;){if(M.x>=p&&M.x<=g&&M.y>=m&&M.y<=v&&M!==n&&M!==o&&y(a,h,u,c,l,d,M.x,M.y)&&x(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function l(t,e,r){let i=t;do{const n=i.prev,s=i.next.next;!v(n,s)&&b(n,i,i.next,s)&&M(n,s)&&M(s,n)&&(e.push(n.i/r|0),e.push(i.i/r|0),e.push(s.i/r|0),S(i),S(i.next),i=t=s),i=i.next}while(i!==t);return s(i)}function h(t,e,r,i,n,a){let u=t;do{let t=u.next.next;for(;t!==u.prev;){if(u.i!==t.i&&g(u,t)){let l=E(u,t);return u=s(u,u.next),l=s(l,l.next),o(u,e,r,i,n,a,0),void o(l,e,r,i,n,a,0)}t=t.next}u=u.next}while(u!==t)}function c(t,e){return t.x-e.x}function d(t,e){const r=function(t,e){let r,i=e,n=-1/0;const s=t.x,o=t.y;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){const t=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=s&&t>n&&(n=t,r=i.x<i.next.x?i:i.next,t===s))return r}i=i.next}while(i!==e);if(!r)return null;const a=r,u=r.x,l=r.y;let h,c=1/0;i=r;do{s>=i.x&&i.x>=u&&s!==i.x&&y(o<l?s:n,o,u,l,o<l?n:s,o,i.x,i.y)&&(h=Math.abs(o-i.y)/(s-i.x),M(i,t)&&(h<c||h===c&&(i.x>r.x||i.x===r.x&&p(r,i)))&&(r=i,c=h)),i=i.next}while(i!==a);return r}(t,e);if(!r)return e;const i=E(r,t);return s(i,i.next),s(r,r.next)}function p(t,e){return x(t.prev,t,e.prev)<0&&x(e.next,t,t.next)<0}function f(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function m(t){let e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function y(t,e,r,i,n,s,o,a){return(n-o)*(e-a)>=(t-o)*(s-a)&&(t-o)*(i-a)>=(r-o)*(e-a)&&(r-o)*(s-a)>=(n-o)*(i-a)}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&b(r,r.next,t,e))return!0;r=r.next}
vendor: 5,844 bytes, line 2
2while(r!==t);return!1}(t,e)&&(M(t,e)&&M(e,t)&&function(t,e){let r=t,i=!1;const n=(t.x+e.x)/2,s=(t.y+e.y)/2;do{r.y>s!=r.next.y>s&&r.next.y!==r.y&&n<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)&&(x(t.prev,t,e.prev)||x(t,e.prev,e))||v(t,e)&&x(t.prev,t,t.next)>0&&x(e.prev,e,e.next)>0)}function x(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function b(t,e,r,i){const n=_(x(t,e,r)),s=_(x(t,e,i)),o=_(x(r,i,t)),a=_(x(r,i,e));return n!==s&&o!==a||!(0!==n||!w(t,r,e))||!(0!==s||!w(t,i,e))||!(0!==o||!w(r,t,i))||!(0!==a||!w(r,e,i))}function w(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function _(t){return t>0?1:t<0?-1:0}function M(t,e){return x(t.prev,t,t.next)<0?x(t,e,t.next)>=0&&x(t,t.prev,e)>=0:x(t,e,t.prev)<0||x(t,t.next,e)<0}function E(t,e){const r=new A(t.i,t.x,t.y),i=new A(e.i,e.x,e.y),n=t.next,s=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,s.next=i,i.prev=s,i}function T(t,e,r,i){const n=new A(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}},9776:(t,e,r)=>{"use strict";r.r(e),r.d(e,{ShapeUtils:()=>n});var i=r(6782);class n{static area(t){const e=t.length;let r=0;for(let i=e-1,n=0;n<e;i=n++)r+=t[i].x*t[n].y-t[n].x*t[i].y;return.5*r}static isClockWise(t){return n.area(t)<0}static triangulateShape(t,e){const r=[],n=[],a=[];s(t),o(r,t);let u=t.length;e.forEach(s);for(let t=0;t<e.length;t++)n.push(u),u+=e[t].length,o(r,e[t]);const l=i.Earcut.triangulate(r,n);for(let t=0;t<l.length;t+=3)a.push(l.slice(t,t+3));return a}}function s(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function o(t,e){for(let r=0;r<e.length;r++)t.push(e[r].x),t.push(e[r].y)}},2754:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Box3:()=>n});var i=r(6815);class n{constructor(t=new i.Vector3(1/0,1/0,1/0),e=new i.Vector3(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,r=t.length;e<r;e+=3)this.expandByPoint(o.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,r=t.count;e<r;e++)this.expandByPoint(o.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,r=t.length;e<r;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const r=o.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.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(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){if(t.updateWorldMatrix(!1,!1),void 0!==t.boundingBox)null===t.boundingBox&&t.computeBoundingBox(),a.copy(t.boundingBox),a.applyMatrix4(t.matrixWorld),this.union(a);else{const r=t.geometry;if(void 0!==r)if(e&&void 0!==r.attributes&&void 0!==r.attributes.position){const e=r.attributes.position;for(let r=0,i=e.count;r<i;r++)o.fromBufferAttribute(e,r).applyMatrix4(t.matrixWorld),this.expandByPoint(o)}else null===r.boundingBox&&r.computeBoundingBox(),a.copy(r.boundingBox),a.applyMatrix4(t.matrixWorld),this.union(a)}const r=t.children;for(let t=0,i=r.length;t<i;t++)this.expandByObject(r[t],e);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,o),o.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,r;return t.normal.x>0?(e=t.normal.x*this.min.x,r=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,r=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,r+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,r+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,r+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,r+=t.normal.z*this.min.z),e<=-t.constant&&r>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(f),m.subVectors(this.max,f),u.subVectors(t.a,f),l.subVectors(t.b,f),h.subVectors(t.c,f),c.subVectors(l,u),d.subVectors(h,l),p.subVectors(u,h);let e=[0,-c.z,c.y,0,-d.z,d.y,0,-p.z,p.y,c.z,0,-c.x,d.z,0,-d.x,p.z,0,-p.x,-c.y,c.x,0,-d.y,d.x,0,-p.y,p.x,0];return!!x(e,u,l,h,m)&&(e=[1,0,0,0,1,0,0,0,1],!!x(e,u,l,h,m)&&(y.crossVectors(c,d),e=[y.x,y.y,y.z],x(e,u,l,h,m)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,o).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radiu
2s=.5*this.getSize(o).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(s[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),s[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),s[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),s[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),s[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),s[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),s[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),s[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(s)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const s=[new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3],o=new i.Vector3,a=new n,u=new i.Vector3,l=new i.Vector3,h=new i.Vector3,c=new i.Vector3,d=new i.Vector3,p=new i.Vector3,f=new i.Vector3,m=new i.Vector3,y=new i.Vector3,g=new i.Vector3;function x(t,e,r,i,n){for(let s=0,o=t.length-3;s<=o;s+=3){g.fromArray(t,s);const o=n.x*Math.abs(g.x)+n.y*Math.abs(g.y)+n.z*Math.abs(g.z),a=e.dot(g),u=r.dot(g),l=i.dot(g);if(Math.max(-Math.max(a,u,l),Math.min(a,u,l))>o)return!1}return!0}},3096:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Color:()=>g});var i=r(3334),n=r(6271),s=r(8955);function o(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}
2function a(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const u=(new s.V).fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),l=(new s.V).fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]),h={[n.GUF]:t=>t,[n.KI_]:t=>t.convertSRGBToLinear(),[n.ntt]:function(t){return t.convertSRGBToLinear().applyMatrix3(l)}},c={[n.GUF]:t=>t,[n.KI_]:t=>t.convertLinearToSRGB(),[n.ntt]:function(t){return t.applyMatrix3(u).convertLinearToSRGB()}},d={enabled:!0,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!t},get workingColorSpace(){return n.GUF},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,e,r){if(!1===this.enabled||e===r||!e||!r)return t;const i=h[e],n=c[r];if(void 0===i||void 0===n)throw new Error(`Unsupported color space conversion, "${e}" to "${r}".`);return n(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}},p={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},f={h:0,s:0,l:0},m={h:0,s:0,l:0};function y(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+6*(e-t)*(2/3-r):t}class g{constructor(t,e,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,void 0===e&&void 0===r?this.set(t):this.setRGB(t,e,r)}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=n.KI_){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,d.toWorkingColorSpace(this,e),this}setRGB(t,e,r,i=d.workingColorSpace){return this.r=t,this.g=e,this.b=r,d.toWorkingColorSpace(this,i),this}setHSL(t,e,r,n=d.workingColorSpace){if(t=(0,i.euclideanModulo)(t,1),e=(0,i.clamp)(e,0,1),r=(0,i.clamp)(r,0,1),0===e)this.r=this.g=this.b=r;else{const i=r<=.5?r*(1+e):r+e-r*e,n=2*r-i;this.r=y(n,i,t+1/3),this.g=y(n,i,t),this.b=y(n,i,t-1/3)}return d.toWorkingColorSpace(this,n),this}setStyle(t,e=n.KI_){function r(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\\w+)\\(([^\\)]*)\\)/.exec(t)){let n;const s=i[1],o=i[2];switch(s){case"rgb":case"rgba":if(n=/^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(o))return r(n[4]),this.setRGB(Math.min(255,parseInt(n[1],10))/255,Math.min(255,parseInt(n[2],10))/255,Math.min(255,parseInt(n[3],10))/255,e);if(n=/^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(o))return r(n[4]),this.setRGB(Math.min(100,parseInt(n[1],10))/100,Math.min(100,parseInt(n[2],10))/100,Math.min(100,parseInt(n[3],10))/100,e);break;case"hsl":case"hsla":if(n=/^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(o))return r(n[4]),this.setHSL(parseFloat(n[1])/360,parseFloat(n[2])/100,parseFloat(n[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\\#([A-Fa-f\\d]+)$/.exec(t)){const r=i[1],n=r.length;if(3===n)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(6===n)return this.setHex(parseInt(r,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=n.KI_){const r=p[t.toLowerCase()];return void 0!==r?this.setHex(r,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=o(t.r),this.g=o(t.g),this.b=o(t.b),this}copyLinearToSRGB(t){return this.r=a(t.r),this.g=a(t.g),this.b=a(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=n.KI_){return d.fromWorkingColorSpace(x.copy(this),t),65536
2*Math.round((0,i.clamp)(255*x.r,0,255))+256*Math.round((0,i.clamp)(255*x.g,0,255))+Math.round((0,i.clamp)(255*x.b,0,255))}getHexString(t=n.KI_){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=d.workingColorSpace){d.fromWorkingColorSpace(x.copy(this),e);const r=x.r,i=x.g,n=x.b,s=Math.max(r,i,n),o=Math.min(r,i,n);let a,u;const l=(o+s)/2;if(o===s)a=0,u=0;else{const t=s-o;switch(u=l<=.5?t/(s+o):t/(2-s-o),s){case r:a=(i-n)/t+(i<n?6:0);break;case i:a=(n-r)/t+2;break;case n:a=(r-i)/t+4}a/=6}return t.h=a,t.s=u,t.l=l,t}getRGB(t,e=d.workingColorSpace){return d.fromWorkingColorSpace(x.copy(this),e),t.r=x.r,t.g=x.g,t.b=x.b,t}getStyle(t=n.KI_){d.fromWorkingColorSpace(x.copy(this),t);const e=x.r,r=x.g,i=x.b;return t!==n.KI_?`color(${t} ${e.toFixed(3)} ${r.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*r)},${Math.round(255*i)})`}offsetHSL(t,e,r){return this.getHSL(f),f.h+=t,f.s+=e,f.l+=r,this.setHSL(f.h,f.s,f.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,r){return this.r=t.r+(e.r-t.r)*r,this.g=t.g+(e.g-t.g)*r,this.b=t.b+(e.b-t.b)*r,this}lerpHSL(t,e){this.getHSL(f),t.getHSL(m);const r=(0,i.lerp)(f.h,m.h,e),n=(0,i.lerp)(f.s,m.s,e),s=(0,i.lerp)(f.l,m.l,e);return this.setHSL(r,n,s),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,r=this.g,i=this.b,n=t.elements;return this.r=n[0]*e+n[3]*r+n[6]*i,this.g=n[1]*e+n[4]*r+n[7]*i,this.b=n[2]*e+n[5]*r+n[8]*i,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const x=new g;g.NAMES=p},414:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Line3:()=>a});var i=r(6815),n=r(3334);const s=new i.Vector3,o=new i.Vector3;class a{constructor(t=new i.Vector3,e=new i.Vector3){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){s.subVectors(t,this.start),o.subVectors(this.end,this.start);const r=o.dot(o);let i=o.dot(s)/r;return e&&(i=n.clamp(i,0,1)),i}closestPointToPoint(t,e,r){const i=this.closestPointToPointParameter(t,e);return this.delta(r).multiplyScalar(i).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}},3334:(t,e,r)=>{"use strict";r.r(e),r.d(e,{DEG2RAD:()=>s,MathUtils:()=>P,RAD2DEG:()=>o,ceilPowerOfTwo:()=>E,clamp:()=>u,damp:()=>p,degToRad:()=>w,denormalize:()=>A,euclideanModulo:()=>l,floorPowerOfTwo:()=>T,generateUUID:()=>a,inverseLerp:()=>c,isPowerOfTwo:()=>M,lerp:()=>d,mapLinear:()=>h,normalize:()=>z,pingpong:()=>f,radToDeg:()=>_,randFloat:()=>x,randFloatSpread:()=>v,randInt:()=>g,seededRandom:()=>b,setQuaternionFromProperEuler:()=>S,smootherstep:()=>y,smoothstep:()=>m});const i=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","5
25","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let n=1234567;const s=Math.PI/180,o=180/Math.PI;function a(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,r=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(i[255&t]+i[t>>8&255]+i[t>>16&255]+i[t>>24&255]+"-"+i[255&e]+i[e>>8&255]+"-"+i[e>>16&15|64]+i[e>>24&255]+"-"+i[63&r|128]+i[r>>8&255]+"-"+i[r>>16&255]+i[r>>24&255]+i[255&n]+i[n>>8&255]+i[n>>16&255]+i[n>>24&255]).toLowerCase()}function u(t,e,r){return Math.max(e,Math.min(r,t))}function l(t,e){return(t%e+e)%e}function h(t,e,r,i,n){return i+(t-e)*(n-i)/(r-e)}function c(t,e,r){return t!==e?(r-t)/(e-t):0}function d(t,e,r){return(1-r)*t+r*e}function p(t,e,r,i){return d(t,e,1-Math.exp(-r*i))}function f(t,e=1){return e-Math.abs(l(t,2*e)-e)}function m(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*(3-2*t)}function y(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*t*(t*(6*t-15)+10)}function g(t,e){return t+Math.floor(Math.random()*(e-t+1))}function x(t,e){return t+Math.random()*(e-t)}function v(t){return t*(.5-Math.random())}function b(t){void 0!==t&&(n=t);let e=n+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}function w(t){return t*s}function _(t){return t*o}function M(t){return!(t&t-1)&&0!==t}function E(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function T(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function S(t,e,r,i,n){const s=Math.cos,o=Math.sin,a=s(r/2),u=o(r/2),l=s((e+i)/2),h=o((e+i)/2),c=s((e-i)/2),d=o((e-i)/2),p=s((i-e)/2),f=o((i-e)/2);switch(n){case"XYX":t.set(a*h,u*c,u*d,a*l);break;case"YZY":t.set(u*d,a*h,u*c,a*l);break;case"ZXZ":t.set(u*c,u*d,a*h,a*l);break;case"XZX":t.set(a*h,u*f,u*p,a*l);break;case"YXY":t.set(u*p,a*h,u*f,a*l);break;case"ZYZ":t.set(u*f,u*p,a*h,a*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+n)}}function A(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function z(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const P={DEG2RAD:s,RAD2DEG:o,generateUUID:a,clamp:u,euclideanModulo:l,mapLinear:h,inverseLerp:c,lerp:d,damp:p,pingpong:f,smoothstep:m,smootherstep:y,randInt:g,randFloat:x,randFloatSpread:v,seededRandom:b,degToRad:w,radToDeg:_,isPowerOfTwo:M,ceilPowerOfTwo:E,floorPowerOfTwo:T,setQuaternionFromProperEuler:S,normalize:z,denormalize:A}},8955:(t,e,r)=>{"use strict";r.d(e,{V:()=>i});class i{constructor(){i.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(t,e,r,i,n,s,o,a,u){const l=this.elements;return l[0]=t,l[1]=i,l[2]=o,l[3]=e,l[4]=n,l[5]=a,l[6]=r,l[7]=s,l[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,r=t.elements;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],this}extractBasis(t,e,r){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const r=t.elements,i=e.elements,n=this.elements,s=r[0],o=r[3],a=r[6],u=r[1],l=r[4],h=r[7],c=r[2],d=r[5],p=r[8],f=i[0],m=i[3],y=i[6],g=i[1],x=i[4],v=i[7],b=i[2],w=i[5],_=i[8];
vendor: 4,386 bytes, line 2
2return n[0]=s*f+o*g+a*b,n[3]=s*m+o*x+a*w,n[6]=s*y+o*v+a*_,n[1]=u*f+l*g+h*b,n[4]=u*m+l*x+h*w,n[7]=u*y+l*v+h*_,n[2]=c*f+d*g+p*b,n[5]=c*m+d*x+p*w,n[8]=c*y+d*v+p*_,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],r=t[1],i=t[2],n=t[3],s=t[4],o=t[5],a=t[6],u=t[7],l=t[8];return e*s*l-e*o*u-r*n*l+r*o*a+i*n*u-i*s*a}invert(){const t=this.elements,e=t[0],r=t[1],i=t[2],n=t[3],s=t[4],o=t[5],a=t[6],u=t[7],l=t[8],h=l*s-o*u,c=o*a-l*n,d=u*n-s*a,p=e*h+r*c+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=h*f,t[1]=(i*u-l*r)*f,t[2]=(o*r-i*s)*f,t[3]=c*f,t[4]=(l*e-i*a)*f,t[5]=(i*n-o*e)*f,t[6]=d*f,t[7]=(r*a-u*e)*f,t[8]=(s*e-r*n)*f,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,r,i,n,s,o){const a=Math.cos(n),u=Math.sin(n);return this.set(r*a,r*u,-r*(a*s+u*o)+s+t,-i*u,i*a,-i*(-u*s+a*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(n.makeScale(t,e)),this}rotate(t){return this.premultiply(n.makeRotation(-t)),this}translate(t,e){return this.premultiply(n.makeTranslation(t,e)),this}makeTranslation(t,e){return this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),r=Math.sin(t);return this.set(e,-r,0,r,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,r=t.elements;for(let t=0;t<9;t++)if(e[t]!==r[t])return!1;return!0}fromArray(t,e=0){for(let r=0;r<9;r++)this.elements[r]=t[r+e];return this}toArray(t=[],e=0){const r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}const n=new i},8333:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Matrix4:()=>n});var i=r(6815);class n{constructor(){n.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(t,e,r,i,n,s,o,a,u,l,h,c,d,p,f,m){const y=this.elements;return y[0]=t,y[4]=e,y[8]=r,y[12]=i,y[1]=n,y[5]=s,y[9]=o,y[13]=a,y[2]=u,y[6]=l,y[10]=h,y[14]=c,y[3]=d,y[7]=p,y[11]=f,y[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 n).fromArray(this.elements)}copy(t){const e=this.elements,r=t.elements;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],this}copyPosition(t){const e=this.elements,r=t.elements;return e[12]=r[12],e[13]=r[13],e[14]=r[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,r){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(t,e,r){return this.set(t.x,e.x,r.x,0,t.y,e.y,r.y,0,t.z,e.z,r.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,r=t.elements,i=1/s.setFromMatrixColumn(t,0).length(),n=1/s.setFromMatrixColumn(t,1).length(),o=1/s.setFromMatrixColumn(t,2).length();return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=0,e[4]=r[4]*n,e[5]=r[5]*n,e[6]=r[6]*n,e[7]=0,e[8]=r[8]*o,e[9]=r[9]*o,e[10]=r[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,r=t.x,i=t.y,n=t.z,s=Math.cos(r),o=Math.sin(r),a=Math.cos(i),u=Math.sin(i),l=Math.cos(n),h=Math.sin(n);if("XYZ"===t.order){const t=s*l,r=s*h,i=o*l,n=o*h;e[0]=a*l,e[4]=-a*h,e[8]=u,e[1]=r+i*u,e[5]=t-n*u,e[9]=-o*a,e[2]=n-t*u,e[6]=i+r*u,e[10]=s*a}else if("YXZ"===t.order){const t=a*l,r=a*h,i=u*l,n=u*h;e[0]=t+n*o,e[4]=i*o-r,e[8]=s*u,e[1]=s*h,e[5]=s*l,e[9]=-o,e[2]=r*o-i,e[6]=n+t*o,e[10]=s*a}else if("ZXY"===t.order){const t=a*l,r=a*h,i=u*l,n=u*h;e[0]=t-n*o,e[4]=-s*h,e[8]=i+r*o,e[1]=r+i*o,e[5]=s*l,e[9]=n-t*o,e[2]=-s*u,e[6]=o,e[10]=s*a}else if("ZYX"===t.order){const t=s*l,r=s*h,i=o*l,n=o*h;e[0]=a*l,e[4]=i*u-r,e[8]=t*u+n,e[1]=a*h,e[5]=n*u+t,e[9]=r*u-i,e[2]=-u,e[6]=o*a,e[10]=s*a}else if("YZX"===t.order){const t=s*a,r=s*u,i=o*a,n=o*u;e[0]=a*l,e[4]=n-t*h,e[8]=i*h+r,e[1]=h,e[5]=s*l,e[9]=-o*l,e[2]=-u*l,e[6]=r*h+i,e[10]=t-n*h}
vendor: 9,685 bytes, line 2
2else if("XZY"===t.order){const t=s*a,r=s*u,i=o*a,n=o*u;e[0]=a*l,e[4]=-h,e[8]=u*l,e[1]=t*h+n,e[5]=s*l,e[9]=r*h-i,e[2]=i*h-r,e[6]=o*l,e[10]=n*h+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(a,t,u)}lookAt(t,e,r){const i=this.elements;return c.subVectors(t,e),0===c.lengthSq()&&(c.z=1),c.normalize(),l.crossVectors(r,c),0===l.lengthSq()&&(1===Math.abs(r.z)?c.x+=1e-4:c.z+=1e-4,c.normalize(),l.crossVectors(r,c)),l.normalize(),h.crossVectors(c,l),i[0]=l.x,i[4]=h.x,i[8]=c.x,i[1]=l.y,i[5]=h.y,i[9]=c.y,i[2]=l.z,i[6]=h.z,i[10]=c.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const r=t.elements,i=e.elements,n=this.elements,s=r[0],o=r[4],a=r[8],u=r[12],l=r[1],h=r[5],c=r[9],d=r[13],p=r[2],f=r[6],m=r[10],y=r[14],g=r[3],x=r[7],v=r[11],b=r[15],w=i[0],_=i[4],M=i[8],E=i[12],T=i[1],S=i[5],A=i[9],z=i[13],P=i[2],L=i[6],O=i[10],C=i[14],k=i[3],j=i[7],V=i[11],I=i[15];return n[0]=s*w+o*T+a*P+u*k,n[4]=s*_+o*S+a*L+u*j,n[8]=s*M+o*A+a*O+u*V,n[12]=s*E+o*z+a*C+u*I,n[1]=l*w+h*T+c*P+d*k,n[5]=l*_+h*S+c*L+d*j,n[9]=l*M+h*A+c*O+d*V,n[13]=l*E+h*z+c*C+d*I,n[2]=p*w+f*T+m*P+y*k,n[6]=p*_+f*S+m*L+y*j,n[10]=p*M+f*A+m*O+y*V,n[14]=p*E+f*z+m*C+y*I,n[3]=g*w+x*T+v*P+b*k,n[7]=g*_+x*S+v*L+b*j,n[11]=g*M+x*A+v*O+b*V,n[15]=g*E+x*z+v*C+b*I,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],r=t[4],i=t[8],n=t[12],s=t[1],o=t[5],a=t[9],u=t[13],l=t[2],h=t[6],c=t[10],d=t[14];return t[3]*(+n*a*h-i*u*h-n*o*c+r*u*c+i*o*d-r*a*d)+t[7]*(+e*a*d-e*u*c+n*s*c-i*s*d+i*u*l-n*a*l)+t[11]*(+e*u*h-e*o*d-n*s*h+r*s*d+n*o*l-r*u*l)+t[15]*(-i*o*l-e*a*h+e*o*c+i*s*h-r*s*c+r*a*l)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,r){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=r),this}invert(){const t=this.elements,e=t[0],r=t[1],i=t[2],n=t[3],s=t[4],o=t[5],a=t[6],u=t[7],l=t[8],h=t[9],c=t[10],d=t[11],p=t[12],f=t[13],m=t[14],y=t[15],g=h*m*u-f*c*u+f*a*d-o*m*d-h*a*y+o*c*y,x=p*c*u-l*m*u-p*a*d+s*m*d+l*a*y-s*c*y,v=l*f*u-p*h*u+p*o*d-s*f*d-l*o*y+s*h*y,b=p*h*a-l*f*a-p*o*c+s*f*c+l*o*m-s*h*m,w=e*g+r*x+i*v+n*b;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const _=1/w;return t[0]=g*_,t[1]=(f*c*n-h*m*n-f*i*d+r*m*d+h*i*y-r*c*y)*_,t[2]=(o*m*n-f*a*n+f*i*u-r*m*u-o*i*y+r*a*y)*_,t[3]=(h*a*n-o*c*n-h*i*u+r*c*u+o*i*d-r*a*d)*_,t[4]=x*_,t[5]=(l*m*n-p*c*n+p*i*d-e*m*d-l*i*y+e*c*y)*_,t[6]=(p*a*n-s*m*n-p*i*u+e*m*u+s*i*y-e*a*y)*_,t[7]=(s*c*n-l*a*n+l*i*u-e*c*u-s*i*d+e*a*d)*_,t[8]=v*_,t[9]=(p*h*n-l*f*n-p*r*d+e*f*d+l*r*y-e*h*y)*_,t[10]=(s*f*n-p*o*n+p*r*u-e*f*u-s*r*y+e*o*y)*_,t[11]=(l*o*n-s*h*n-l*r*u+e*h*u+s*r*d-e*o*d)*_,t[12]=b*_,t[13]=(l*f*i-p*h*i+p*r*c-e*f*c-l*r*m+e*h*m)*_,t[14]=(p*o*i-s*f*i-p*r*a+e*f*a+s*r*m-e*o*m)*_,t[15]=(s*h*i-l*o*i+l*r*a-e*h*a-s*r*c+e*o*c)*_,this}scale(t){const e=this.elements,r=t.x,i=t.y,n=t.z;return e[0]*=r,e[4]*=i,e[8]*=n,e[1]*=r,e[5]*=i,e[9]*=n,e[2]*=r,e[6]*=i,e[10]*=n,e[3]*=r,e[7]*=i,e[11]*=n,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],r=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,r,i))}makeTranslation(t,e,r){return this.set(1,0,0,t,0,1,0,e,0,0,1,r,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),r=Math.sin(t);return this.set(1,0,0,0,0,e,-r,0,0,r,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),r=Math.sin(t);return this.set(e,0,r,0,0,1,0,0,-r,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),r=Math.sin(t);return this.set(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const r=Math.cos(e),i=Math.sin(e),n=1-r,s=t.x,o=t.y,a=t.z,u=n*s,l=n*o;return this.set(u*s+r,u*o-i*a,u*a+i*o,0,u*o+i*a,l*o+r,l*a-i*s,0,u*a-i*o,l*a+i*s,n*a*a+r,0,0,0,0,1),this}makeScale(t,e,r){return this.set(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1),this}makeShear(t,e,r,i,n,s){return this.set(1,r,n,0,t,1,s,0,e,i,1,0,0,0,0,1),this}compose(t,e,r){const i=this.elements,n=e._x,s=e._y,o=e._z,a=e._w,u=n+n,l=s+s,h=o+o,c=n*u,d=n*l,p=n*h,f=s*l,m=s*h,y=o*h,g=a*u,x=a*l,v=a*h,b=r.x,w=r.y,_=r.z;return i[0]=(1-(f+y))*b,i[1]=(d+v)*b,i[2]=(p-x)*b,i[3]=0,i[4]=(d-v)*w,i[5]=(1-(c+y))*w,i[6]=(m+g)*w,i[7]=0,i[8]=(p+x)*_,i[9]=(m-g)*_,i[10]=(1-(c+f))*_,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,r){const i=this.elements;let n=s.set(i[0],i[1],i[2]).length();const a=s.set(i[4],i[5],i[6]).length(),u=s.set(i[8],i[9],i[10]).length();this.determinant()<0&&(n=-n),t.x=i[12],t.y=i[13],t.z=i[14],o.copy(this);const l=1/n,h=1/a,c=1/u;return o.elements[0]*=l,o.elements[1]*=l,o.elements[2]*=l,o.elements[4]*=h,o.elements[5]*=h,o.elements[6]*=h,o.elements[8]*=c,o.elements[9]*=c,o.elements[10]*=c,e.setFromRotationMatrix(o),r.x=n,r.y=a,r.z=u,this}makePerspective(t,e,r,i,n,s){const o=this.elements,a=2*n/(e-t),u=2*n/(r-i),l=(e+t)/(e-t),h=(r+i)/(r-i),c=-(s+n)/(s-n),d=-2*s*n/(s-n);return o[0]=a,o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=u,o[9]=h,o[13]=0,o[2]=0,o[6]=0,o[10]=c,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,e,r,i,n,s){const o=this.elements,a=1/(e-t),u=1/(r-i),l=1/(s-n),h=(e+t)*a,c=(r+i)*u,d=(s+n)*l;return o[0]=2*a,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*u,o[9]=0,o[13]=-c,o[2]=0,o[6]=0,o[10]=-2*l,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){const e=this.elements,r=t.elements;for(let t=0;t<16;t++)if(e[t]!==r[t])return!1;return!0}fromArray(t,e=0){for(let r=0;r<16;r++)this.elements[r]=t[r+e];return this}toArray(t=[],e=0){const r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t[e+9]=r[9],t[e+10]=r[10],t[e+11]=r[11],t[e+12]=r[12],t[e+13]=r[13],t[e+14]=r[14],t[e+15]=r[15],t}}const s=new i.Vector3,o=new n,a=new i.Vector3(0,0,0),u=new i.Vector3(1,1,1),l=new i.Vector3,h=new i.Vector3,c=new i.Vector3},9747:(t,e,r)=>{"use strict";r.d(e,{_:()=>n});var i=r(3334);class n{constructor(t=0,e=0,r=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=r,this._w=i}static slerpFlat(t,e,r,i,n,s,o){let a=r[i+0],u=r[i+1],l=r[i+2],h=r[i+3];const c=n[s+0],d=n[s+1],p=n[s+2],f=n[s+3];if(0===o)return t[e+0]=a,t[e+1]=u,t[e+2]=l,void(t[e+3]=h);if(1===o)return t[e+0]=c,t[e+1]=d,t[e+2]=p,void(t[e+3]=f);if(h!==f||a!==c||u!==d||l!==p){let t=1-o;const e=a*c+u*d+l*p+h*f,r=e>=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const n=Math.sqrt(i),s=Math.atan2(n,e*r);t=Math.sin(t*s)/n,o=Math.sin(o*s)/n}const n=o*r;if(a=a*t+c*n,u=u*t+d*n,l=l*t+p*n,h=h*t+f*n,t===1-o){const t=1/Math.sqrt(a*a+u*u+l*l+h*h);a*=t,u*=t,l*=t,h*=t}}t[e]=a,t[e+1]=u,t[e+2]=l,t[e+3]=h}static multiplyQuaternionsFlat(t,e,r,i,n,s){const o=r[i],a=r[i+1],u=r[i+2],l=r[i+3],h=n[s],c=n[s+1],d=n[s+2],p=n[s+3];return t[e]=o*p+l*h+a*d-u*c,t[e+1]=a*p+l*c+u*h-o*d,t[e+2]=u*p+l*d+o*c-a*h,t[e+3]=l*p-o*h-a*c-u*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,r,i){return this._x=t,this._y=e,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){const r=t._x,i=t._y,n=t._z,s=t._order,o=Math.cos,a=Math.sin,u=o(r/2),l=o(i/2),h=o(n/2),c=a(r/2),d=a(i/2),p=a(n/2);switch(s){case"XYZ":this._x=c*l*h+u*d*p,this._y=u*d*h-c*l*p,this._z=u*l*p+c*d*h,this._w=u*l*h-c*d*p;break;case"YXZ":this._x=c*l*h+u*d*p,this._y=u*d*h-c*l*p,this._z=u*l*p-c*d*h,this._w=u*l*h+c*d*p;break;case"ZXY":this._x=c*l*h-u*d*p,this._y=u*d*h+c*l*p,this._z=u*l*p+c*d*h,this._w=u*l*h-c*d*p;break;case"ZYX":this._x=c*l*h-u*d*p,this._y=u*d*h+c*l*p,this._z=u*l*p-c*d*h,this._w=u*l*h+c*d*p;break;case"YZX":this._x=c*l*h+u*d*p,this._y=u*d*h+c*l*p,this._z=u*l*p-c*d*h,this._w=u*l*h-c*d*p;break;case"XZY":this._x=c*l*h-u*d*p,this._y=u*d*h-c*l*p,this._z=u*l*p+c*d*h,this._w=u*l*h+c*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const r=e/2,i=Math.sin(r);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,r=e[0],i=e[4],n=e[8],s=e[1],o=e[5],a=e[9],u=e[2],l=e[6],h=e[10],c=r+o+h;if(c>0){const t=.5/Math.sqrt(c+1);this._w=.25/t,this._x=(l-a)*t,this._y=(n-u)*t,this._z=(s-i)*t}else if(r>o&&r>h){const t=2*Math.sqrt(1+r-o-h);this._w=(l-a)/t,this._x=.25*t,this._y=(i+s)/t,this._z=(n+u)/t}else if(o>h){const t=2*Math.sqrt(1+o-r-h);this._w=(n-u)/t,this._x=(i+s)/t,this._y=.25*t,this._z=(a+l)/t}else{const t=2*Math.sqrt(1+h-r-o);this._w=(s-i)/t,this._x=(n+u)/t,this._y=(a+l)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let r=t.dot(e)+1;return r<Number.EPSILON?(r=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=r):(this._x=0,this._y=-t.z,this._z=t.y,this._w=r)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=r),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(i.clamp(this.dot(t),-1,1)))}rotateTowards(t,e){const r=this.angleTo(t);if(0===r)return this;const i=Math.min(1,e/r);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}
vendor: 4,345 bytes, line 2
2conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const r=t._x,i=t._y,n=t._z,s=t._w,o=e._x,a=e._y,u=e._z,l=e._w;return this._x=r*l+s*o+i*u-n*a,this._y=i*l+s*a+n*o-r*u,this._z=n*l+s*u+r*a-i*o,this._w=s*l-r*o-i*a-n*u,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const r=this._x,i=this._y,n=this._z,s=this._w;let o=s*t._w+r*t._x+i*t._y+n*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=s,this._x=r,this._y=i,this._z=n,this;const a=1-o*o;if(a<=Number.EPSILON){const t=1-e;return this._w=t*s+e*this._w,this._x=t*r+e*this._x,this._y=t*i+e*this._y,this._z=t*n+e*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(a),l=Math.atan2(u,o),h=Math.sin((1-e)*l)/u,c=Math.sin(e*l)/u;return this._w=s*h+this._w*c,this._x=r*h+this._x*c,this._y=i*h+this._y*c,this._z=n*h+this._z*c,this._onChangeCallback(),this}slerpQuaternions(t,e,r){return this.copy(t).slerp(e,r)}random(){const t=Math.random(),e=Math.sqrt(1-t),r=Math.sqrt(t),i=2*Math.PI*Math.random(),n=2*Math.PI*Math.random();return this.set(e*Math.cos(i),r*Math.sin(n),r*Math.cos(n),e*Math.sin(i))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}},5448:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Vector2:()=>n});var i=r(3334);class n{constructor(t=0,e=0){n.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,r=this.y,i=t.elements;return this.x=i[0]*e+i[3]*r+i[6],this.y=i[1]*e+i[4]*r+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(e,r)))}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}
vendor: 12,197 bytes, line 2
2round(){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(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const r=this.dot(t)/e;return Math.acos(i.clamp(r,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,r=this.y-t.y;return e*e+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const r=Math.cos(e),i=Math.sin(e),n=this.x-t.x,s=this.y-t.y;return this.x=n*r-s*i+t.x,this.y=n*i+s*r+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}},6815:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Vector3:()=>s});var i=r(3334),n=r(9747);class s{constructor(t=0,e=0,r=0){s.prototype.isVector3=!0,this.x=t,this.y=e,this.z=r}set(t,e,r){return void 0===r&&(r=this.z),this.x=t,this.y=e,this.z=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(a.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(a.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,r=this.y,i=this.z,n=t.elements;return this.x=n[0]*e+n[3]*r+n[6]*i,this.y=n[1]*e+n[4]*r+n[7]*i,this.z=n[2]*e+n[5]*r+n[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,r=this.y,i=this.z,n=t.elements,s=1/(n[3]*e+n[7]*r+n[11]*i+n[15]);return this.x=(n[0]*e+n[4]*r+n[8]*i+n[12])*s,this.y=(n[1]*e+n[5]*r+n[9]*i+n[13])*s,this.z=(n[2]*e+n[6]*r+n[10]*i+n[14])*s,this}applyQuaternion(t){const e=this.x,r=this.y,i=this.z,n=t.x,s=t.y,o=t.z,a=t.w,u=a*e+s*i-o*r,l=a*r+o*e-n*i,h=a*i+n*r-s*e,c=-n*e-s*r-o*i;return this.x=u*a+c*-n+l*-o-h*-s,this.y=l*a+c*-s+h*-n-u*-o,this.z=h*a+c*-o+u*-s-l*-n,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,r=this.y,i=this.z,n=t.elements;return this.x=n[0]*e+n[4]*r+n[8]*i,this.y=n[1]*e+n[5]*r+n[9]*i,this.z=n[2]*e+n[6]*r+n[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(e,r)))}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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,this.z=t.z+(e.z-t.z)*r,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const r=t.x,i=t.y,n=t.z,s=e.x,o=e.y,a=e.z;return this.x=i*a-n*o,this.y=n*s-r*a,this.z=r*o-i*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const r=t.dot(this)/e;return this.copy(t).multiplyScalar(r)}projectOnPlane(t){return o.copy(this).projectOnVector(t),this.sub(o)}reflect(t){return this.sub(o.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const r=this.dot(t)/e;return Math.acos(i.clamp(r,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return e*e+r*r+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,r){const i=Math.sin(e)*t;return this.x=i*Math.sin(r),this.y=Math.cos(e)*t,this.z=i*Math.cos(r),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,r){return this.x=t*Math.sin(e),this.y=r,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),r=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=r,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=2*(Math.random()-.5),e=Math.random()*Math.PI*2,r=Math.sqrt(1-t**2);return this.x=r*Math.cos(e),this.y=r*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const o=new s,a=new n._},6577:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Vector4:()=>i});class i{constructor(t=0,e=0,r=0,n=1){i.prototype.isVector4=!0,this.x=t,this.y=e,this.z=r,this.w=n}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,r,i){return this.x=t,this.y=e,this.z=r,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){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: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,r=this.y,i=this.z,n=this.w,s=t.elements;return this.x=s[0]*e+s[4]*r+s[8]*i+s[12]*n,this.y=s[1]*e+s[5]*r+s[9]*i+s[13]*n,this.z=s[2]*e+s[6]*r+s[10]*i+s[14]*n,this.w=s[3]*e+s[7]*r+s[11]*i+s[15]*n,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,r,i,n;const s=.01,o=.1,a=t.elements,u=a[0],l=a[4],h=a[8],c=a[1],d=a[5],p=a[9],f=a[2],m=a[6],y=a[10];if(Math.abs(l-c)<s&&Math.abs(h-f)<s&&Math.abs(p-m)<s){if(Math.abs(l+c)<o&&Math.abs(h+f)<o&&Math.abs(p+m)<o&&Math.abs(u+d+y-3)<o)return this.set(1,0,0,0),this;e=Math.PI;const t=(u+1)/2,a=(d+1)/2,g=(y+1)/2,x=(l+c)/4,v=(h+f)/4,b=(p+m)/4;return t>a&&t>g?t<s?(r=0,i=.707106781,n=.707106781):(r=Math.sqrt(t),i=x/r,n=v/r):a>g?a<s?(r=.707106781,i=0,n=.707106781):(i=Math.sqrt(a),r=x/i,n=b/i):g<s?(r=.707106781,i=.707106781,n=0):(n=Math.sqrt(g),r=v/n,i=b/n),this.set(r,i,n,e),this}let g=Math.sqrt((m-p)*(m-p)+(h-f)*(h-f)+(c-l)*(c-l));return Math.abs(g)<.001&&(g=1),this.x=(m-p)/g,this.y=(h-f)/g,this.z=(c-l)/g,this.w=Math.acos((u+d+y-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(e,r)))}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}
2round(){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(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,this.z=t.z+(e.z-t.z)*r,this.w=t.w+(e.w-t.w)*r,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),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}}}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var r=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t].call(r.exports,r,r.exports,__webpack_require__),r.exports}__webpack_require__.d=(t,e)=>{for(var r in e)__webpack_require__.o(e,r)&&!__webpack_require__.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";const t=__webpack_require__(1509);t.OmvTileDecoderService.start(),t.OmvTilerService.start()})()})();',(()=>{var __webpack_modules__={3577:(t,e,i)=>{const r=i(5133);var n=i(5218),o=i(6918);o.util.Long=r,o.configure(),t.exports=n},5218:(t,e,i)=>{var r,n,o,s=i(6918),a=s.Reader,l=s.util,c=s.roots.default||(s.roots.default={});c.com=((o={}).mapbox=((n={}).pb=((r={}).Tile=function(){function t(t){if(this.layers=[],t)for(var e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}var e,i;return t.prototype.layers=l.emptyArray,t.decode=function(t,e){t instanceof a||(t=a.create(t));for(var i=void 0===e?t.len:t.pos+e,r=new c.com.mapbox.pb.Tile;t.pos<i;){var n=t.uint32();n>>>3==3?(r.layers&&r.layers.length||(r.layers=[]),r.layers.push(c.com.mapbox.pb.Tile.Layer.decode(t,t.uint32()))):t.skipType(7&n)}return r},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.fromObject=function(t){if(t instanceof c.com.mapbox.pb.Tile)return t;var e=new c.com.mapbox.pb.Tile;if(t.layers){if(!Array.isArray(t.layers))throw TypeError(".com.mapbox.pb.Tile.layers: array expected");e.layers=[];for(var i=0;i<t.layers.length;++i){if("object"!=typeof t.layers[i])throw TypeError(".com.mapbox.pb.Tile.layers: object expected");e.layers[i]=c.com.mapbox.pb.Tile.Layer.fromObject(t.layers[i])}}return e},t.toObject=function(t,e){e||(e={});var i={};if((e.arrays||e.defaults)&&(i.layers=[]),t.layers&&t.layers.length){i.layers=[];for(var r=0;r<t.layers.length;++r)i.layers[r]=c.com.mapbox.pb.Tile.Layer.toObject(t.layers[r],e)}return i},t.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},t.GeomType=(e={},(i=Object.create(e))[e[0]="UNKNOWN"]=0,i[e[1]="POINT"]=1,i[e[2]="LINESTRING"]=2,i[e[3]="POLYGON"]=3,i),t.Value=function(){function t(t){if(t)for(var e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return t.prototype.stringValue="",t.prototype.floatValue=0,t.prototype.doubleValue=0,t.prototype.intValue=l.Long?l.Long.fromBits(0,0,!1):0,t.prototype.uintValue=l.Long?l.Long.fromBits(0,0,!0):0,t.prototype.sintValue=l.Long?l.Long.fromBits(0,0,!1):0,t.prototype.boolValue=!1,t.decode=function(t,e){t instanceof a||(t=a.create(t));for(var i=void 0===e?t.len:t.pos+e,r=new c.com.mapbox.pb.Tile.Value;t.pos<i;){var n=t.uint32();switch(n>>>3){case 1:r.stringValue=t.string();break;case 2:r.floatValue=t.float();break;case 3:r.doubleValue=t.double();break;case 4:r.intValue=t.int64();break;case 5:r.uintValue=t.uint64();break;case 6:r.sintValue=t.sint64();break;case 7:r.boolValue=t.bool();break;default:t.skipType(7&n)}}return r},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.fromObject=function(t){if(t instanceof c.com.mapbox.pb.Tile.Value)return t;var e=new c.com.mapbox.pb.Tile.Value;return null!=t.stringValue&&(e.stringValue=String(t.stringValue)),null!=t.floatValue&&(e.floatValue=Number(t.floatValue)),null!=t.doubleValue&&(e.doubleValue=Number(t.doubleValue)),null!=t.intValue&&(l.Long?(e.intValue=l.Long.fromValue(t.intValue)).unsigned=!1:"string"==typeof t.intValue?e.intValue=parseInt(t.intValue,10):"number"==typeof t.intValue?e.intValue=t.intValue:"object"==typeof t.intValue&&(e.intValue=new l.LongBits(t.intValue.low>>>0,t.intValue.high>>>0).toNumber())),null!=t.uintValue&&(l.Long?(e.uintValue=l.Long.fromValue(t.uintValue)).unsigned=!0:"string"==typeof t.uintValue?e.uintValue=parseInt(t.uintValue,10):"number"==typeof t.uintValue?e.uintValue=t.uintValue:"object"==typeof t.uintValue&&(e.uintValue=new l.LongBits(t.uintValue.low>>>0,t.uintValue.high>>>0).toNumber(!0))),null!=t.sintValue&&(l.Long?(e.sintValue=l.Long.fromValue(t.sintValue)).unsigned=!1:"string"==typeof t.sintValue?e.sintValue=parseInt(t.sintValue,10):"number"==typeof t.sintValue?e.sintValue=t.sintValue:"object"==typeof t.sintValue&&(e.sintValue=new l.LongBits(t.sintValue.low>>>0,t.sintValue.high>>>0).toNumber())),null!=t.boolValue&&(e.boolValue=Boolean(t.boolValue)),e},t.toObject=function(t,e){e||(e={});var i={};if(e.defaults){if(i.stringValue="",i.floatValue=0,i.doubleValue=0,l.Long){var r=new l.Long(0,0,!1);i.intValue=e.longs===String?r.toString():e.longs===Number?r.toNumber():r}else i.intValue=e.longs===String?"0":0;l.Long?(r=new l.Long(0,0,!0),i.uintValue=e.longs===String?r.toString():e.longs===Number?r.toNumber():r):i.uintValue=e.longs===String?"0":0,l.Long?(r=new l.Long(0,0,!1),i.sintValue=e.longs===String?r.toString():e.longs===Number?r.toNumber():r):i.sintValue=e.longs===String?"0":0,i.boolValue=!1}
vendor: 9,571 bytes, line 2
2return null!=t.stringValue&&t.hasOwnProperty("stringValue")&&(i.stringValue=t.stringValue),null!=t.floatValue&&t.hasOwnProperty("floatValue")&&(i.floatValue=e.json&&!isFinite(t.floatValue)?String(t.floatValue):t.floatValue),null!=t.doubleValue&&t.hasOwnProperty("doubleValue")&&(i.doubleValue=e.json&&!isFinite(t.doubleValue)?String(t.doubleValue):t.doubleValue),null!=t.intValue&&t.hasOwnProperty("intValue")&&("number"==typeof t.intValue?i.intValue=e.longs===String?String(t.intValue):t.intValue:i.intValue=e.longs===String?l.Long.prototype.toString.call(t.intValue):e.longs===Number?new l.LongBits(t.intValue.low>>>0,t.intValue.high>>>0).toNumber():t.intValue),null!=t.uintValue&&t.hasOwnProperty("uintValue")&&("number"==typeof t.uintValue?i.uintValue=e.longs===String?String(t.uintValue):t.uintValue:i.uintValue=e.longs===String?l.Long.prototype.toString.call(t.uintValue):e.longs===Number?new l.LongBits(t.uintValue.low>>>0,t.uintValue.high>>>0).toNumber(!0):t.uintValue),null!=t.sintValue&&t.hasOwnProperty("sintValue")&&("number"==typeof t.sintValue?i.sintValue=e.longs===String?String(t.sintValue):t.sintValue:i.sintValue=e.longs===String?l.Long.prototype.toString.call(t.sintValue):e.longs===Number?new l.LongBits(t.sintValue.low>>>0,t.sintValue.high>>>0).toNumber():t.sintValue),null!=t.boolValue&&t.hasOwnProperty("boolValue")&&(i.boolValue=t.boolValue),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},t}(),t.Feature=function(){function t(t){if(this.tags=[],this.geometry=[],t)for(var e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return t.prototype.id=l.Long?l.Long.fromBits(0,0,!0):0,t.prototype.tags=l.emptyArray,t.prototype.type=0,t.prototype.geometry=l.emptyArray,t.decode=function(t,e){t instanceof a||(t=a.create(t));for(var i=void 0===e?t.len:t.pos+e,r=new c.com.mapbox.pb.Tile.Feature;t.pos<i;){var n=t.uint32();switch(n>>>3){case 1:r.id=t.uint64();break;case 2:if(r.tags&&r.tags.length||(r.tags=[]),2==(7&n))for(var o=t.uint32()+t.pos;t.pos<o;)r.tags.push(t.uint32());else r.tags.push(t.uint32());break;case 3:r.type=t.int32();break;case 4:if(r.geometry&&r.geometry.length||(r.geometry=[]),2==(7&n))for(o=t.uint32()+t.pos;t.pos<o;)r.geometry.push(t.uint32());else r.geometry.push(t.uint32());break;default:t.skipType(7&n)}}return r},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.fromObject=function(t){if(t instanceof c.com.mapbox.pb.Tile.Feature)return t;var e=new c.com.mapbox.pb.Tile.Feature;if(null!=t.id&&(l.Long?(e.id=l.Long.fromValue(t.id)).unsigned=!0:"string"==typeof t.id?e.id=parseInt(t.id,10):"number"==typeof t.id?e.id=t.id:"object"==typeof t.id&&(e.id=new l.LongBits(t.id.low>>>0,t.id.high>>>0).toNumber(!0))),t.tags){if(!Array.isArray(t.tags))throw TypeError(".com.mapbox.pb.Tile.Feature.tags: array expected");e.tags=[];for(var i=0;i<t.tags.length;++i)e.tags[i]=t.tags[i]>>>0}switch(t.type){case"UNKNOWN":case 0:e.type=0;break;case"POINT":case 1:e.type=1;break;case"LINESTRING":case 2:e.type=2;break;case"POLYGON":case 3:e.type=3}if(t.geometry){if(!Array.isArray(t.geometry))throw TypeError(".com.mapbox.pb.Tile.Feature.geometry: array expected");for(e.geometry=[],i=0;i<t.geometry.length;++i)e.geometry[i]=t.geometry[i]>>>0}return e},t.toObject=function(t,e){e||(e={});var i={};if((e.arrays||e.defaults)&&(i.tags=[],i.geometry=[]),e.defaults){if(l.Long){var r=new l.Long(0,0,!0);i.id=e.longs===String?r.toString():e.longs===Number?r.toNumber():r}else i.id=e.longs===String?"0":0;i.type=e.enums===String?"UNKNOWN":0}if(null!=t.id&&t.hasOwnProperty("id")&&("number"==typeof t.id?i.id=e.longs===String?String(t.id):t.id:i.id=e.longs===String?l.Long.prototype.toString.call(t.id):e.longs===Number?new l.LongBits(t.id.low>>>0,t.id.high>>>0).toNumber(!0):t.id),t.tags&&t.tags.length){i.tags=[];for(var n=0;n<t.tags.length;++n)i.tags[n]=t.tags[n]}if(null!=t.type&&t.hasOwnProperty("type")&&(i.type=e.enums===String?c.com.mapbox.pb.Tile.GeomType[t.type]:t.type),t.geometry&&t.geometry.length)for(i.geometry=[],n=0;n<t.geometry.length;++n)i.geometry[n]=t.geometry[n];return i},t.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},t}(),t.Layer=function(){function t(t){if(this.features=[],this.keys=[],this.values=[],t)for(var e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return t.prototype.version=1,t.prototype.name="",t.prototype.features=l.emptyArray,t.prototype.keys=l.emptyArray,t.prototype.values=l.emptyArray,t.prototype.extent=4096,t.decode=function(t,e){t instanceof a||(t=a.create(t));for(var i=void 0===e?t.len:t.pos+e,r=new c.com.mapbox.pb.Tile.Layer;t.pos<i;){var n=t.uint32();switch(n>>>3){case 15:r.version=t.uint32();break;case 1:r.name=t.string();break;case 2:r.features&&r.features.length||(r.features=[]),r.features.push(c.com.mapbox.pb.Tile.Feature.decode(t,t.uint32()));break;case 3:r.keys&&r.keys.length||(r.keys=[]),r.keys.push(t.string());break;case 4:r.values&&r.values.length||(r.values=[]),r.values.push(c.com.mapbox.pb.Tile.Value.decode(t,t.uint32()));break;case 5:r.extent=t.uint32();break;default:t.skipType(7&n)}}if(!r.hasOwnProperty("version"))throw l.ProtocolError("missing required 'version'",{instance:r});if(!r.hasOwnProperty("name"))throw l.ProtocolError("missing required 'name'",{instance:r});return r},t.decodeDelimited=function(t){return t instanceof a||(t=new a(t)),this.decode(t,t.uint32())},t.fromObject=function(t){if(t instanceof c.com.mapbox.pb.Tile.Layer)return t;var e=new c.com.mapbox.pb.Tile.Layer;if(null!=t.version&&(e.version=t.version>>>0),null!=t.name&&(e.name=String(t.name)),t.features){if(!Array.isArray(t.features))throw TypeError(".com.mapbox.pb.Tile.Layer.features: array expected");e.features=[];for(var i=0;i<t.features.length;++i){if("object"!=typeof t.features[i])throw TypeError(".com.mapbox.pb.Tile.Layer.features: object expected");e.features[i]=c.com.mapbox.pb.Tile.Feature.fromObject(t.features[i])}}if(t.keys){if(!Array.isArray(t.keys))throw TypeError(".com.mapbox.pb.Tile.Layer.keys: array expected");for(e.keys=[],i=0;i<t.keys.length;++i)e.keys[i]=String(t.keys[i])}if(t.values){if(!Array.isArray(t.values))throw TypeError(".com.mapbox.pb.Tile.Layer.values: array expected");for(e.values=[],i=0;i<t.values.length;++i){if("object"!=typeof t.values[i])throw TypeError(".com.mapbox.pb.Tile.Layer.values: object expected");e.values[i]=c.com.mapbox.pb.Tile.Value.fromObject(t.values[i])}}return null!=t.extent&&(e.extent=t.extent>>>0),e},t.toObject=function(t,e){e||(e={});var i={};if((e.arrays||e.defaults)&&(i.features=[],i.keys=[],i.values=[]),e.defaults&&(i.name="",i.extent=4096,i.version=1),null!=t.name&&t.hasOwnProperty("name")&&(i.name=t.name),t.features&&t.features.length){i.features=[];for(var r=0;r<t.features.length;++r)i.features[r]=c.com.mapbox.pb.Tile.Feature.toObject(t.features[r],e)}if(t.keys&&t.keys.length)for(i.keys=[],r=0;r<t.keys.length;++r)i.keys[r]=t.keys[r];if(t.values&&t.values.length)for(i.values=[],r=0;r<t.values.length;++r)i.values[r]=c.com.mapbox.pb.Tile.Value.toObject(t.values[r],e);return null!=t.extent&&t.hasOwnProperty("extent")&&(i.extent=t.extent),null!=t.version&&t.hasOwnProperty("version")&&(i.version=t.version),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},t}(),t}(),r),n),o),t.exports=c},7018:t=>{t.exports=function(t,e){for(var i=new Array(arguments.length-1),r=0,n=2,o=!0;n<arguments.length;)i[r++]=arguments[n++];return new Promise(function(n,s){i[r]=function(t){if(o)if(o=!1,t)s(t);else{for(var e=new Array(arguments.length-1),i=0;i<e.length;)e[i++]=arguments[i];n.apply(null,e)}};try{t.apply(e||null,i)}catch(t){o&&(o=!1,s(t))}})}},2647:(t,e)=>{var i=e;i.length=function(t){var e=t.length;if(!e)return 0;for(var i=0;--e%4>1&&"="===t.charAt(e);)++i;return Math.ceil(3*t.length)/4-i};for(var r=new Array(64),n=new Array(123),o=0;o<64;)n[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;i.encode=function(t,e,i){for(var n,o=null,s=[],a=0,l=0;e<i;){var c=t[e++];switch(l){case 0:s[a++]=r[c>>2],n=(3&c)<<4,l=1;break;case 1:s[a++]=r[n|c>>4],n=(15&c)<<2,l=2;break;case 2:s[a++]=r[n|c>>6],s[a++]=r[63&c],l=0}a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),a=0)}return l&&(s[a++]=r[n],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";i.decode=function(t,e,i){for(var r,o=i,a=0,l=0;l<t.length;){var c=t.charCodeAt(l++);if(61===c&&a>1)break;if(void 0===(c=n[c]))throw Error(s);switch(a){case 0:r=c,a=1;break;case 1:e[i++]=r<<2|(48&c)>>4,r=c,a=2;break;case 2:e[i++]=(15&r)<<4|(60&c)>>2,r=c,a=3;break;case 3:e[i++]=(3&r)<<6|c,a=0}}if(1===a)throw Error(s);return i-o},i.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},2922:t=>{function e(){this._listeners={}}t.exports=e,e.prototype.on=function(t,e,i){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:i||this}),this},e.prototype.off=function(t,e){if(void 0===t)this._listeners={};else if(void 0===e)this._listeners[t]=[];else for(var i=this._listeners[t],r=0;r<i.length;)i[r].fn===e?i.splice(r,1):++r;return this},e.prototype.emit=function(t){var e=this._listeners[t];if(e){for(var i=[],r=1;r<arguments.length;)i.push(arguments[r++]);for(r=0;r<e.length;)e[r].fn.apply(e[r++].ctx,i)}return this}},7955:t=>{function e(t){return"undefined"!=typeof Float32Array?function(){var e=new Float32Array([-0]),i=new Uint8Array(e.buffer),r=128===i[3];
vendor: 1,162 bytes, line 2
2function n(t,r,n){e[0]=t,r[n]=i[0],r[n+1]=i[1],r[n+2]=i[2],r[n+3]=i[3]}function o(t,r,n){e[0]=t,r[n]=i[3],r[n+1]=i[2],r[n+2]=i[1],r[n+3]=i[0]}function s(t,r){return i[0]=t[r],i[1]=t[r+1],i[2]=t[r+2],i[3]=t[r+3],e[0]}function a(t,r){return i[3]=t[r],i[2]=t[r+1],i[1]=t[r+2],i[0]=t[r+3],e[0]}t.writeFloatLE=r?n:o,t.writeFloatBE=r?o:n,t.readFloatLE=r?s:a,t.readFloatBE=r?a:s}():function(){function e(t,e,i,r){var n=e<0?1:0;if(n&&(e=-e),0===e)t(1/e>0?0:2147483648,i,r);else if(isNaN(e))t(2143289344,i,r);else if(e>34028234663852886e22)t((n<<31|2139095040)>>>0,i,r);else if(e<11754943508222875e-54)t((n<<31|Math.round(e/1401298464324817e-60))>>>0,i,r);else{var o=Math.floor(Math.log(e)/Math.LN2);t((n<<31|o+127<<23|8388607&Math.round(e*Math.pow(2,-o)*8388608))>>>0,i,r)}}function s(t,e,i){var r=t(e,i),n=2*(r>>31)+1,o=r>>>23&255,s=8388607&r;return 255===o?s?NaN:n*(1/0):0===o?1401298464324817e-60*n*s:n*Math.pow(2,o-150)*(s+8388608)}t.writeFloatLE=e.bind(null,i),t.writeFloatBE=e.bind(null,r),t.readFloatLE=s.bind(null,n),t.readFloatBE=s.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var e=new Float64Array([-0]),i=new Uint8Array(e.buffer),r=128===i[7];
vendor: 2,354 bytes, line 2
2function n(t,r,n){e[0]=t,r[n]=i[0],r[n+1]=i[1],r[n+2]=i[2],r[n+3]=i[3],r[n+4]=i[4],r[n+5]=i[5],r[n+6]=i[6],r[n+7]=i[7]}function o(t,r,n){e[0]=t,r[n]=i[7],r[n+1]=i[6],r[n+2]=i[5],r[n+3]=i[4],r[n+4]=i[3],r[n+5]=i[2],r[n+6]=i[1],r[n+7]=i[0]}function s(t,r){return i[0]=t[r],i[1]=t[r+1],i[2]=t[r+2],i[3]=t[r+3],i[4]=t[r+4],i[5]=t[r+5],i[6]=t[r+6],i[7]=t[r+7],e[0]}function a(t,r){return i[7]=t[r],i[6]=t[r+1],i[5]=t[r+2],i[4]=t[r+3],i[3]=t[r+4],i[2]=t[r+5],i[1]=t[r+6],i[0]=t[r+7],e[0]}t.writeDoubleLE=r?n:o,t.writeDoubleBE=r?o:n,t.readDoubleLE=r?s:a,t.readDoubleBE=r?a:s}():function(){function e(t,e,i,r,n,o){var s=r<0?1:0;if(s&&(r=-r),0===r)t(0,n,o+e),t(1/r>0?0:2147483648,n,o+i);else if(isNaN(r))t(0,n,o+e),t(2146959360,n,o+i);else if(r>17976931348623157e292)t(0,n,o+e),t((s<<31|2146435072)>>>0,n,o+i);else{var a;if(r<22250738585072014e-324)t((a=r/5e-324)>>>0,n,o+e),t((s<<31|a/4294967296)>>>0,n,o+i);else{var l=Math.floor(Math.log(r)/Math.LN2);1024===l&&(l=1023),t(4503599627370496*(a=r*Math.pow(2,-l))>>>0,n,o+e),t((s<<31|l+1023<<20|1048576*a&1048575)>>>0,n,o+i)}}}function s(t,e,i,r,n){var o=t(r,n+e),s=t(r,n+i),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)}t.writeDoubleLE=e.bind(null,i,0,4),t.writeDoubleBE=e.bind(null,r,4,0),t.readDoubleLE=s.bind(null,n,0,4),t.readDoubleBE=s.bind(null,o,4,0)}(),t}function i(t,e,i){e[i]=255&t,e[i+1]=t>>>8&255,e[i+2]=t>>>16&255,e[i+3]=t>>>24}function r(t,e,i){e[i]=t>>>24,e[i+1]=t>>>16&255,e[i+2]=t>>>8&255,e[i+3]=255&t}function n(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function o(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}t.exports=e(e)},8446:module=>{function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}module.exports=inquire},5374:t=>{t.exports=function(t,e,i){var r=i||8192,n=r>>>1,o=null,s=r;return function(i){if(i<1||i>n)return t(i);s+i>r&&(o=t(r),s=0);var a=e.call(o,s,s+=i);return 7&s&&(s=1+(7|s)),a}}},5226:(t,e)=>{var i=e;i.length=function(t){for(var e=0,i=0,r=0;r<t.length;++r)(i=t.charCodeAt(r))<128?e+=1:i<2048?e+=2:55296==(64512&i)&&56320==(64512&t.charCodeAt(r+1))?(++r,e+=4):e+=3;return e},i.read=function(t,e,i){if(i-e<1)return"";for(var r,n=null,o=[],s=0;e<i;
2)(r=t[e++])<128?o[s++]=r:r>191&&r<224?o[s++]=(31&r)<<6|63&t[e++]:r>239&&r<365?(r=((7&r)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++])-65536,o[s++]=55296+(r>>10),o[s++]=56320+(1023&r)):o[s++]=(15&r)<<12|(63&t[e++])<<6|63&t[e++],s>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,o)),s=0);return n?(s&&n.push(String.fromCharCode.apply(String,o.slice(0,s))),n.join("")):String.fromCharCode.apply(String,o.slice(0,s))},i.write=function(t,e,i){for(var r,n,o=i,s=0;s<t.length;++s)(r=t.charCodeAt(s))<128?e[i++]=r:r<2048?(e[i++]=r>>6|192,e[i++]=63&r|128):55296==(64512&r)&&56320==(64512&(n=t.charCodeAt(s+1)))?(r=65536+((1023&r)<<10)+(1023&n),++s,e[i++]=r>>18|240,e[i++]=r>>12&63|128,e[i++]=r>>6&63|128,e[i++]=63&r|128):(e[i++]=r>>12|224,e[i++]=r>>6&63|128,e[i++]=63&r|128);return i-o}},6925:(t,e)=>{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 r(t){return(t=Math.round(t))<0?0:t>255?255:t}function n(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?r(parseFloat(t)/100*255):r(parseInt(t))}function s(t){return"%"===t[t.length-1]?n(parseFloat(t)/100):n(parseFloat(t))}function a(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,n=t.replace(/ /g,"").toLowerCase();if(n in i)return i[n].slice();if("#"===n[0])return 4===n.length?(e=parseInt(n.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===n.length&&(e=parseInt(n.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=n.indexOf("("),c=n.indexOf(")");if(-1!==l&&c+1===n.length){var h=n.substr(0,l),u=n.substr(l+1,c-(l+1)).split(","),p=1;switch(h){case"rgba":if(4!==u.length)return null;p=s(u.pop());case"rgb":return 3!==u.length?null:[o(u[0]),o(u[1]),o(u[2]),p];case"hsla":if(4!==u.length)return null;p=s(u.pop());case"hsl":if(3!==u.length)return null;var d=(parseFloat(u[0])%360+360)%360/360,m=s(u[1]),f=s(u[2]),g=f<=.5?f*(m+1):f+m-f*m,y=2*f-g;return[r(255*a(y,g,d+1/3)),r(255*a(y,g,d)),r(255*a(y,g,d-1/3)),p];default:return null}}return null}}catch(t){}},242:(t,e,i)=>{function r(t,e,i,o){for(var s,a=o,l=i-e>>1,c=i-e,h=t[e],u=t[e+1],p=t[i],d=t[i+1],m=e+3;m<i;m+=3){var f=n(t[m],t[m+1],h,u,p,d);if(f>a)s=m,a=f;else if(f===a){var g=Math.abs(m-l);g<c&&(s=m,c=g)}}a>o&&(s-e>3&&r(t,e,s,o),t[s+2]=a,i-s>3&&r(t,s,i,o))}function n(t,e,i,r,n,o){var s=n-i,a=o-r;if(0!==s||0!==a){var l=((t-i)*s+(e-r)*a)/(s*s+a*a);l>1?(i=n,r=o):l>0&&(i+=s*l,r+=a*l)}return(s=t-i)*s+(a=e-r)*a}function o(t,e,i,r){var n={id:void 0===t?null:t,type:e,geometry:i,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,i=t.type;if("Point"===i||"MultiPoint"===i||"LineString"===i)s(t,e);else if("Polygon"===i||"MultiLineString"===i)for(var r=0;r<e.length;r++)s(t,e[r]);else if("MultiPolygon"===i)for(r=0;r<e.length;r++)for(var n=0;n<e[r].length;n++)s(t,e[r][n])}(n),n}function s(t,e){for(var i=0;i<e.length;i+=3)t.minX=Math.min(t.minX,e[i]),t.minY=Math.min(t.minY,e[i+1]),t.maxX=Math.max(t.maxX,e[i]),t.maxY=Math.max(t.maxY,e[i+1])}function a(t,e,i,r){if(e.geometry){var n=e.geometry.coordinates,s=e.geometry.type,u=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2),p=[],d=e.id;if(i.promoteId?d=e.properties[i.promoteId]:i.generateId&&(d=r||0),"Point"===s)l(n,p);else if("MultiPoint"===s)for(var m=0;m<n.length;m++)l(n[m],p);else if("LineString"===s)c(n,p,u,!1);else if("MultiLineString"===s){if(i.lineMetrics){for(m=0;m<n.length;m++)p=[],c(n[m],p,u,!1),t.push(o(d,"LineString",p,e.properties));return}h(n,p,u,!1)}else if("Polygon"===s)h(n,p,u,!0);else{if("MultiPolygon"!==s){if("GeometryCollection"===s){for(m=0;m<e.geometry.geometries.length;m++)a(t,{id:d,geometry:e.geometry.geometries[m],properties:e.properties},i,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(m=0;m<n.length;m++){var f=[];h(n[m],f,u,!0),p.push(f)}}t.push(o(d,s,p,e.properties))}}function l(t,e){e.push(u(t[0])),e.push(p(t[1])),e.push(0)}function c(t,e,i,n){for(var o,s,a=0,l=0;l<t.length;l++){var c=u(t[l][0]),h=p(t[l][1]);e.push(c),e.push(h),e.push(0),l>0&&(a+=n?(o*h-c*s)/2:Math.sqrt(Math.pow(c-o,2)+Math.pow(h-s,2))),o=c,s=h}var d=e.length-3;e[2]=1,r(e,0,d,i),e[d+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}
vendor: 1,746 bytes, line 2
2function h(t,e,i,r){for(var n=0;n<t.length;n++){var o=[];c(t[n],o,i,r),e.push(o)}}function u(t){return t/360+.5}function p(t){var e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function d(t,e,i,r,n,s,a,l){if(r/=e,s>=(i/=e)&&a<r)return t;if(a<i||s>=r)return null;for(var c=[],h=0;h<t.length;h++){var u=t[h],p=u.geometry,d=u.type,g=0===n?u.minX:u.minY,v=0===n?u.maxX:u.maxY;if(g>=i&&v<r)c.push(u);else if(!(v<i||g>=r)){var _=[];if("Point"===d||"MultiPoint"===d)m(p,_,i,r,n);else if("LineString"===d)f(p,_,i,r,n,!1,l.lineMetrics);else if("MultiLineString"===d)y(p,_,i,r,n,!1);else if("Polygon"===d)y(p,_,i,r,n,!0);else if("MultiPolygon"===d)for(var b=0;b<p.length;b++){var x=[];y(p[b],x,i,r,n,!0),x.length&&_.push(x)}if(_.length){if(l.lineMetrics&&"LineString"===d){for(b=0;b<_.length;b++)c.push(o(u.id,d,_[b],u.tags));continue}"LineString"!==d&&"MultiLineString"!==d||(1===_.length?(d="LineString",_=_[0]):d="MultiLineString"),"Point"!==d&&"MultiPoint"!==d||(d=3===_.length?"Point":"MultiPoint"),c.push(o(u.id,d,_,u.tags))}}}return c.length?c:null}function m(t,e,i,r,n){for(var o=0;o<t.length;o+=3){var s=t[o+n];s>=i&&s<=r&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function f(t,e,i,r,n,o,s){for(var a,l,c=g(t),h=0===n?_:b,u=t.start,p=0;p<t.length-3;p+=3){var d=t[p],m=t[p+1],f=t[p+2],y=t[p+3],x=t[p+4],w=0===n?d:m,S=0===n?y:x,T=!1;s&&(a=Math.sqrt(Math.pow(d-y,2)+Math.pow(m-x,2))),w<i?S>i&&(l=h(c,d,m,y,x,i),s&&(c.start=u+a*l)):w>r?S<r&&(l=h(c,d,m,y,x,r),s&&(c.start=u+a*l)):v(c,d,m,f),S<i&&w>=i&&(l=h(c,d,m,y,x,i),T=!0),S>r&&w<=r&&(l=h(c,d,m,y,x,r),T=!0),!o&&T&&(s&&(c.end=u+a*l),e.push(c),c=g(t)),s&&(u+=a)}var E=t.length-3;d=t[E],m=t[E+1],f=t[E+2],(w=0===n?d:m)>=i&&w<=r&&v(c,d,m,f),E=c.length-3,o&&E>
vendor: 4,522 bytes, line 2
2=3&&(c[E]!==c[0]||c[E+1]!==c[1])&&v(c,c[0],c[1],c[2]),c.length&&e.push(c)}function g(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function y(t,e,i,r,n,o){for(var s=0;s<t.length;s++)f(t[s],e,i,r,n,o,!1)}function v(t,e,i,r){t.push(e),t.push(i),t.push(r)}function _(t,e,i,r,n,o){var s=(o-e)/(r-e);return t.push(o),t.push(i+(n-i)*s),t.push(1),s}function b(t,e,i,r,n,o){var s=(o-i)/(n-i);return t.push(e+(r-e)*s),t.push(o),t.push(1),s}function x(t,e){for(var i=[],r=0;r<t.length;r++){var n,s=t[r],a=s.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)n=w(s.geometry,e);else if("MultiLineString"===a||"Polygon"===a){n=[];for(var l=0;l<s.geometry.length;l++)n.push(w(s.geometry[l],e))}else if("MultiPolygon"===a)for(n=[],l=0;l<s.geometry.length;l++){for(var c=[],h=0;h<s.geometry[l].length;h++)c.push(w(s.geometry[l][h],e));n.push(c)}i.push(o(s.id,a,n,s.tags))}return i}function w(t,e){var i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);for(var r=0;r<t.length;r+=3)i.push(t[r]+e,t[r+1],t[r+2]);return i}function S(t,e){if(t.transformed)return t;var i,r,n,o=1<<t.z,s=t.x,a=t.y;for(i=0;i<t.features.length;i++){var l=t.features[i],c=l.geometry,h=l.type;if(l.geometry=[],1===h)for(r=0;r<c.length;r+=2)l.geometry.push(T(c[r],c[r+1],e,o,s,a));else for(r=0;r<c.length;r++){var u=[];for(n=0;n<c[r].length;n+=2)u.push(T(c[r][n],c[r][n+1],e,o,s,a));l.geometry.push(u)}}return t.transformed=!0,t}function T(t,e,i,r,n,o){return[Math.round(i*(t*r-n)),Math.round(i*(e*r-o))]}function E(t,e,i,r,n){for(var o=e===n.maxZoom?0:n.tolerance/((1<<e)*n.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:i,y:r,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},a=0;a<t.length;a++){s.numFeatures++,M(s,t[a],o,n);var l=t[a].minX,c=t[a].minY,h=t[a].maxX,u=t[a].maxY;l<s.minX&&(s.minX=l),c<s.minY&&(s.minY=c),h>s.maxX&&(s.maxX=h),u>s.maxY&&(s.maxY=u)}return s}function M(t,e,i,r){var n=e.geometry,o=e.type,s=[];if("Point"===o||"MultiPoint"===o)for(var a=0;a<n.length;a+=3)s.push(n[a]),s.push(n[a+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)A(s,n,t,i,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(a=0;a<n.length;a++)A(s,n[a],t,i,"Polygon"===o,0===a);else if("MultiPolygon"===o)for(var l=0;l<n.length;l++){var c=n[l];for(a=0;a<c.length;a++)A(s,c[a],t,i,!0,0===a)}if(s.length){var h=e.tags||null;if("LineString"===o&&r.lineMetrics){for(var u in h={},e.tags)h[u]=e.tags[u];h.mapbox_clip_start=n.start/n.size,h.mapbox_clip_end=n.end/n.size}var p={geometry:s,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:h};null!==e.id&&(p.id=e.id),t.features.push(p)}}function A(t,e,i,r,n,o){var s=r*r;if(r>0&&e.size<(n?s:r))i.numPoints+=e.length/3;else{for(var a=[],l=0;l<e.length;l+=3)(0===r||e[l+2]>s)&&(i.numSimplified++,a.push(e[l]),a.push(e[l+1])),i.numPoints++;n&&function(t,e){for(var i=0,r=0,n=t.length,o=n-2;r<n;o=r,r+=2)i+=(t[r]-t[o])*(t[r+1]+t[o+1]);if(i>0===e)for(r=0,n=t.length;r<n/2;r+=2){var s=t[r],a=t[r+1];t[r]=t[n-2-r],t[r+1]=t[n-1-r],t[n-2-r]=s,t[n-1-r]=a}}(a,o),t.push(a)}}function C(t,e){return new P(t,e)}function P(t,e){var i=(e=this.options=function(t,e){for(var i in e)t[i]=e[i];return t}(Object.create(this.options),e)).debug;if(i&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var r=function(t,e){var i=[];if("FeatureCollection"===t.type)for(var r=0;r<t.features.length;r++)a(i,t.features[r],e,r);else"Feature"===t.type?a(i,t,e):a(i,{geometry:t},e);return i}(t,e);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),r=function(t,e){var i=e.buffer/e.extent,r=t,n=d(t,1,-1-i,i,0,-1,2,e),o=d(t,1,1-i,2+i,0,-1,2,e);return(n||o)&&(r=d(t,1,-i,1+i,0,-1,2,e)||[],n&&(r=x(n,1).concat(r)),o&&(r=r.concat(x(o,-1)))),r}(r,e),r.length&&this.splitTile(r,0,0,0),i&&(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 L(t,e,i){return 32*((1<<t)*i+e)+t}i.r(e),i.d(e,{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}
2,P.prototype.splitTile=function(t,e,i,r,n,o,s){for(var a=[t,e,i,r],l=this.options,c=l.debug;a.length;){r=a.pop(),i=a.pop(),e=a.pop(),t=a.pop();var h=1<<e,u=L(e,i,r),p=this.tiles[u];if(!p&&(c>1&&console.time("creation"),p=this.tiles[u]=E(t,e,i,r,l),this.tileCoords.push({z:e,x:i,y:r}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,i,r,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var m="z"+e;this.stats[m]=(this.stats[m]||0)+1,this.total++}if(p.source=t,n){if(e===l.maxZoom||e===n)continue;var f=1<<n-e;if(i!==Math.floor(o/f)||r!==Math.floor(s/f))continue}else if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue;if(p.source=null,0!==t.length){c>1&&console.time("clipping");var g,y,v,_,b,x,w=.5*l.buffer/l.extent,S=.5-w,T=.5+w,M=1+w;g=y=v=_=null,b=d(t,h,i-w,i+T,0,p.minX,p.maxX,l),x=d(t,h,i+S,i+M,0,p.minX,p.maxX,l),t=null,b&&(g=d(b,h,r-w,r+T,1,p.minY,p.maxY,l),y=d(b,h,r+S,r+M,1,p.minY,p.maxY,l),b=null),x&&(v=d(x,h,r-w,r+T,1,p.minY,p.maxY,l),_=d(x,h,r+S,r+M,1,p.minY,p.maxY,l),x=null),c>1&&console.timeEnd("clipping"),a.push(g||[],e+1,2*i,2*r),a.push(y||[],e+1,2*i,2*r+1),a.push(v||[],e+1,2*i+1,2*r),a.push(_||[],e+1,2*i+1,2*r+1)}}},P.prototype.getTile=function(t,e,i){var r=this.options,n=r.extent,o=r.debug;if(t<0||t>24)return null;var s=1<<t,a=L(t,e=(e%s+s)%s,i);if(this.tiles[a])return S(this.tiles[a],n);o>1&&console.log("drilling down to z%d-%d-%d",t,e,i);for(var l,c=t,h=e,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?(o>1&&console.log("found parent tile z%d-%d-%d",c,h,u),o>1&&console.time("drilling down"),this.splitTile(l.source,c,h,u,t,e,i),o>1&&console.timeEnd("drilling down"),this.tiles[a]?S(this.tiles[a],n):null):null}},5133:t=>{t.exports=i;var e=null;try{e=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(t){}function i(t,e,i){this.low=0|t,this.high=0|e,this.unsigned=!!i}function r(t){return!0===(t&&t.__isLong__)}i.prototype.__isLong__,Object.defineProperty(i.prototype,"__isLong__",{value:!0}),i.isLong=r;var n={},o={};function s(t,e){var i,r,s;return e?(s=0<=(t>>>=0)&&t<256)&&(r=o[t])?r:(i=l(t,(0|t)<0?-1:0,!0),s&&(o[t]=i),i):(s=-128<=(t|=0)&&t<128)&&(r=n[t])?r:(i=l(t,t<0?-1:0,!1),s&&(n[t]=i),i)}function a(t,e){if(isNaN(t))return e?y:g;if(e){if(t<0)return y;if(t>=d)return w}else{if(t<=-m)return S;if(t+1>=m)return x}return t<0?a(-t,e).neg():l(t%p|0,t/p|0,e)}function l(t,e,r){return new i(t,e,r)}i.fromInt=s,i.fromNumber=a,i.fromBits=l;var c=Math.pow;function h(t,e,i){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return g;if("number"==typeof e?(i=e,e=!1):e=!!e,(i=i||10)<2||36<i)throw RangeError("radix");var r;if((r=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return h(t.substring(1),e,i).neg();for(var n=a(c(i,8)),o=g,s=0;s<t.length;s+=8){var l=Math.min(8,t.length-s),u=parseInt(t.substring(s,s+l),i);if(l<8){var p=a(c(i,l));o=o.mul(p).add(a(u))}else o=(o=o.mul(n)).add(a(u))}return o.unsigned=e,o}function u(t,e){return"number"==typeof t?a(t,e):"string"==typeof t?h(t,e):l(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}i.fromString=h,i.fromValue=u;var p=4294967296,d=p*p,m=d/2,f=s(1<<24),g=s(0);i.ZERO=g;var y=s(0,!0);i.UZERO=y;var v=s(1);i.ONE=v;var _=s(1,!0);i.UONE=_;var b=s(-1);i.NEG_ONE=b;var x=l(-1,2147483647,!1);i.MAX_VALUE=x;var w=l(-1,-1,!0);i.MAX_UNSIGNED_VALUE=w;var S=l(0,-2147483648,!1);i.MIN_VALUE=S;var T=i.prototype;T.toInt=function(){return this.unsigned?this.low>>>0:this.low},T.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},T.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(S)){var e=a(t),i=this.div(e),r=i.mul(e).sub(this);return i.toString(t)+r.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var n=a(c(t,6),this.unsigned),o=this,s="";;){var l=o.div(n),h=(o.sub(l.mul(n)).toInt()>>>0).toString(t);if((o=l).isZero())return h+s;for(;h.length<6;)h="0"+h;s=""+h+s}},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(S)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&!(t&1<<e);e--);return 0!=this.high?e+33:e+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(t){return r(t)||(t=u(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},T.eq=T.equals,T.notEquals=function(t){return!this.eq(t)},T.neq=T.notEquals,T.ne=T.notEquals,T.lessThan=function(t){return this.comp(t)<0},T.lt=T.lessThan,T.lessThanOrEqual=function(t){return this.comp(t)<=0},T.lte=T.lessThanOrEqual,T.le=T.lessThanOrEqual,T.greaterThan=function(t){return this.comp(t)>0},T.gt=T.greaterThan,T.greaterThanOrEqual=function(t){return this.comp(t)>=0},T.gte=T.greaterThanOrEqual,T.ge=T.greaterThanOrEqual,T.compare=function(t){if(r(t)||(t=u(t)),this.eq(t))return 0;var e=this.isNegative(),i=t.isNegative();return e&&!i?-1:!e&&i?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},T.comp=T.compare,T.negate=function(){return!this.unsigned&&this.eq(S)?S:this.not().add(v)},T.neg=T.negate,T.add=function(t){r(t)||(t=u(t));var e=this.high>>>16,i=65535&this.high,n=this.low>>>16,o=65535&this.low,s=t.high>>>16,a=65535&t.high,c=t.low>>>16,h=0,p=0,d=0,m=0;return d+=(m+=o+(65535&t.low))>>>16,p+=(d+=n+c)>>>16,h+=(p+=i+a)>>>16,h+=e+s,l((d&=65535)<<16|(m&=65535),(h&=65535)<<16|(p&=65535),this.unsigned)},T.subtract=function(t){return r(t)||(t=u(t)),this.add(t.neg())},T.sub=T.subtract,T.multiply=function(t){if(this.isZero())return g;if(r(t)||(t=u(t)),e)return l(e.mul(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned);if(t.isZero())return g;if(this.eq(S))return t.isOdd()?S:g;if(t.eq(S))return this.isOdd()?S:g;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(f)&&t.lt(f))return a(this.toNumber()*t.toNumber(),this.unsigned);var i=this.high>>>16,n=65535&this.high,o=this.low>>>16,s=65535&this.low,c=t.high>>>16,h=65535&t.high,p=t.low>>>16,d=65535&t.low,m=0,y=0,v=0,_=0;
vendor: 14,619 bytes, line 2
2return v+=(_+=s*d)>>>16,y+=(v+=o*d)>>>16,v&=65535,y+=(v+=s*p)>>>16,m+=(y+=n*d)>>>16,y&=65535,m+=(y+=o*p)>>>16,y&=65535,m+=(y+=s*h)>>>16,m+=i*d+n*p+o*h+s*c,l((v&=65535)<<16|(_&=65535),(m&=65535)<<16|(y&=65535),this.unsigned)},T.mul=T.multiply,T.divide=function(t){if(r(t)||(t=u(t)),t.isZero())throw Error("division by zero");var i,n,o;if(e)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?l((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:g;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return y;if(t.gt(this.shru(1)))return _;o=y}else{if(this.eq(S))return t.eq(v)||t.eq(b)?S:t.eq(S)?v:(i=this.shr(1).div(t).shl(1)).eq(g)?t.isNegative()?v:b:(n=this.sub(t.mul(i)),o=i.add(n.div(t)));if(t.eq(S))return this.unsigned?y:g;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=g}for(n=this;n.gte(t);){i=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(i)/Math.LN2),h=s<=48?1:c(2,s-48),p=a(i),d=p.mul(t);d.isNegative()||d.gt(n);)d=(p=a(i-=h,this.unsigned)).mul(t);p.isZero()&&(p=v),o=o.add(p),n=n.sub(d)}return o},T.div=T.divide,T.modulo=function(t){return r(t)||(t=u(t)),e?l((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},T.mod=T.modulo,T.rem=T.modulo,T.not=function(){return l(~this.low,~this.high,this.unsigned)},T.and=function(t){return r(t)||(t=u(t)),l(this.low&t.low,this.high&t.high,this.unsigned)},T.or=function(t){return r(t)||(t=u(t)),l(this.low|t.low,this.high|t.high,this.unsigned)},T.xor=function(t){return r(t)||(t=u(t)),l(this.low^t.low,this.high^t.high,this.unsigned)},T.shiftLeft=function(t){return r(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?l(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):l(0,this.low<<t-32,this.unsigned)},T.shl=T.shiftLeft,T.shiftRight=function(t){return r(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?l(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):l(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},T.shr=T.shiftRight,T.shiftRightUnsigned=function(t){if(r(t)&&(t=t.toInt()),0==(t&=63))return this;var e=this.high;return t<32?l(this.low>>>t|e<<32-t,e>>>t,this.unsigned):l(32===t?e:e>>>t-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(t){return t?this.toBytesLE():this.toBytesBE()},T.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},T.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},i.fromBytes=function(t,e,r){return r?i.fromBytesLE(t,e):i.fromBytesBE(t,e)},i.fromBytesLE=function(t,e){return new i(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},i.fromBytesBE=function(t,e){return new i(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},6918:(t,e,i)=>{t.exports=i(3729)},3729:(t,e,i)=>{var r=e;function n(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=i(8116),r.BufferWriter=i(1819),r.Reader=i(2461),r.BufferReader=i(9117),r.util=i(1679),r.rpc=i(8082),r.roots=i(575),r.configure=n,n()},2461:(t,e,i)=>{t.exports=l;var r,n=i(1679),o=n.LongBits,s=n.utf8;function a(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function l(t){this.buf=t,this.pos=0,this.len=t.length}var c,h="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new l(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new l(t);throw Error("illegal buffer")},u=function(){return n.Buffer?function(t){return(l.create=function(t){return n.Buffer.isBuffer(t)?new r(t):h(t)})(t)}:h};function p(){var t=new o(0,0),e=0;if(!(this.len-this.pos>4)){for(;e<3;++e){if(this.pos>=this.len)throw a(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*e)>>>0,t}for(;e<4;++e)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(e=0,this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw a(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function d(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}function m(){if(this.pos+8>this.len)throw a(this,8);return new o(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}l.create=u(),l.prototype._slice=n.Array.prototype.subarray||n.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 t=this.uint32();return t>>>1^-(1&t)},l.prototype.bool=function(){return 0!==this.uint32()},l.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return d(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|d(this.buf,this.pos+=4)},l.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var t=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},l.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var t=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},l.prototype.bytes=function(){var t=this.uint32(),e=this.pos,i=this.pos+t;if(i>this.len)throw a(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(e,i):e===i?new this.buf.constructor(0):this._slice.call(this.buf,e,i)},l.prototype.string=function(){var t=this.bytes();return s.read(t,0,t.length)},l.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw a(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},l.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},l._configure=function(t){r=t,l.create=u(),r._configure();var e=n.Long?"toLong":"toNumber";n.merge(l.prototype,{int64:function(){return p.call(this)[e](!1)},uint64:function(){return p.call(this)[e](!0)},sint64:function(){return p.call(this).zzDecode()[e](!1)},fixed64:function(){return m.call(this)[e](!0)},sfixed64:function(){return m.call(this)[e](!1)}})}},9117:(t,e,i)=>{t.exports=o;var r=i(2461);(o.prototype=Object.create(r.prototype)).constructor=o;var n=i(1679);function o(t){r.call(this,t)}o._configure=function(){n.Buffer&&(o.prototype._slice=n.Buffer.prototype.slice)},o.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},o._configure()},575:t=>{t.exports={}},8082:(t,e,i)=>{e.Service=i(7927)},7927:(t,e,i)=>{t.exports=n;var r=i(1679);function n(t,e,i){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(e),this.responseDelimited=Boolean(i)}(n.prototype=Object.create(r.EventEmitter.prototype)).constructor=n,n.prototype.rpcCall=function t(e,i,n,o,s){if(!o)throw TypeError("request must be specified");var a=this;if(!s)return r.asPromise(t,a,e,i,n,o);if(a.rpcImpl)try{return a.rpcImpl(e,i[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),function(t,i){if(t)return a.emit("error",t,e),s(t);if(null!==i){if(!(i instanceof n))try{i=n[a.responseDelimited?"decodeDelimited":"decode"](i)}catch(t){return a.emit("error",t,e),s(t)}return a.emit("data",i,e),s(null,i)}a.end(!0)})}catch(t){return a.emit("error",t,e),void setTimeout(function(){s(t)},0)}else setTimeout(function(){s(Error("already ended"))},0)},n.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},8294:(t,e,i)=>{t.exports=n;var r=i(1679);function n(t,e){this.lo=t>>>0,this.hi=e>>>0}var o=n.zero=new n(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(t){if(0===t)return o;var e=t<0;e&&(t=-t);var i=t>>>0,r=(t-i)/4294967296>>>0;return e&&(r=~r>>>0,i=~i>>>0,++i>4294967295&&(i=0,++r>4294967295&&(r=0))),new n(i,r)},n.from=function(t){if("number"==typeof t)return n.fromNumber(t);if(r.isString(t)){if(!r.Long)return n.fromNumber(parseInt(t,10));t=r.Long.fromString(t)}return t.low||t.high?new n(t.low>>>0,t.high>>>0):o},n.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=1+~this.lo>>>0,i=~this.hi>>>0;return e||(i=i+1>>>0),-(e+4294967296*i)}return this.lo+4294967296*this.hi},n.prototype.toLong=function(t){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var a=String.prototype.charCodeAt;n.fromHash=function(t){return t===s?o:new n((a.call(t,0)|a.call(t,1)<<8|a.call(t,2)<<16|a.call(t,3)<<24)>>>0,(a.call(t,4)|a.call(t,5)<<8|a.call(t,6)<<16|a.call(t,7)<<24)>>>0)},n.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)},n.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},n.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},n.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0===i?0===e?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:i<128?9:10}},1679:function(t,e,i){var r=e;function n(t,e,i){for(var r=Object.keys(e),n=0;n<r.length;++n)void 0!==t[r[n]]&&i||(t[r[n]]=e[r[n]]);return t}function o(t){function e(t,i){if(!(this instanceof e))return new e(t,i);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),i&&n(this,i)}return(e.prototype=Object.create(Error.prototype)).constructor=e,Object.defineProperty(e.prototype,"name",{get:function(){return t}}),e.prototype.toString=function(){return this.name+": "+this.message},e}r.asPromise=i(7018),r.base64=i(2647),r.EventEmitter=i(2922),r.float=i(7955),r.inquire=i(8446),r.utf8=i(5226),r.pool=i(5374),r.LongBits=i(8294),r.isNode=Boolean(void 0!==i.g&&i.g&&i.g.process&&i.g.process.versions&&i.g.process.versions.node),r.global=r.isNode&&i.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},r.isString=function(t){return"string"==typeof t||t instanceof String},r.isObject=function(t){return t&&"object"==typeof t},r.isset=r.isSet=function(t,e){var i=t[e];return!(null==i||!t.hasOwnProperty(e))&&("object"!=typeof i||(Array.isArray(i)?i.length:Object.keys(i).length)>0)},r.Buffer=function(){try{var t=r.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(t){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(t){return"number"==typeof t?r.Buffer?r._Buffer_allocUnsafe(t):new r.Array(t):r.Buffer?r._Buffer_from(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(t){return t?r.LongBits.from(t).toHash():r.LongBits.zeroHash},r.longFromHash=function(t,e){var i=r.LongBits.fromHash(t);return r.Long?r.Long.fromBits(i.lo,i.hi,e):i.toNumber(Boolean(e))},r.merge=n,r.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},r.newError=o,r.ProtocolError=o("ProtocolError"),r.oneOfGetter=function(t){for(var e={},i=0;i<t.length;++i)e[t[i]]=1;return function(){for(var t=Object.keys(this),i=t.length-1;i>-1;--i)if(1===e[t[i]]&&void 0!==this[t[i]]&&null!==this[t[i]])return t[i]}},r.oneOfSetter=function(t){return function(e){for(var i=0;i<t.length;++i)t[i]!==e&&delete this[t[i]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var t=r.Buffer;t?(r._Buffer_from=t.from!==Uint8Array.from&&t.from||function(e,i){return new t(e,i)},r._Buffer_allocUnsafe=t.allocUnsafe||function(e){return new t(e)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},8116:(t,e,i)=>{t.exports=u;var r,n=i(1679),o=n.LongBits,s=n.base64,a=n.utf8;function l(t,e,i){this.fn=t,this.len=e,this.next=void 0,this.val=i}function c(){}function h(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function u(){this.len=0,this.head=new l(c,0,0),this.tail=this.head,this.states=null}var p=function(){return n.Buffer?function(){return(u.create=function(){return new r})()}:function(){return new u}};function d(t,e,i){e[i]=255&t}function m(t,e){this.len=t,this.next=void 0,this.val=e}function f(t,e,i){for(;t.hi;)e[i++]=127&t.lo|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[i++]=127&t.lo|128,t.lo=t.lo>>>7;e[i++]=t.lo}function g(t,e,i){e[i]=255&t,e[i+1]=t>>>8&255,e[i+2]=t>>>16&255,e[i+3]=t>>>24}u.create=p(),u.alloc=function(t){return new n.Array(t)},n.Array!==Array&&(u.alloc=n.pool(u.alloc,n.Array.prototype.subarray)),u.prototype._push=function(t,e,
2i){return this.tail=this.tail.next=new l(t,e,i),this.len+=e,this},m.prototype=Object.create(l.prototype),m.prototype.fn=function(t,e,i){for(;t>127;)e[i++]=127&t|128,t>>>=7;e[i]=t},u.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new m((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},u.prototype.int32=function(t){return t<0?this._push(f,10,o.fromNumber(t)):this.uint32(t)},u.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},u.prototype.uint64=function(t){var e=o.from(t);return this._push(f,e.length(),e)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(t){var e=o.from(t).zzEncode();return this._push(f,e.length(),e)},u.prototype.bool=function(t){return this._push(d,1,t?1:0)},u.prototype.fixed32=function(t){return this._push(g,4,t>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(t){var e=o.from(t);return this._push(g,4,e.lo)._push(g,4,e.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(t){return this._push(n.float.writeFloatLE,4,t)},u.prototype.double=function(t){return this._push(n.float.writeDoubleLE,8,t)};var y=n.Array.prototype.set?function(t,e,i){e.set(t,i)}:function(t,e,i){for(var r=0;r<t.length;++r)e[i+r]=t[r]};u.prototype.bytes=function(t){var e=t.length>>>0;if(!e)return this._push(d,1,0);if(n.isString(t)){var i=u.alloc(e=s.length(t));s.decode(t,i,0),t=i}return this.uint32(e)._push(y,e,t)},u.prototype.string=function(t){var e=a.length(t);return e?this.uint32(e)._push(a.write,e,t):this._push(d,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 t=this.head,e=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=t.next,this.tail=e,this.len+=i),this},u.prototype.finish=function(){for(var t=this.head.next,e=this.constructor.alloc(this.len),i=0;t;)t.fn(t.val,e,i),i+=t.len,t=t.next;return e},u._configure=function(t){r=t,u.create=p(),r._configure()}},1819:(t,e,i)=>{t.exports=o;var r=i(8116);(o.prototype=Object.create(r.prototype)).constructor=o;var n=i(1679);function o(){r.call(this)}function s(t,e,i){t.length<40?n.utf8.write(t,e,i):e.utf8Write?e.utf8Write(t,i):e.write(t,i)}o._configure=function(){o.alloc=n._Buffer_allocUnsafe,o.writeBytesBuffer=n.Buffer&&n.Buffer.prototype instanceof Uint8Array&&"set"===n.Buffer.prototype.set.name?function(t,e,i){e.set(t,i)}:function(t,e,i){if(t.copy)t.copy(e,i,0,t.length);else for(var r=0;r<t.length;)e[i++]=t[r++]}},o.prototype.bytes=function(t){n.isString(t)&&(t=n._Buffer_from(t,"base64"));var e=t.length>>>0;return this.uint32(e),e&&this._push(o.writeBytesBuffer,e,t),this},o.prototype.string=function(t){var e=n.Buffer.byteLength(t);return this.uint32(e),e&&this._push(s,e,t),this},o._configure()},1102:function(t){t.exports=function(){function t(t,r,n,o,s){!function t(i,r,n,o,s){for(;o>n;){if(o-n>600){var a=o-n+1,l=r-n+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);t(i,r,Math.max(n,Math.floor(r-l*h/a+u)),Math.min(o,Math.floor(r+(a-l)*h/a+u)),s)}var p=i[r],d=n,m=o;for(e(i,n,r),s(i[o],p)>0&&e(i,n,o);d<m;){for(e(i,d,m),d++,m--;s(i[d],p)<0;)d++;for(;s(i[m],p)>0;)m--}0===s(i[n],p)?e(i,n,m):e(i,++m,o),m<=r&&(n=m+1),r<=m&&(o=m-1)}}(t,r,n||0,o||t.length-1,s||i)}function e(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function i(t,e){return t<e?-1:t>e?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function n(t,e,i){if(!i)return e.indexOf(t);for(var r=0;r<e.length;r++)if(i(t,e[r]))return r;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,i,r,n){n||(n=m(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var o=e;o<i;o++){var s=t.children[o];a(n,t.leaf?r(s):s)}return n}function a(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}
vendor: 4,303 bytes, line 2
2function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function u(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function d(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function f(e,i,r,n,o){for(var s=[i,r];s.length;)if(!((r=s.pop())-(i=s.pop())<=n)){var a=i+Math.ceil((r-i)/n/2)*n;t(e,a,i,r,o),s.push(i,a,a,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var e=this.data,i=[];if(!d(t,e))return i;for(var r=this.toBBox,n=[];e;){for(var o=0;o<e.children.length;o++){var s=e.children[o],a=e.leaf?r(s):s;d(t,a)&&(e.leaf?i.push(s):p(t,a)?this._all(s,i):n.push(s))}e=n.pop()}return i},r.prototype.collides=function(t){var e=this.data;if(!d(t,e))return!1;for(var i=[];e;){for(var r=0;r<e.children.length;r++){var n=e.children[r],o=e.leaf?this.toBBox(n):n;if(d(t,o)){if(e.leaf||p(t,o))return!0;i.push(n)}}e=i.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var i=this._build(t.slice(),0,t.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 r=this.data;this.data=i,i=r}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=m([]),this},r.prototype.remove=function(t,e){if(!t)return this;for(var i,r,o,s=this.data,a=this.toBBox(t),l=[],c=[];s||l.length;){if(s||(s=l.pop(),r=l[l.length-1],i=c.pop(),o=!0),s.leaf){var h=n(t,s.children,e);if(-1!==h)return s.children.splice(h,1),l.push(s),this._condense(l),this}o||s.leaf||!p(s,a)?r?(i++,s=r.children[i],o=!1):s=null:(l.push(s),c.push(i),i=0,r=s,s=s.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,e){return t.minX-e.minX},r.prototype.compareMinY=function(t,e){return t.minY-e.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},r.prototype._build=function(t,e,i,r){var n,s=i-e+1,a=this._maxEntries;if(s<=a)return o(n=m(t.slice(e,i+1)),this.toBBox),n;r||(r=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,r-1))),(n=m([])).leaf=!1,n.height=r;var l=Math.ceil(s/a),c=l*Math.ceil(Math.sqrt(a));f(t,e,i,c,this.compareMinX);for(var h=e;h<=i;h+=c){var u=Math.min(h+c-1,i);f(t,h,u,l,this.compareMinY);for(var p=h;p<=u;p+=l){var d=Math.min(p+l-1,u);n.children.push(this._build(t,p,d,r-1))}}return o(n,this.toBBox),n},r.prototype._chooseSubtree=function(t,e,i,r){for(;r.push(e),!e.leaf&&r.length-1!==i;){for(var n=1/0,o=1/0,s=void 0,a=0;a<e.children.length;a++){var l=e.children[a],c=h(l),u=(p=t,d=l,(Math.max(d.maxX,p.maxX)-Math.min(d.minX,p.minX))*(Math.max(d.maxY,p.maxY)-Math.min(d.minY,p.minY))-c);u<o?(o=u,n=c<n?c:n,s=l):u===o&&c<n&&(n=c,s=l)}e=s||e.children[0]}var p,d;return e},r.prototype._insert=function(t,e,i){var r=i?t:this.toBBox(t),n=[],o=this._chooseSubtree(r,this.data,e,n);for(o.children.push(t),a(o,r);e>=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(r,n,e)},r.prototype._split=function(t,e){var i=t[e],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);var s=this._chooseSplitIndex(i,n,r),a=m(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},r.prototype._splitRoot=function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,e,i){for(var r,n,o,a,l,c,u,p=1/0,d=1/0,m=e;m<=i-e;m++){var f=s(t,0,m,this.toBBox),g=s(t,m,i,this.toBBox),y=(n=f,o=g,a=Math.max(n.minX,o.minX),l=Math.max(n.minY,o.minY),c=Math.min(n.maxX,o.maxX),u=Math.min(n.maxY,o.maxY),Math.max(0,c-a)*Math.max(0,u-l)),v=h(f)+h(g);y<p?(p=y,r=m,d=v<d?v:d):y===p&&v<d&&(d=v,r=m)}return r||i-e}
2,r.prototype._chooseSplitAxis=function(t,e,i){var r=t.leaf?this.compareMinX:l,n=t.leaf?this.compareMinY:c;this._allDistMargin(t,e,i,r)<this._allDistMargin(t,e,i,n)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,e,i,r){t.children.sort(r);for(var n=this.toBBox,o=s(t,0,e,n),l=s(t,i-e,i,n),c=u(o)+u(l),h=e;h<i-e;h++){var p=t.children[h];a(o,t.leaf?n(p):p),c+=u(o)}for(var d=i-e-1;d>=e;d--){var m=t.children[d];a(l,t.leaf?n(m):m),c+=u(l)}return c},r.prototype._adjustParentBBoxes=function(t,e,i){for(var r=i;r>=0;r--)a(e[r],t)},r.prototype._condense=function(t){for(var e=t.length-1,i=void 0;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},r}()},7769:function(t,e,i){var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}
2),n(i(5185),e),n(i(6406),e),n(i(6114),e),n(i(8934),e),n(i(1072),e),n(i(7259),e),n(i(8284),e),n(i(1017),e),n(i(1370),e),n(i(1216),e),n(i(8131),e)},8152:function(t,e,i){var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(7395),e),n(i(8920),e),n(i(4835),e),n(i(9421),e),n(i(9362),e),n(i(7980),e),n(i(2286),e),n(i(3253),e),n(i(8770),e),n(i(1072),e)},3253:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.scaleHeight=e.getFeatureText=e.getFeatureName=e.getFeatureId=e.getProjectionName=e.getProjection=e.GeometryType=e.getArrayConstructor=void 0;const r=i(2616),n=i(1984),o=i(3561);function s(t,e,i){var r;let n;if(void 0===e&&(e="name"),void 0!==i)for(const o of i)if(n=null!==(r=t.lookup(`${e}:${o}`))&&void 0!==r?r:t.lookup(`${e}_${o}`),"string"==typeof n&&n.length>0)return n;if(n=t.lookup(e),"string"==typeof n)return n}var a;e.getArrayConstructor=function(t){switch(t){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=e.GeometryType||(e.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",e.getProjection=function(t){switch(t){case"mercator":return r.mercatorProjection;case"webMercator":return r.webMercatorProjection;case"sphere":return r.sphereProjection;case"normalizedEquirectangular":return r.normalizedEquirectangularProjection;case"equirectangular":return r.equirectangularProjection;default:throw new Error(`Unknown projection ${t}`)}},e.getProjectionName=function(t){if(t===r.mercatorProjection)return"mercator";if(t===r.webMercatorProjection)return"webMercator";if(t===r.sphereProjection)return"sphere";if(t===r.normalizedEquirectangularProjection)return"normalizedEquirectangular";if(t===r.equirectangularProjection)return"equirectangular";throw new Error("Unknown projection")},e.getFeatureId=function(t){if(void 0===t)return 0;if("string"==typeof t||"number"==typeof t)return t;if(t.hasOwnProperty("$id")){const e=t.$id;if("string"==typeof e||"number"==typeof e)return e}return 0},e.getFeatureName=s,e.getFeatureText=function(t,e,i){const r=t instanceof n.Env?t:t.env;if((0,n.isTextTechnique)(e)||(0,n.isIconTextTechnique)(e)||(0,n.isLineMarkerTechnique)(e)){if(void 0!==e.text)return(0,o.evaluateTechniqueAttr)(t,e.text);if((0,n.isIconTextTechnique)(e)||(0,n.isLineMarkerTechnique)(e))return}return s(r,"name",i)},e.scaleHeight=function(t,e,i){return!(0,o.evaluateTechniqueAttr)(t,e.constantHeight,i<12)}},1072:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isFeatureGeometry=void 0,e.isFeatureGeometry=function(t){const e=t.type;return"Point"===e||"MultiPoint"===e||"LineString"===e||"MultiLineString"===e||"Polygon"===e||"MultiPolygon"===e}},6406:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},7980:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2286:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6114:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.addPolygonEdges=void 0;const r=i(5448),n=new r.Vector2,o=new r.Vector2,s=new r.Vector2,a=new r.Vector2;e.addPolygonEdges=function(t,e,i,r,l,c,h,u){for(let p=0;p<l.length;++p)if(l[p])if(!0===c){const c=e+2*p,d=c+1,m=e+(p+1)%l.length*2,f=m+1;!0===h&&t.push(c,m),t.push(d,f);const g=(0===p?l.length:p)-1;if(l[g])if(void 0!==u){const e=r[p*i],h=r[p*i+1],m=r[(p+1)%l.length*i],f=r[(p+1)%l.length*i+1];n.set(e,h),o.set(m,f),s.set(r[g*i],r[g*i+1]),a.set(n.x,n.y),a.sub(s).normalize().dot(o.sub(n).normalize())<=u&&t.push(c,d)}else t.push(c,d)}else{const i=e+p,r=e+(p+1)%l.length;t.push(i,r)}}},7395:(t,e)=>
2{Object.defineProperty(e,"__esModule",{value:!0})},8920:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getPropertyValue=void 0;const r=i(1984),n=i(4342).LoggerManager.instance.create("PropertyValue");e.getPropertyValue=function(t,e,i){try{return(0,r.getPropertyValue)(t,e,i)}catch(e){return n.error("failed to evaluate expression",JSON.stringify(t),"error",String(e)),null}}},5185:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.makeDecodedTechnique=e.StyleSetEvaluator=void 0;const r=i(1984),n=i(8023),o=i(8797),s=i(8628),a=i(4342),l=i(5535),c=a.LoggerManager.instance.create("StyleSetEvaluator"),h=l.AttrScope.TechniqueGeometry;class u{classify(t){if(t._whenExpr){const e=this.switchStyle(t);t._whenExpr=t._whenExpr.accept(this,void 0),this._style=e}}visitNullLiteralExpr(t,e){return t}visitBooleanLiteralExpr(t,e){return t}visitNumberLiteralExpr(t,e){return t}visitStringLiteralExpr(t,e){return t}visitObjectLiteralExpr(t,e){return t}visitVarExpr(t,e){return t}visitHasAttributeExpr(t,e){return t}visitMatchExpr(t,e){return t}visitCaseExpr(t,e){return t}visitCallExpr(t,e){if("all"===t.op){const e=t.args.map(e=>e.accept(this,t)).filter(t=>void 0!==t);return new n.CallExpr(t.op,e)}if(e){const e=this.matchVarStringComparison(t);if(e){if(void 0===this._style.dataLayer&&"$layer"===e.name)return void(this._style.dataLayer=e.value);if(void 0===this._style._geometryType&&"$geometryType"===e.name)return void(this._style._geometryType=e.value)}}return t}visitLookupExpr(t,e){return this.visitCallExpr(t,e)}visitStepExpr(t,e){return t}visitInterpolateExpr(t,e){return t}matchVarStringComparison(t){if("=="===t.op){const e=t.args[0],i=t.args[1];if(e instanceof n.VarExpr&&i instanceof n.StringLiteralExpr)return{name:e.name,value:i.value};if(i instanceof n.VarExpr&&e instanceof n.StringLiteralExpr)return{name:i.name,value:e.value}}}switchStyle(t){const e=this._style;return this._style=t,e}}class p{constructor(t,e){this.key="",this.set(t,e)}set(t,e,i){let r=!1;if(void 0===t){const e=void 0!==i?i.lookup("$layer"):void 0;t="string"==typeof e?e:void 0}if(this.layer!==t&&(this.layer=t,r=!0),void 0===e){const t=void 0!==i?i.lookup("$geometryType"):void 0;e="string"==typeof t?t:void 0}return this.geometryType!==e&&(this.geometryType=e,r=!0),r&&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 d(t){const e={};for(const i in t){if(!t.hasOwnProperty(i))continue;let r=t[i];"object"==typeof r&&(r.isVector2||r.isVector3||r.isVector4)&&(r=n.LiteralExpr.fromValue(r)),n.Expr.isExpr(r)&&(r=r.toJSON()),e[i]=r}return e}e.StyleSetEvaluator=class{constructor(t){this.m_options=t,this.styleSet=[],this.m_techniques=[],this.m_exprPool=new o.ExprPool,this.m_cachedResults=new Map,this.m_styleConditionClassifier=new u,this.m_subStyleSetCache=new Map,this.m_areCurrentDefinitionsOverrid
2den=!0,this.m_definitionsContainVerbose=!1,this.m_disabledStyles={byId:new Set,byLayer:new Set},this.m_definitionExprCache=new Map,this.m_tmpOptimizedSubSetKey=new p,this.m_emptyEnv=new r.Env,this.m_featureDependencies=["$layer","$geometryType","$zoom"],this.m_nextArrayBufferId=0,this.m_definitions=this.m_options.definitions;for(const t in this.m_definitions)this.m_definitionsContainVerbose||(this.m_definitionsContainVerbose=(0,r.isVerboseDefinition)(this.m_definitions[t]));this.styleSet=this.m_options.styleSet.map(t=>{const e=Object.assign(Object.assign({},t),{_forceCompile:!0});return t.attr&&(e.attr=Object.assign({},t.attr)),e}),function(t){var e;let i=0,r=0;for(const n of t)n._styleIndex=r++,void 0!==n.technique&&void 0===(null===(e=n.attr)||void 0===e?void 0:e.renderOrder)&&(void 0===n.attr?n.attr={renderOrder:i++}:n.attr.renderOrder=i++)}(this.styleSet),this.m_features=this.validateFeatures(this.m_options.features);const e=[];for(const t in this.m_features){const i=this.m_features[t];Object.values(i.modes).forEach(t=>{(null==t?void 0:t.extendedDefinitions)&&Array.prototype.push.apply(e,Object.keys(t.extendedDefinitions))})}this.m_modesDefinitions=new Set(e),this.setEnabledFeatures(t.enabledFeatures)}setEnabledFeatures(t){this.applyFeaturesAndModes(null!=t?t:this.getFeaturesEnabledByDefault())}getFeaturesEnabledByDefault(){const t=[];if(this.m_features)for(const e in this.m_features){const i=this.m_features[e];(null==i?void 0:i.defaultMode)&&t.push({feature:e,mode:i.defaultMode||"none"})}return t}applyFeaturesAndModes(t){if(this.m_disabledStyles.byId.clear(),this.m_disabledStyles.byLayer.clear(),this.resetTechniques(),this.m_areCurrentDefinitionsOverrid
2den&&(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 e in this.m_features){const i=this.m_features[e];if(i){let r;const n=t.find(t=>t.feature===e);n?(r=i.modes[n.mode],r||(r=i.modes.none)):r=i.modes.none,r&&(r.disabledLayers&&r.disabledLayers.forEach(t=>{this.m_disabledStyles.byLayer.add(t)}),r.disabledStyleRules&&r.disabledStyleRules.forEach(t=>{this.m_disabledStyles.byId.add(t)})),this.m_currentDefinitions&&(null==r?void 0:r.extendedDefinitions)&&(this.m_areCurrentDefinitionsOverridden=!0,Object.assign(this.m_currentDefinitions,null==r?void 0:r.extendedDefinitions))}}this.m_definitionExprCache.clear(),this.m_cachedResults.clear(),this.m_subStyleSetCache.clear(),this.compileStyleSet()}validateFeatures(t){const e={};for(const i in t){const r=t[i];null!==r&&(Array.isArray(r.modes)||r.modes&&!r.modes.none?c.error(`The style configuration is invalid. The feature "${i}" modes must be a literal object and have at least the "none" mode.`):e[i]=r)}if(Object.keys(e).length>0)return e}isStyleDisabled(t){if(void 0!==this.m_disabledStyles){if(void 0!==t.layer&&this.m_disabledStyles.byLayer.has(t.layer))return!0;if(void 0!==t.id&&this.m_disabledStyles.byId.has(t.id))return!0}return!1}getMatchingTechniques(t,e,i){if(this.m_previousResult&&this.m_previousEnv&&this.m_featureDependencies.every(e=>{var i;return(null===(i=this.m_previousEnv)||void 0===i?void 0:i.lookup(e))===t.lookup(e)}))return this.m_previousResult;const r=[];this.m_cachedResults.clear();const n=this.m_tmpOptimizedSubSetKey;n.set(e,i,t),this.m_dataLayer=n.layer,this.m_geometryType=n.geometryType,this.m_zoomLevel=t.lookup("$zoom");const o=this.getOptimizedStyleSet(n);for(const e of o)if(this.processStyle(t,e,r))break;return this.m_previousResult=r,this.m_previousEnv=t,r}wantsDataLayer(t){return this.getOptimizedStyleSet(this.m_tmpOptimizedSubSetKey.set(t,void 0)).length>0}wantsFeature(t,e){return this.getOptimizedStyleSet(this.m_tmpOptimizedSubSetKey.set(t,e)).length>0}resetTechniques(){for(const t of this.m_techniques)t._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(d)}getOptimizedStyleSet(t){if(void 0!==t.cachedStyleSet)return t.cachedStyleSet;let e=this.m_subStyleSetCache.get(t.key);return void 0!==e?(t.cachedStyleSet=e,e):(e=this.createPreFilteredStyleSet(t),this.m_subStyleSetCache.set(t.key,e),t.cachedStyleSet=e,e)}createPreFilteredStyleSet(t){const{layer:e,geometryType:i}=t;return this.styleSet.filter(t=>!(void 0!==e&&void 0!==t.dataLayer&&t.dataLayer!==e||void 0!==i&&void 0!==t._geometryType&&t._geometryType!==i))}compileStyleSet(){this.styleSet.forEach(t=>this.compileStyle(t)),this.styleSet.forEach(t=>{this.getOptimizedStyleSet(this.m_tmpOptimizedSubSetKey.set(t.dataLayer,t._geometryType))})}compileStyle(t){var e,i;try{this.compileStyleAttributes(t)}catch(e){c.error("failed to evaluate style rule",t,String(e))}if(void 0!==t.when)try{t._whenExpr=n.Expr.fromJSON(t.when,this.m_currentDefinitions,this.m_definitionExprCache),this.m_styleConditionClassifier.classify(t),void 0!==t._whenExpr&&(t._whenExpr=t._whenExpr.intern(this.m_exprPool));const o=t._whenExpr.dependencies();null==o||o.properties.forEach(t=>{this.m_featureDependencies.includes(t)||this.m_featureDependencies.push(t)}),(0,r.isJsonExpr)(null===(e=t.attr)||void 0===e?void 0:e.minZoomLevel)&&(t._minZoomLevelExpr=n.Expr.fromJSON(t.attr.minZoomLevel,this.m_currentDefinitions).intern(this.m_exprPool)),(0,r.isJsonExpr)(null===(i=t.attr)||void 0===i?void 0:i.maxZoomLevel)&&(t._maxZoomLevelExpr=n.Expr.fromJSON(t.attr.maxZoomLevel,this.m_currentDefinitions).intern(this.m_exprPool))}catch(e){c.error("failed to evaluate expression",JSON.stringify(t.when),String(e))}}processStyle(t,e,i){if(!this.checkZoomLevel(t,e))return!1;if(this.isStyleDisabled(e))return!1;if(void 0!==this.m_dataLayer&&void 0!==e.dataLayer&&e.dataLayer!==this.m_dataLayer)return!1;if(void 0!==this.m_geometryType&&void 0!==e._geometryType&&e._geometryType!==this.m_geometryType)return!1;if(e._whenExpr)try{if(!e._whenExpr.evaluate(t,n.ExprScope.Condition,this.m_cachedResults))return!1}catch(t){return c.error(`failed to evaluate expression '${JSON.stringify(e.when)}': ${t}`),!1}return void 0!==e.technique&&("none"!==e.technique&&i.push(this.getTechniqueForStyleMatch(t,e)),!0===e.final)}checkZoomLevel(t,e){var i,r,o,s,a;const l=this.m_zoomLevel;if(void 0===l||l>=17)return!0;let h=null===(i=e.attr)||void 0===i?void 0:i.minZoomLevel,u=null===(r=e.attr)||void 0===r?void 0:r.maxZoomLevel;if(void 0===h&&void 0===u)return!0;
2if(void 0!==h){if(!1===(null===(o=e._minZoomLevelExpr)||void 0===o?void 0:o.isDynamic()))try{h=e._minZoomLevelExpr.evaluate(t,n.ExprScope.Condition,this.m_cachedResults)}catch(t){c.error(`failed to evaluate expression '${JSON.stringify(e._minZoomLevelExpr)}': ${t}`)}if("number"==typeof h&&l<Math.floor(h))return!1}if(void 0!==(null===(s=e.attr)||void 0===s?void 0:s.maxZoomLevel)){if(!1===(null===(a=e._maxZoomLevelExpr)||void 0===a?void 0:a.isDynamic()))try{u=e._maxZoomLevelExpr.evaluate(t,n.ExprScope.Condition,this.m_cachedResults)}catch(t){c.error(`failed to evaluate expression '${JSON.stringify(e._maxZoomLevelExpr)}': ${t}`)}if("number"==typeof u&&l>=Math.ceil(u))return!1}return!0}getTechniqueForStyleMatch(t,e){let i;if(void 0!==e._dynamicTechniques){const r=this.evaluateTechniqueProperties(e,t),n=this.getDynamicTechniqueKey(e,r);i=e._dynamicTechniques.get(n),void 0===i&&(i=this.createTechnique(e,r),e._dynamicTechniques.set(n,i))}else i=e._staticTechnique,void 0===i&&(e._staticTechnique=i=this.createTechnique(e,[]));return void 0===i._index&&(i._index=this.m_techniques.length,this.m_techniques.push(i)),i}getDynamicTechniqueKey(t,e){const i=e.map(([t,e])=>void 0===e?"U":"object"==typeof e?JSON.stringify(e,(t,e)=>{if(e instanceof ArrayBuffer){let t=e.id;return void 0===t&&(t=e.id=this.m_nextArrayBufferId++),t}return e}):JSON.stringify(e)).join(":");return`${t._styleIndex}:${i}`}compileStyleAttributes(t){var e;if(!t._forceCompile&&(void 0!==t._dynamicTechniqueAttributes||"none"===t.technique))return;t._dynamicTechniqueAttributes=[],t._dynamicFeatureAttributes=[],t._dynamicForwardedAttributes=[],t._staticAttributes=[],t._staticTechnique=void 0,t._dynamicTechniques=void 0;const i=t._dynamicFeatureAttributes,o=t._dynamicTechniqueAttributes,a=t._dynamicForwardedAttributes,u=t._staticAttributes,p=(e,p)=>{if(void 0===p)return;const d=new Set;if((0,r.isJsonExpr)(p)?p=n.Expr.fromJSON(p,this.m_currentDefinitions,this.m_definitionExprCache,d).intern(this.m_exprPool):(0,s.isInterpolatedPropertyDefinition)(p)&&(p=n.Expr.fromJSON((0,s.interpolatedPropertyDefinitionToJsonExpr)(p)).intern(this.m_exprPool)),n.Expr.isExpr(p)){const i=p.dependencies();i.featureState&&("enabled"!==e?c.log("feature-state is not supported in this context"):t._usesFeatureState=!0),0!==i.properties.size||p.isDynamic()||(p=p.evaluate(this.m_emptyEnv))}if(n.Expr.isExpr(p)){const r=function(t,e){var i,r,n;return"extruded-polygon"===t.technique&&"color"===e&&!1!==(null===(i=t.attr)||void 0===i?void 0:i.vertexColors)?h:null!==(n=null===(r=(0,l.getTechniqueAttributeDescriptor)(t.technique,e))||void 0===r?void 0:r.scope)&&void 0!==n?n:h}(t,e),n=p.dependencies();switch(n.properties.forEach(t=>{this.m_featureDependencies.includes(t)||this.m_featureDependencies.push(t)}),r){case l.AttrScope.FeatureGeometry:i.push([e,p]);break;case l.AttrScope.TechniqueGeometry:o.push([e,p]);break;case l.AttrScope.TechniqueRendering:0===n.properties.size?a.push([e,p]):o.push([e,p])}}else null!=p&&u.push([e,p]);for(const e of d.values())if(this.m_modesDefinitions.has(e)){t._forceCompile=!0;break}};t._forceCompile=!1;for(const e in t)t.hasOwnProperty(e)&&(e.startsWith("_")||["when","technique","layer","attr","category","description"].includes(e)||p(e,t[e]));const d=new Map([["category","_category"]]);if(void 0!==t.attr)for(const i in t.attr)t.attr.hasOwnProperty(i)&&p(null!==(e=d.get(i))&&void 0!==e?e:i,t.attr[i]);o.length>0&&(t._dynamicTechniques=new Map)}evaluateTechniqueProperties(t,e){return void 0===t._dynamicTechniqueAttributes?[]:t._dynamicTechniqueAttributes.map(([t,i])=>{try{return[t,i.evaluate(e,n.ExprScope.Value,this.m_cachedResults)]}catch(e){return c.error(`failed to evaluate expression '${i.toJSON()}': ${e}`),[t,null]}})}createTechnique(t,e){var i,n;const o={};if(o.name=t.technique,void 0!==t._staticAttributes)for(const[e,i]of t._staticAttributes)null!==i&&(o[e]=i);for(const[t,i]of e)null!==i&&(o[t]=i);if(void 0!==t._dynamicFeatureAttributes)for(const[e,i]of t._dynamicFeatureAttributes)o[e]=i;if(void 0!==t._dynamicForwardedAttributes)for(const[e,i]of t._dynamicForwardedAttributes)o[e]=i;return o._index=this.m_techniques.length,o._styleIndex=t._styleIndex,void 0!==t.layer&&(o._layer=t.layer),void 0!==t._usesFeatureState&&(o._usesFeatureState=t._usesFeatureState),(0,r.setTechniqueRenderOrderOrPriority)(o,null!==(i=this.m_options.priorities)&&void 0!==i?i:[],null!==(n=this.m_options.labelPriorities)&&void 0!==n?n:[]),this.m_techniques.push(o),o}},e.makeDecodedTechnique=d},3561:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.evaluateTechniqueAttr=void 0;const r=i(1984),n=i(8920);e.evaluateTechniqueAttr=function(t,e,i){if(void 0===e)return i;const o=r.Env.isEnv(t)?(0,n.getPropertyValue)(e,t):(0,n.getPropertyValue)(e,t.env,t.cachedExprResults);return null!=o?o:i}},5535:(t,e)=>{var i;function r(...t){const e={attrDescriptors:{}};for(const i of t)void 0!==i.attrTransparencyColor&&(e.attrTransparencyColor=i.attrTransparencyColor),void 0!==i.attrDescriptors&&(e.attrDescriptors=Object.assign(Object.assign({},e.attrDescriptors),i.attrDescriptors));return e}Object.defineProperty(e,"__esModule",{value:!0}),e.getTechniqueAutomaticAttrs=e.getTechniqueAttributeDescriptor=e.getTechniqueDescriptor=e.AttrScope=void 0,function(t){t[t.FeatureGeometry=0]="FeatureGeometry",t[t.TechniqueGeometry=1]="TechniqueGeometry",t[t.TechniqueRendering=2]="TechniqueRendering"}(i=e.AttrScope||(e.AttrScope={}));const n={attrTransparencyColor:"color",attrDescriptors:{constantHeight:i.FeatureGeometry,visible:i.FeatureGeometry,fadeFar:i.TechniqueRendering,fadeNear:i.TechniqueRendering,transparent:{scope:i.TechniqueRendering,automatic:!0},side:{scope:i.TechniqueRendering,automatic:!0}}},o=r(n,{attrDescriptors:{color:{scope:i.TechniqueRendering,automatic:!0},size:{scope:i.TechniqueRendering,automatic:!0},opacity:{scope:i.TechniqueRendering,automatic:!0}}}),s=r(n,o),a=r(n,o),l=r(n,{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=r(n,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},"dash-gap-color":{scope:i.TechniqueRendering,automatic:!0},"dash-pattern":{scope:i.TechniqueRendering,automatic:!0},"dash-image":{scope:i.TechniqueRendering,automatic:!0},"dash-image-color":{scope:i.TechniqueRendering,automatic:!0}}}),u=r(n,{attrDescriptors:{color:{scope:i.TechniqueRendering,automatic:!0},opacity:{scope:i.TechniqueRendering,automatic:!0},width:i.FeatureGeometry}}),p=r(n,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}}}),d=r(n,{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}}}),m={"extruded-polygon":r(n,{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:d,standard:d,squares:s,circles:a,line:u,segments:u,polygon:p,text:r(n,{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:r(n,{attrDescriptors:{brightness:{scope:i.TechniqueRendering,automatic:!0},gamma:{scope:i.TechniqueRendering,automatic:!0}}})};function f(t){return"string"!=typeof t&&(t=t.name),m[t]}e.getTechniqueDescriptor=f,e.getTechniqueAttributeDescriptor=function(t,e){const i=f(t),r=null==i?void 0:i.attrDescriptors,n=null==r?void 0:r[e];if(void 0!==typeof n)return"object"==typeof n?n:{scope:n}};const g=new Map;e.getTechniqueAutomaticAttrs=function(t){var e;if("string"!=typeof t&&(t=t.name),g.has(t))return g.get(t);
2const i=[],r=null===(e=f(t))||void 0===e?void 0:e.attrDescriptors;if(void 0===r)return i;for(const t in r){if(!r.hasOwnProperty(t))continue;const e=r[t];void 0!==e&&"number"!=typeof e&&!0===e.automatic&&i.push(t)}return g.set(t,i),i}},8934:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ThreeBufferUtils=void 0;const r=i(3253);!function(t){function e(t){if(t instanceof Int8Array)return"int8";if(t instanceof Uint8Array)return"uint8";if(t instanceof Int16Array)return"int16";if(t instanceof Uint16Array)return"uint16";if(t instanceof Int32Array)return"int32";if(t instanceof Uint32Array)return"uint32";if(t instanceof Float32Array)return"float";throw new Error(`Unsupported buffer type ${name}`)}function i(t){const i=t.array;return{name:t.name,buffer:i.buffer,type:e(i),itemCount:t.itemSize,normalized:t.normalized}}t.getBufferElementType=e,t.fromThreeBufferAttribute=i,t.fromThreeInterleavedBufferAttribute=function(t){throw new Error("Not implemented yet")},t.fromThreeBufferGeometry=function(t,e){const n=[],o=Object.getOwnPropertyNames(t.attributes);for(const e of o){const r=i(t.attributes[e]);r.name=e,n.push(r)}const s=null!==t.index?i(t.index):void 0;let a=0;if(void 0!==s)a=null===t.index?0:t.index.count;else{const e=t.attributes.position;if(void 0===e)throw new Error("Missing position attibute to deduce item count");a=e.count}return{type:r.GeometryType.Unspecified,vertexAttributes:n,index:s,groups:[{start:0,count:a,technique:e}]}}}(e.ThreeBufferUtils||(e.ThreeBufferUtils={}))},8770:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},9362:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerDecoderProtocol=e.RequestController=void 0,e.RequestController=class{constructor(t=0,e=new AbortController){this.priority=t,this.abortController=e}get signal(){return this.abortController.signal}abort(){this.abortController.abort()}},function(t){let e,i;!function(t){t.Configuration="configuration"}(e=t.DecoderMessageName||(t.DecoderMessageName={})),t.isConfigurationMessage=function(t){return t&&"string"==typeof t.service&&"string"==typeof t.type&&t.type===e.Configuration},function(t){t.DecodeTileRequest="decode-tile-request",t.TileInfoRequest="tile-info-request"}(i=t.Requests||(t.Requests={})),t.isDecodeTileRequest=function(t){return t&&"string"==typeof t.type&&t.type===i.DecodeTileRequest},t.isTileInfoRequest=function(t){return t&&"string"==typeof t.type&&t.type===i.TileInfoRequest}}(e.WorkerDecoderProtocol||(e.WorkerDecoderProtocol={}))},4835:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerServiceProtocol=void 0,function(t){let e,i;t.WORKER_SERVICE_MANAGER_SERVICE_ID="worker-service-manager",function(t){t.Initialized="initialized",t.Request="request",t.Response="response"}(e=t.ServiceMessageName||(t.ServiceMessageName={})),t.isInitializedMessage=function(t){return t&&"string"==typeof t.service&&"string"==typeof t.type&&t.type===e.Initialized},function(t){t.CreateService="create-service",t.DestroyService="destroy-service"}(i=t.Requests||(t.Requests={})),t.isUnknownServiceError=function(t){return t.message.includes("unknown targetServiceType requested: ")},t.isRequestMessage=function(t){return t&&"string"==typeof t.service&&"string"==typeof t.type&&t.type===e.Request},t.isResponseMessage=function(t){return t&&"string"==typeof t.service&&"string"==typeof t.type&&t.type===e.Response}}(e.WorkerServiceProtocol||(e.WorkerServiceProtocol={}))},9421:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerTilerProtocol=void 0,function(t){let e;!function(t){t.RegisterIndex="register-index",t.UpdateIndex="update-index",t.TileRequest="tile-request"}(e=t.Requests||(t.Requests={})),t.isRegisterIndexRequest=function(t){return t&&"string"==typeof t.type&&t.type===e.RegisterIndex},t.isUpdateIndexRequest=function(t){return t&&"string"==typeof t.type&&t.type===e.UpdateIndex},t.isTileRequest=function(t){return t&&"string"==typeof t.type&&t.type===e.TileRequest}}(e.WorkerTilerProtocol||(e.WorkerTilerProtocol={}))},6892:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6112:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.wrapLineString=e.clipLineString=void 0;const r=i(5448),n=i(6815),o=i(2616),s=i(4342);class a{constructor(t,e,i,n,o){this.isInside=o,this.p0=new r.Vector2(t,e),this.p1=new r.Vector2(i,n)}inside(t){return this.isInside(t)}computeIntersection(t,e){const i=new r.Vector2;return s.Math2D.intersectLines(t.x,t.y,e.x,e.y,this.p0.x,this.p0.y,this.p1.x,this.p1.y,i),i}clipLine(t){const e=t,i=[];t=[],i.push(t);const r=e=>{0!==t.length&&t[t.length-1].equals(e)||t.push(e)};for(let n=0;n<e.length;++n){const o=e[n],s=n>0?e[n-1]:void 0;this.inside(o)?(void 0===s||this.inside(s)||(t.length>0&&(t=[],i.push(t)),r(this.computeIntersection(s,o))),r(o)):void 0!==s&&this.inside(s)&&r(this.computeIntersection(s,o))}return 0===i[i.length-1].length&&(i.length=i.length-1),i}clipLines(t){const e=[];return t.forEach(t=>{this.clipLine(t).forEach(t=>{e.push(t)})}),e}}function l(t,e,i){for(const i of e)t=i.clipLines(t);const r=new n.Vector3,s=[];return t.forEach(t=>{if(0===t.length)return;const e=t.map(({x:t,y:e})=>{r.set(t,e,0);const n=o.webMercatorProjection.unprojectPoint(r);return n.longitude+=i,n});s.push(e)}),s.length>0?s:void 0}e.clipLineString=function(t,e,i,r,n){const o=new a(e,i,e,n,t=>t.x>e),s=new a(e,n,r,n,t=>t.y<n),l=new a(r,n,r,i,t=>t.x<r),c=new a(r,i,e,i,t=>t.y>i);let h=o.clipLine(t);return h=s.clipLines(h),h=l.clipLines(h),h=c.clipLines(h),h},e.wrapLineString=function(t){const e=new n.Vector3,i=[t.map(t=>{const{x:i,y:n}=o.webMercatorProjection.projectPoint(t,e);return new r.Vector2(i,n)})];return{left:l(i,u,360),middle:l(i,h,0),right:l(i,p,-360)}};const c=o.EarthConstants.EQUATORIAL_CIRCUMFERENCE,h=[new a(0,c,0,0,t=>t.x>0),new a(c+0,0,c+0,c,t=>t.x<c+0)],u=[new a(-c-0,c,-c-0,0,t=>t.x>-c-0),new a(0,0,0,c,t=>t.x<0)],p=[new a(c-0,c,c-0,0,t=>t.x>c-0),new a(2*c+0,0,2*c+0,c,t=>t.x<2*c+0)]},2982:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.clipPolygon=e.ClippingEdge=void 0;const r=i(5448);class n{clipPolygon(t,e){const i=t;t=[];const r=e=>{const i=t[t.length-1];(!(null==i?void 0:i.equals(e))||!0===e.isClipped&&!(null==i?void 0:i.isClipped)||!e.isClipped&&!0===(null==i?void 0:i.isClipped))&&t.push(e)};for(let t=0;t<i.length;++t){const n=i[t],o=i[(t+i.length-1)%i.length];if(this.inside(n,e)){if(!this.inside(o,e)){const t=this.computeIntersection(o,n,e);t.isClipped=!0,r(t)}r(n)}else if(this.inside(o,e)){const t=this.computeIntersection(o,n,e);t.isClipped=!0,r(t)}}return t}}e.ClippingEdge=n;const o=[new class extends n{inside(t){return t.y>=0}computeIntersection(t,e){const{x:i,y:n}=t,{x:o,y:s}=e;return new r.Vector2((i*s-n*o)/-(n-s),0).round()}},new class extends n{inside(t,e){return t.x<=e}computeIntersection(t,e,i){const{x:n,y:o}=t,{x:s,y:a}=e;return new r.Vector2(i,(n*a-o*s-(o-a)*-i)/(n-s)).round()}},new class extends n{inside(t,e){return t.y<=e}computeIntersection(t,e,i){const{x:n,y:o}=t,{x:s,y:a}=e;return new r.Vector2((n*a-o*s-(n-s)*i)/-(o-a),i).round()}},new class extends n{inside(t){return t.x>=0}computeIntersection(t,e){const{x:i,y:n}=t,{x:o,y:s}=e;return new r.Vector2(0,(i*s-n*o)/(i-o)).round()}}];e.clipPolygon=function(t,e){if(0===t.length)return t;t[0].equals(t[t.length-1])||(t=[...t,t[0]]);for(const i of o)t=i.clipPolygon(t,e);return t.length<3?[]:t}},6525:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EdgeLengthGeometrySubdivisionModifier=e.SubdivisionMode=void 0;const r=i(6815),n=i(2616),o=i(4342),s=i(3386),a=[new r.Vector3,new r.Vector3];var l;!function(t){t[t.All=0]="All",t[t.NoDiagonals=1]="NoDiagonals"}(l=e.SubdivisionMode||(e.SubdivisionMode={}));class c extends s.SubdivisionModifier{constructor(t,e,i=l.All,r){super(),this.subdivision=t,this.geoBox=e,this.subdivisionMode=i,this.projection=r,(0,o.assert)(r.type===n.ProjectionType.Planar,"EdgeLengthGeometrySubdivisionModifier only supports planar projections");const s=r.projectPoint(e.northEast,a[0]),c=r.projectPoint(e.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)/t,this.m_maxLengthY=(this.m_projectedBox.max.y-this.m_projectedBox.min.y)/t,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(t,e,i){const r=this.shouldSplitEdge(t,e),n=this.shouldSplitEdge(e,i),o=this.shouldSplitEdge(i,t);if(!(r||n||o))return;const s=t.distanceTo(e),a=e.distanceTo(i),l=i.distanceTo(t),c=Math.max(r?s:0,n?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(t,e){switch(this.subdivisionMode){case l.All:return t.y===e.y&&Math.abs(t.x-e.x)>this.m_maxLengthX||t.x===e.x&&Math.abs(t.y-e.y)>this.m_maxLengthY||t.distanceTo(e)>this.m_maxLength;case l.NoDiagonals:return t.y===e.y&&Math.abs(t.x-e.x)>this.m_maxLengthX||t.x===e.x&&Math.abs(t.y-e.y)>this.m_maxLengthY}}}e.EdgeLengthGeometrySubdivisionModifier=c},6189:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.SphericalGeometrySubdivisionModifier=void 0;const r=i(6815),n=i(2616),o=i(3386),s=[new r.Vector3,new r.Vector3,new r.Vector3];class a extends o.SubdivisionModifier{constructor(t,e=n.sphereProjection){super(),this.angle=t,this.projection=e}shouldSplitTriangle(t,e,i){const r=n.sphereProjection.reprojectPoint(this.projection,t,s[0]),o=n.sphereProjection.reprojectPoint(this.projection,e,s[1]),a=n.sphereProjection.reprojectPoint(this.projection,i,s[2]),l=r.angleTo(o),c=o.angleTo(a),h=a.angleTo(r),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")}}}e.SphericalGeometrySubdivisionModifier=a},3386:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SubdivisionModifier=void 0;const r=i(6815),n=new r.Vector3,o=new r.Vector3,s=new r.Vector3;e.SubdivisionModifier=class{constructor(){}modify(t){const e=t.getAttribute("position"),i=Array.from(e.array),r=t.getAttribute("uv"),a=void 0!==r?Array.from(r.array):void 0,l=t.getAttribute("edge"),c=void 0!==l?Array.from(l.array):void 0,h=t.getAttribute("wall"),u=void 0!==h?Array.from(h.array):void 0,p=t.getIndex(),d=Array.from(p.array),m=new Map;function f(t,e){const r=`${Math.min(t,e)}_${Math.max(t,e)}`,l=m.get(r);if(void 0!==l)return l;n.set(i[3*t],i[3*t+1],i[3*t+2]),o.set(i[3*e],i[3*e+1],i[3*e+2]),s.lerpVectors(n,o,.5);const h=i.length/3;return i.push(...s.toArray()),m.set(r,h),void 0!==a&&(n.set(a[2*t],a[2*t+1],0),o.set(a[2*e],a[2*e+1],0),s.lerpVectors(n,o,.5),a.push(s.x,s.y)),void 0!==c&&(c[t]===e?(c.push(e),c[t]=h):c[e]===t?(c.push(t),c[e]=h):c.push(-1)),void 0!==u&&(u[t]===e?(u.push(e),u[t]=h):u[e]===t?(u.push(t),u[e]=h):u.push(-1)),h}const g=[];for(;d.length>=3;){const t=d.shift(),e=d.shift(),r=d.shift();switch(n.set(i[3*t],i[3*t+1],i[3*t+2]),o.set(i[3*e],i[3*e+1],i[3*e+2]),s.set(i[3*r],i[3*r+1],i[3*r+2]),this.shouldSplitTriangle(n,o,s)){case 0:{const i=f(t,e);d.push(t,i,r,i,e,r);break}case 1:{const i=f(e,r);d.push(t,e,i,t,i,r);break}case 2:{const i=f(r,t);d.push(t,e,i,i,e,r);break}case void 0:g.push(t,e,r);break;default:throw new Error("failed to subdivide the given geometry")}}return e.array=e.array instanceof Float32Array?new Float32Array(i):new Float64Array(i),e.count=i.length/e.itemSize,e.needsUpdate=!0,t.setIndex(g),void 0!==a&&(r.array=new Float32Array(a),r.count=a.length/r.itemSize,r.needsUpdate=!0),void 0!==c&&(l.array=new Float32Array(c),l.count=c.length/l.itemSize,l.needsUpdate=!0),t}}},3997:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.wrapLineString=void 0;var r=i(6112);Object.defineProperty(e,"wrapLineString",{enumerable:!0,get:function(){return r.wrapLineString}})},8965:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.wrapPolygon=void 0;const r=i(5448),n=i(6815),o=i(2616),s=i(4342),a=i(2982);class l extends a.ClippingEdge{constructor(t,e,i){super(),this.isInside=i,this.p0=(new r.Vector2).fromArray(t),this.p1=(new r.Vector2).fromArray(e)}inside(t,e){return this.isInside(t)}computeIntersection(t,e,i){const n=new r.Vector2;return s.Math2D.intersectLines(t.x,t.y,e.x,e.y,this.p0.x,this.p0.y,this.p1.x,this.p1.y,n),n}}const c=o.EarthConstants.EQUATORIAL_CIRCUMFERENCE,h=.05*c,u=[new l([0-h,c],[0-h,0],t=>t.x>0-h),new l([c+h,0],[c+h,c],t=>t.x<c+h)],p=[new l([-c-h,c],[-c-h,0],t=>t.x>-c-h),new l([0+h,0],[0+h,c],t=>t.x<0+h)],d=[new l([c-h,c],[c-h,0],t=>t.x>c-h),new l([2*c+h,0],[2*c+h,c],t=>t.x<2*c+h)];function m(t,e,i){for(const i of e)t=i.clipPolygon(t,0);const r=new n.Vector3,s=t.map(({x:t,y:e})=>{r.set(t,e,0);const n=o.webMercatorProjection.unprojectPoint(r);return n.longitude+=i,n});return s.length>0?s:void 0}e.wrapPolygon=function(t){const e=new n.Vector3,i=t.map(t=>{const{x:i,y:n}=o.webMercatorProjection.projectPoint(t,e);return new r.Vector2(i,n)});return{left:m(i,p,360),middle:m(i,u,0),right:m(i,d,-360)}}},2616:function(t,e,i){var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}
2:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(3068),e),n(i(5999),e),n(i(6306),e),n(i(4860),e),n(i(8248),e),n(i(9019),e),n(i(6482),e),n(i(7870),e),n(i(5610),e),n(i(1515),e),n(i(9686),e),n(i(5234),e),n(i(9885),e),n(i(7289),e),n(i(6322),e),n(i(9861),e),n(i(435),e),n(i(9447),e),n(i(7171),e),n(i(3424),e),n(i(4948),e),n(i(6541),e),n(i(7841),e),n(i(2801),e),n(i(6557),e),n(i(4490),e),n(i(2224),e),n(i(1635),e),n(i(1871),e),n(i(2953),e),n(i(1383),e),n(i(9264),e),n(i(58),e),n(i(7523),e),n(i(2683),e),n(i(2334),e)},3068:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GeoBox=void 0;const r=i(3334),n=i(4860);class o{static fromCoordinates(t,e){return new o(t,e)}static fromCenterAndExtents(t,e){return new o(new n.GeoCoordinates(t.latitude-e.latitudeSpan/2,t.longitude-e.longitudeSpan/2),new n.GeoCoordinates(t.latitude+e.latitudeSpan/2,t.longitude+e.longitudeSpan/2))}constructor(t,e){this.southWest=t,this.northEast=e,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 t=.5*(this.south+this.north),{west:e,east:i}=this,{minAltitude:r,altitudeSpan:o}=this;let s;if(void 0!==r&&void 0!==o&&(s=r+.5*o),e<=i)return new n.GeoCoordinates(t,.5*(e+i),s);let a=.5*(360+i+e);return a>360&&(a-=360),new n.GeoCoordinates(t,a,s)}get latitudeSpanInRadians(){return(0,r.degToRad)(this.latitudeSpan)}get longitudeSpanInRadians(){return(0,r.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 t=this.northEast.longitude-this.southWest.longitude;return t<0&&(t+=360),t}get latitudeSpanInDegrees(){return this.latitudeSpan}get longitudeSpanInDegrees(){return this.longitudeSpan}contains(t){if(void 0===t.altitude||void 0===this.minAltitude||void 0===this.maxAltitude)return this.containsHelper(t);const e=this.minAltitude===this.maxAltitude,i=this.minAltitude===t.altitude,r=this.minAltitude<=t.altitude&&this.maxAltitude>t.altitude;return!!(e?i:r)&&this.containsHelper(t)}clone(){return new o(this.southWest.clone(),this.northEast.clone())}growToContain(t){this.southWest.latitude=Math.min(this.southWest.latitude,t.latitude),this.southWest.longitude=Math.min(this.southWest.longitude,t.longitude),this.southWest.altitude=void 0!==this.southWest.altitude&&void 0!==t.altitude?Math.min(this.southWest.altitude,t.altitude):void 0!==this.southWest.altitude?this.southWest.altitude:void 0!==t.altitude?t.altitude:void 0,this.northEast.latitude=Math.max(this.northEast.latitude,t.latitude),this.northEast.longitude=Math.max(this.northEast.longitude,t.longitude),this.northEast.altitude=void 0!==this.northEast.altitude&&void 0!==t.altitude?Math.max(this.northEast.altitude,t.altitude):void 0!==this.northEast.altitude?this.northEast.altitude:void 0!==t.altitude?t.altitude:void 0}containsHelper(t){if(t.latitude<this.southWest.latitude||t.latitude>=this.northEast.latitude)return!1;const{west:e,east:i}=this;let r=t.longitude;if(i>n.MAX_LONGITUDE)for(;r<e;)r+=360;if(r>i)for(;r>e+360;)r-=360;return r>=e&&r<i}}e.GeoBox=o},5999:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isGeoBoxExtentLike=void 0,e.isGeoBoxExtentLike=function(t){return t&&"object"==typeof t&&"number"==typeof t.latitudeSpan&&"number"==typeof t.longitudeSpan}},680:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isGeoCoordLike=e.geoCoordLikeToGeoPointLike=e.geoCoordLikeToGeoCoordinatesLike=void 0;const r=i(6306),n=i(8248),o=i(7870);e.geoCoordLikeToGeoCoordinatesLike=function(t){return(0,r.isGeoCoordinatesLike)(t)?t:(0,o.isLatLngLike)(t)?{latitude:t.lat,longitude:t.lng}:{latitude:t[1],longitude:t[0]}},e.geoCoordLikeToGeoPointLike=function(t){return(0,n.isGeoPointLike)(t)?t:(0,o.isLatLngLike)(t)?[t.lng,t.lat]:[t.longitude,t.latitude]},e.isGeoCoordLike=function(t){return(0,r.isGeoCoordinatesLike)(t)||(0,o.isLatLngLike)(t)||!(0,n.isGeoPointLike)(t)}},4860:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.GeoCoordinates=e.MIN_LONGITUDE=e.MAX_LONGITUDE=e.MIN_LATITUDE=e.MAX_LATITUDE=void 0;const r=i(6815),n=i(3334),o=i(6306),s=i(8248),a=i(7870);e.MAX_LATITUDE=90,e.MIN_LATITUDE=-90,e.MAX_LONGITUDE=180,e.MIN_LONGITUDE=-180;const l=new r.Vector3,c=new r.Vector3;class h{static fromDegrees(t,e,i){return new h(t,e,i)}static fromRadians(t,e,i){return new h((0,n.radToDeg)(t),(0,n.radToDeg)(e),i)}static fromLatLng(t){return new h(t.lat,t.lng)}static fromGeoPoint(t){return new h(t[1],t[0],t[2])}static fromObject(t){if((0,s.isGeoPointLike)(t))return h.fromGeoPoint(t);if((0,o.isGeoCoordinatesLike)(t))return h.fromDegrees(t.latitude,t.longitude,t.altitude);if((0,a.isLatLngLike)(t))return h.fromDegrees(t.lat,t.lng);throw new Error("Invalid input coordinate format.")}static lerp(t,e,i,r=!1,n=!1){var o,s;if(r){if(t.lng<e.lng){const r=t.clone();return r.longitude+=360,this.lerp(e,r,1-i)}{const r=e.clone();return r.longitude+=360,this.lerp(t,r,i)}}const a=l.set(t.lat,t.lng,null!==(o=t.altitude)&&void 0!==o?o:0),u=c.set(e.lat,e.lng,null!==(s=e.altitude)&&void 0!==s?s:0);a.lerp(u,i);const p=new h(a.x,a.y,a.z);return n?p.normalized():p}constructor(t,e,i){this.latitude=t,this.longitude=e,this.altitude=i}get latitudeInRadians(){return(0,n.degToRad)(this.latitude)}get longitudeInRadians(){return(0,n.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:t,longitude:e}=this;return isNaN(t)||isNaN(e)?this:((e<-180||e>180)&&(e=function(t){const e=t%360;return e<0==0?e:e+360}(e+180)-180),t=(0,n.clamp)(t,-90,90),new h(t,e,this.altitude))}equals(t){return this.latitude===t.latitude&&this.longitude===t.longitude&&this.altitude===t.altitude}copy(t){return this.latitude=t.latitude,this.longitude=t.longitude,this.altitude=t.altitude,this}clone(){return new h(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(t){const e=Math.min(this.longitude,t.longitude),i=Math.max(this.longitude,t.longitude);return Math.min(i-e,360+e-i)}}e.GeoCoordinates=h},6306:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isGeoCoordinatesLike=void 0,e.isGeoCoordinatesLike=function(t){return t&&"number"==typeof t.latitude&&"number"==typeof t.longitude&&("number"==typeof t.altitude||void 0===t.altitude)}},8248:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isGeoPointLike=void 0,e.isGeoPointLike=function(t){if(Array.isArray(t)){const[e,i,r]=t;return"number"==typeof e&&"number"==typeof i&&(void 0===r||"number"==typeof r)}return!1}},6482:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPolygon=e.isAntimeridianCrossing=void 0;const r=i(5448),n=i(3068),o=i(4860),s=i(680);function a(t,e){return Math.max(t,e)-Math.min(t,e)}function l(t,e){return t>0&&e<0&&a(t,e)>180}e.isAntimeridianCrossing=function(t,e){return Math.sign(t)===-Math.sign(e)&&a(t,e)>180},e.GeoPolygon=class{constructor(t,e=!1,i=!1){this.m_coordinates=t.map(t=>(0,s.geoCoordLikeToGeoCoordinatesLike)(t)),e&&this.sortCCW(),i&&this.wrapCoordinatesAround()}get coordinates(){return this.m_coordinates}getGeoBoundingBox(){const t=this.getCentroid();if(void 0===t)return n.GeoBox.fromCoordinates(this.coordinates[0],this.coordinates[0]);const{east:e,west:i}=this.getEastAndWest(t),{north:r,south:s}=this.getNorthAndSouth();return n.GeoBox.fromCoordinates(new o.GeoCoordinates(s,i),new o.GeoCoordinates(r,e))}getCentroid(){const t=this.getArea();if(0===t)return;let e,i=0,r=0,n=this.m_coordinates.length-1;return this.m_coordinates.forEach((t,o)=>{const s=this.m_coordinates[n];e=t.latitude*s.longitude-s.latitude*t.longitude,i+=(t.latitude+s.latitude)*e,r+=(t.longitude+s.longitude)*e,n=o}),e=6*t,new o.GeoCoordinates(i/e,t<0?r/e-180:r/e)}sortCCW(){const t=this.getPolyAverageCenter();t&&this.m_coordinates.sort((e,i)=>{const n=new r.Vector2(e.latitude-t.latitude,e.longitude-t.longitude).normalize();return new r.Vector2(i.latitude-t.latitude,i.longitude-t.longitude).normalize().angle()-n.angle()})}wrapCoordinatesAround(){const t=this.m_coordinates.findIndex((t,e)=>{const i=0===e?this.m_coordinates.length-1:e-1;return l(this.m_coordinates[i].longitude,t.longitude)});if(t<0)return;let e=!0;for(let i=0;i<this.m_coordinates.length;i++){const r=(t+i)%this.m_coordinates.length,n=this.m_coordinates[r].longitude,o=this.m_coordinates[(r+1)%this.m_coordinates.length].longitude;e&&(this.m_coordinates[r].longitude+=360),l(o,n)?e=!1:l(n,o)&&(e=!0)}}getPolyAverageCenter(){const t=this.m_coordinates.reduce((t,e)=>new o.GeoCoordinates(t.latitude+e.latitude,t.longitude+e.longitude));return new o.GeoCoordinates(t.latitude/this.m_coordinates.length,t.longitude/this.m_coordinates.length)}getArea(){let t=0,e=this.m_coordinates.length-1;
2return this.m_coordinates.forEach((i,r)=>{const n=this.m_coordinates[e];t+=i.latitude*n.longitude,t-=i.longitude*n.latitude,e=r}),t/=2}getEastAndWest(t){let e=t.longitude,i=t.longitude,n=this.m_coordinates.length-1;return this.m_coordinates.forEach((o,s)=>{const a=this.m_coordinates[n];n=s;const l=new r.Vector2(o.latitude-t.latitude,o.longitude-t.longitude).normalize(),c=new r.Vector2(a.latitude-t.latitude,a.longitude-t.longitude).normalize();let h=1===Math.sign(c.angle()-l.angle());c.y>=0&&l.y<0&&(h=!0);const u=o.longitude;u<t.longitude?h?e=Math.min(e,u):i=Math.min(i,u):h?i=Math.max(i,u):e=Math.max(e,u)}),{east:i,west:e}}getNorthAndSouth(){let t=o.MIN_LATITUDE,e=o.MAX_LATITUDE;return this.m_coordinates.forEach((i,r)=>{t=Math.max(t,i.latitude),e=Math.min(e,i.latitude)}),{north:t,south:e}}}},9019:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isGeoPolygonLike=void 0;const r=i(680);e.isGeoPolygonLike=function(t){if(!t||!Array.isArray(t.coordinates)&&t.coordinates.length>2)return!1;let e=!0;return t.coordinates.forEach(i=>{(0,r.isGeoCoordLike)(t)||(e=!1)}),e}},7870:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isLatLngLike=void 0,e.isLatLngLike=function(t){return t&&"number"==typeof t.lat&&"number"==typeof t.lng}},9264:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isBox3Like=void 0,e.isBox3Like=function(t){const e=t;return void 0!==e.min&&void 0!==e.max}},7523:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MathUtils=void 0;const r=i(3334);!function(t){function e(t){return(t%=360)<0&&(t+=360),t}function i(t,i){const r=(t=e(t))-(i=e(i));return r>180?r-360:r<=-180?r+360:r}t.newEmptyBox3=function(){return{min:{x:1/0,y:1/0,z:1/0},max:{x:-1/0,y:-1/0,z:-1/0}}},t.newVector3=function(t,e,i,r){return void 0===r?{x:t,y:e,z:i}:(r.x=t,r.y=e,r.z=i,r)},t.copyVector3=function(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e},t.degToRad=r.degToRad,t.radToDeg=r.radToDeg,t.clamp=r.clamp,t.normalizeAngleDeg=e,t.normalizeLongitudeDeg=function(t){return(t=e(t))>180&&(t-=360),t},t.angleDistanceDeg=i,t.interpolateAnglesDeg=function(t,e,r){return(t+i(e,t)*r)%360}}(e.MathUtils||(e.MathUtils={}))},2334:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OrientedBox3=void 0;const r=i(8333),n=i(6815);function o(t,e,i,r,n){const o=i.dot(e),s=i.dot(t);if(Math.abs(s)<1e-20)return Math.abs(o)<=r;const a=1/s,l=(o+r)*a,c=(o-r)*a;return l>c?(c>n.min&&(n.min=c),l<n.max&&(n.max=l)):(l>n.min&&(n.min=l),c<n.max&&(n.max=c)),n.min<=n.max&&n.max>=0}const s=new n.Vector3,a={min:-1/0,max:1/0};class l{constructor(t,e,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!==t&&this.position.copy(t),void 0!==e&&e.extractBasis(this.xAxis,this.yAxis,this.zAxis),void 0!==i&&this.extents.copy(i)}clone(){const t=new l;return t.copy(this),t}copy(t){this.position.copy(t.position),this.xAxis.copy(t.xAxis),this.yAxis.copy(t.yAxis),this.zAxis.copy(t.zAxis),this.extents.copy(t.extents)}getCenter(t=new n.Vector3){return t.copy(this.position)}getSize(t=new n.Vector3){return t.copy(this.extents).multiplyScalar(2)}getRotationMatrix(t=new r.Matrix4){return t.makeBasis(this.xAxis,this.yAxis,this.zAxis)}intersects(t){const e=Array.isArray(t)?t:t.planes;for(const t of e){const e=Math.abs(t.normal.dot(this.xAxis)*this.extents.x)+Math.abs(t.normal.dot(this.yAxis)*this.extents.y)+Math.abs(t.normal.dot(this.zAxis)*this.extents.z);if(t.distanceToPoint(this.position)+e<0)return!1}return!0}intersectsRay(t){if(a.min=-1/0,a.max=1/0,s.copy(this.position).sub(t.origin),o(t.direction,s,this.xAxis,this.extents.x,a)&&o(t.direction,s,this.yAxis,this.extents.y,a)&&o(t.direction,s,this.zAxis,this.extents.z,a))return a.min>0?a.min:a.max}contains(t){const e=t.x-this.position.x,i=t.y-this.position.y,r=t.z-this.position.z,n=Math.abs(e*this.xAxis.x+i*this.xAxis.y+r*this.xAxis.z),o=Math.abs(e*this.yAxis.x+i*this.yAxis.y+r*this.yAxis.z),s=Math.abs(e*this.zAxis.x+i*this.zAxis.y+r*this.zAxis.z);return!(n>this.extents.x||o>this.extents.y||s>this.extents.z)}distanceToPoint(t){return Math.sqrt(this.distanceToPointSquared(t))}distanceToPointSquared(t){const e=new n.Vector3;e.subVectors(t,this.position);const i=[e.dot(this.xAxis),e.dot(this.yAxis),e.dot(this.zAxis)];let r=0;for(let t=0;t<3;++t){const e=i[t],n=this.extents.getComponent(t);if(e<-n){const t=n+e;r+=t*t}else if(e>n){const t=e-n;r+=t*t}}return r}}e.OrientedBox3=l},58:(t,e)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.isOrientedBox3Like=void 0,e.isOrientedBox3Like=function(t){const e=t;return void 0!==e.position&&void 0!==e.xAxis&&void 0!==e.yAxis&&void 0!==e.zAxis&&void 0!==e.extents}},2683:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isTransformLike=void 0,e.isTransformLike=function(t){const e=t;return void 0!==e.position&&void 0!==e.xAxis&&void 0!==e.yAxis&&void 0!==e.zAxis}},2953:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isVector2Like=void 0,e.isVector2Like=function(t){return t&&"number"==typeof t.x&&"number"==typeof t.y}},1383:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isVector3Like=void 0,e.isVector3Like=function(t){return t&&"number"==typeof t.x&&"number"==typeof t.y&&"number"==typeof t.z}},5610:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EarthConstants=void 0;class i{}e.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:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.equirectangularProjection=e.normalizedEquirectangularProjection=void 0;const r=i(3334),n=i(2754),o=i(3068),s=i(4860),a=i(9264),l=i(7523),c=i(58),h=i(5610),u=i(5234);class p extends u.Projection{constructor(){super(...arguments),this.type=u.ProjectionType.Planar}getScaleFactor(t){return 1}worldExtent(t,e,i){return i||(i=new n.Box3),i.min.x=0,i.min.y=0,i.min.z=t,i.max.x=this.unitScale,i.max.y=this.unitScale/2,i.max.z=e,i}projectPoint(t,e){var i;return void 0===e&&(e={x:0,y:0,z:0}),e.x=((0,r.degToRad)(t.longitude)+Math.PI)*p.geoToWorldScale*this.unitScale,e.y=((0,r.degToRad)(t.latitude)+.5*Math.PI)*p.geoToWorldScale*this.unitScale,e.z=null!==(i=t.altitude)&&void 0!==i?i:0,e}unprojectPoint(t){return s.GeoCoordinates.fromRadians(t.y*p.worldToGeoScale/this.unitScale-.5*Math.PI,t.x*p.worldToGeoScale/this.unitScale-Math.PI,t.z)}unprojectAltitude(t){return t.z}projectBox(t,e){const i=this.projectPoint(new s.GeoCoordinates(t.center.latitude,t.center.longitude,0)),{latitudeSpanInRadians:r,longitudeSpanInRadians:o,altitudeSpan:h}=t,u=o*p.geoToWorldScale,d=r*p.geoToWorldScale;return e||(e=new n.Box3),(0,a.isBox3Like)(e)?(e.min.x=i.x-.5*u*this.unitScale,e.min.y=i.y-.5*d*this.unitScale,e.max.x=i.x+.5*u*this.unitScale,e.max.y=i.y+.5*d*this.unitScale,void 0!==h?(e.min.z=i.z-.5*h,e.max.z=i.z+.5*h):(e.min.z=0,e.max.z=0)):(0,c.isOrientedBox3Like)(e)&&(l.MathUtils.newVector3(1,0,0,e.xAxis),l.MathUtils.newVector3(0,1,0,e.yAxis),l.MathUtils.newVector3(0,0,1,e.zAxis),e.position.x=i.x,e.position.y=i.y,e.position.z=i.z,e.extents.x=.5*u*this.unitScale,e.extents.y=.5*d*this.unitScale,e.extents.z=Math.max(Number.EPSILON,.5*(null!=h?h:0))),e}unprojectBox(t){const e=this.unprojectPoint(t.min),i=this.unprojectPoint(t.max);return o.GeoBox.fromCoordinates(e,i)}groundDistance(t){return t.z}scalePointToSurface(t){return t.z=0,t}surfaceNormal(t,e){return void 0===e?e={x:0,y:0,z:1}:(e.x=0,e.y=0,e.z=1),e}}p.geoToWorldScale=1/(2*Math.PI),p.worldToGeoScale=2*Math.PI/1,e.normalizedEquirectangularProjection=new p(1),e.equirectangularProjection=new p(h.EarthConstants.EQUATORIAL_CIRCUMFERENCE)},9686:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.identityProjection=void 0;const r=i(2754),n=i(3334),o=i(3068),s=i(4860),a=i(9264),l=i(7523),c=i(58),h=i(5234);class u extends h.Projection{constructor(){super(...arguments),this.type=h.ProjectionType.Planar}getScaleFactor(t){return 1}worldExtent(t,e,i){return i||(i=new r.Box3),i.min.x=-Math.PI,i.min.y=.5*-Math.PI,i.min.z=t,i.max.x=Math.PI,i.max.y=.5*Math.PI,i.max.z=e,i}projectPoint(t,e){var i;return e||(e={x:0,y:0,z:0}),e.x=(0,n.degToRad)(t.longitude),e.y=(0,n.degToRad)(t.latitude),e.z=null!==(i=t.altitude)&&void 0!==i?i:0,e}unprojectPoint(t){return s.GeoCoordinates.fromRadians(t.y,t.x,t.z)}unprojectAltitude(t){return t.z}projectBox(t,e){e||(e=new r.Box3);const i=this.projectPoint(new s.GeoCoordinates(t.south,t.west,t.minAltitude)),n=this.projectPoint(new s.GeoCoordinates(t.north,t.east,t.maxAltitude));return(0,a.isBox3Like)(e)?(e.min.x=i.x,e.min.y=i.y,e.min.z=i.z,e.max.x=n.x,e.max.y=n.y,e.max.z=n.z):(0,c.isOrientedBox3Like)(e)&&(l.MathUtils.newVector3(1,0,0,e.xAxis),l.MathUtils.newVector3(0,1,0,e.yAxis),l.MathUtils.newVector3(0,0,1,e.zAxis),e.position.x=.5*(i.x+n.x),e.position.y=.5*(i.y+n.y),e.position.z=.5*(i.z+n.z),e.extents.x=.5*(n.x-i.x),e.extents.y=.5*(n.y-i.y),e.extents.z=Math.max(Number.EPSILON,.5*(n.z-i.z))),e}unprojectBox(t){const e=this.unprojectPoint(t.min),i=this.unprojectPoint(t.max);return o.GeoBox.fromCoordinates(e,i)}groundDistance(t){return t.z}scalePointToSurface(t){return t.z=0,t}surfaceNormal(t,e){return void 0===e?e={x:0,y:0,z:1}:(e.x=0,e.y=0,e.z=1),e}}e.identityProjection=new u(1)},9885:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.webMercatorProjection=e.mercatorProjection=e.MercatorConstants=void 0;const r=i(2754),n=i(3068),o=i(4860),s=i(6306),a=i(9264),l=i(7523),c=i(58),h=i(5610),u=i(5234);class p extends u.Projection{constructor(){super(...arguments),this.type=u.ProjectionType.Planar}static clamp(t,e,i){return Math.min(Math.max(e,t),i)}static latitudeClamp(t){return p.clamp(t,-d.MAXIMUM_LATITUDE,d.MAXIMUM_LATITUDE)}static latitudeProject(t){return Math.log(Math.tan(.25*Math.PI+.5*t))/Math.PI}static latitudeClampProject(t){return p.latitudeProject(p.latitudeClamp(t))}static unprojectLatitude(t){return 2*Math.atan(Math.exp(Math.PI*t))-.5*Math.PI}getScaleFactor(t){return Math.cosh(2*Math.PI*(t.y/this.unitScale-.5))}worldExtent(t,e,i){return i||(i=new r.Box3),i.min.x=0,i.min.y=0,i.min.z=t,i.max.x=this.unitScale,i.max.y=this.unitScale,i.max.z=e,i}projectPoint(t,e){var i;let r;return r=t instanceof o.GeoCoordinates?t:new o.GeoCoordinates(t.latitude,t.longitude,t.altitude),e||(e={x:0,y:0,z:0}),e.x=(r.longitude+180)/360*this.unitScale,e.y=(.5*p.latitudeClampProject(r.latitudeInRadians)+.5)*this.unitScale,e.z=null!==(i=r.altitude)&&void 0!==i?i:0,e}unprojectPoint(t){return o.GeoCoordinates.fromRadians(p.unprojectLatitude(2*(t.y/this.unitScale-.5)),t.x/this.unitScale*2*Math.PI-Math.PI,t.z)}unprojectAltitude(t){return t.z}projectBox(t,e){var i;const n=this.projectPoint(t.center),o=(.5*p.latitudeClampProject(t.northEast.latitudeInRadians)+.5)*this.unitScale,s=(.5*p.latitudeClampProject(t.southWest.latitudeInRadians)+.5)*this.unitScale,h=.5*(o+s);n.y=h;const u=o-s,d=t.longitudeSpan/360*this.unitScale;if(e||(e=new r.Box3),(0,a.isBox3Like)(e)){e.min.x=n.x-.5*d,e.min.y=n.y-.5*u,e.max.x=n.x+.5*d,e.max.y=n.y+.5*u;const i=t.altitudeSpan;void 0!==i?(e.min.z=n.z-.5*i,e.max.z=n.z+.5*i):(e.min.z=0,e.max.z=0)}else{if(!(0,c.isOrientedBox3Like)(e))throw new Error("invalid bounding box");l.MathUtils.newVector3(1,0,0,e.xAxis),l.MathUtils.newVector3(0,1,0,e.yAxis),l.MathUtils.newVector3(0,0,1,e.zAxis),e.position.x=n.x,e.position.y=n.y,e.position.z=n.z,e.extents.x=.5*d,e.extents.y=.5*u,e.extents.z=Math.max(Number.EPSILON,.5*(null!==(i=t.altitudeSpan)&&void 0!==i?i:0))}return e}unprojectBox(t){const e=this.unprojectPoint(t.min),i=this.unprojectPoint(t.max);return n.GeoBox.fromCoordinates(e,i)}groundDistance(t){return t.z}scalePointToSurface(t){return t.z=0,t}surfaceNormal(t,e){return void 0===e?e={x:0,y:0,z:1}:(e.x=0,e.y=0,e.z=1),e}reprojectPoint(t,i,r){return t===this||t!==e.webMercatorProjection&&t!==e.mercatorProjection?super.reprojectPoint(t,i,r):(void 0===r&&(r={}),r.x=i.x,r.y=this.unitScale-i.y,r.z=i.z,r)}}class d{}e.MercatorConstants=d,d.MAXIMUM_LATITUDE=1.4844222297453322,e.mercatorProjection=new p(h.EarthConstants.EQUATORIAL_CIRCUMFERENCE),e.webMercatorProjection=new class extends p{projectPoint(t,e){var i;let r;r=t instanceof o.GeoCoordinates?t:new o.GeoCoordinates(t.latitude,t.longitude,t.altitude),e||(e={x:0,y:0,z:0}),e.x=(r.longitude+180)/360*this.unitScale;const n=Math.sin(p.latitudeClamp(r.latitudeInRadians));return e.y=(.5-Math.log((1+n)/(1-n))/(4*Math.PI))*this.unitScale,e.z=null!==(i=r.altitude)&&void 0!==i?i:0,e}unprojectPoint(t){const e=t.x/this.unitScale-.5,i=.5-t.y/this.unitScale,r=360*e,n=90-360*Math.atan(Math.exp(2*-i*Math.PI))/Math.PI;return new o.GeoCoordinates(n,r,t.z)}projectBox(t,e){const i=super.projectBox(t,e);if((0,a.isBox3Like)(i)){const t=i.max.y;i.max.y=this.unitScale-i.min.y,i.min.y=this.unitScale-t}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(t){const e=this.unprojectPoint(t.min),i=this.unprojectPoint(t.max);return new n.GeoBox(new o.GeoCoordinates(i.latitude,e.longitude,e.altitude),new o.GeoCoordinates(e.latitude,i.longitude,i.altitude))}surfaceNormal(t,e){return void 0===e?e={x:0,y:0,z:-1}:(e.x=0,e.y=0,e.z=-1),e}localTangentSpace(t,e){return(0,s.isGeoCoordinatesLike)(t)?this.projectPoint(t,e.position):l.MathUtils.copyVector3(t,e.position),l.MathUtils.newVector3(1,0,0,e.xAxis),l.MathUtils.newVector3(0,-1,0,e.yAxis),l.MathUtils.newVector3(0,0,-1,e.zAxis),e}}(h.EarthConstants.EQUATORIAL_CIRCUMFERENCE)},5234:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.Projection=e.ProjectionType=void 0;const r=i(6306),n=i(7523);var o;(o=e.ProjectionType||(e.ProjectionType={}))[o.Planar=0]="Planar",o[o.Spherical=1]="Spherical",e.Projection=class{constructor(t){this.unitScale=t}localTangentSpace(t,e){return(0,r.isGeoCoordinatesLike)(t)?this.projectPoint(t,e.position):n.MathUtils.copyVector3(t,e.position),n.MathUtils.newVector3(1,0,0,e.xAxis),n.MathUtils.newVector3(0,1,0,e.yAxis),n.MathUtils.newVector3(0,0,1,e.zAxis),e}reprojectPoint(t,e,i){return t===this?void 0===i?{x:e.x,y:e.y,z:e.z}:(i.x=e.x,i.y=e.y,i.z=e.z,i):this.projectPoint(t.unprojectPoint(e),i)}}},6322:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.sphereProjection=void 0;const r=i(2754),n=i(3334),o=i(4860),s=i(6306),a=i(9264),l=i(7523),c=i(58),h=i(5610),u=i(9885),p=i(5234);function d(t){const e=1/Math.PI,i=Math.floor(2*(t*e+1));return(0,n.clamp)(i,0,4)}function m(t){return Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)}function f(t,e,i){var r;const o=.5*(i+(null!==(r=t.maxAltitude)&&void 0!==r?r:0)),s=(0,n.degToRad)(t.west),a=(0,n.degToRad)(t.east),l=d(s),c=d(a);let h=Math.cos(s),u=h,p=Math.sin(s),m=p;for(let t=l+1;t<=c;t++){const e=(t+1&1)*((2&t)-1);h=Math.min(e,h),u=Math.max(e,u);const i=(1&t)*((2&t)-1);p=Math.min(i,p),m=Math.max(i,m)}const f=Math.cos(a);h=Math.min(f,h),u=Math.max(f,u);const g=Math.sin(a);p=Math.min(g,p),m=Math.max(g,m);const y=(u+h)*o,v=(u-h)*o,_=(m+p)*o,b=(m-p)*o,x=(0,n.degToRad)(t.south),w=(0,n.degToRad)(t.north),S=Math.sin(w),T=Math.sin(x),E=(S+T)*o,M=(S-T)*o;return e.min.x=y-v,e.min.y=_-b,e.min.z=E-M,e.max.x=y+v,e.max.y=_+b,e.max.z=E+M,e}class g extends p.Projection{constructor(){super(...arguments),this.type=p.ProjectionType.Spherical}worldExtent(t,e,i=new r.Box3){const n=this.unitScale+e;return i.min.x=-n,i.min.y=-n,i.min.z=-n,i.max.x=n,i.max.y=n,i.max.z=n,i}projectPoint(t,e=l.MathUtils.newVector3(0,0,0)){return function(t,e,i){var r;const o=i+(null!==(r=t.altitude)&&void 0!==r?r:0),s=(0,n.degToRad)(t.latitude),a=(0,n.degToRad)(t.longitude),l=Math.cos(s);return e.x=o*l*Math.cos(a),e.y=o*l*Math.sin(a),e.z=o*Math.sin(s),e}(t,e,this.unitScale)}unprojectPoint(t){const e=t.x*t.x+t.y*t.y,i=Math.sqrt(e),r=t.z/i;if(isNaN(r))return o.GeoCoordinates.fromRadians(0,0,-this.unitScale);const n=Math.sqrt(e+t.z*t.z);return o.GeoCoordinates.fromRadians(Math.atan(r),Math.atan2(t.y,t.x),n-this.unitScale)}unprojectAltitude(t){const e=t.x*t.x+t.y*t.y+t.z*t.z;return Math.sqrt(e)-h.EarthConstants.EQUATORIAL_RADIUS}projectBox(t,e=new r.Box3){var i,o;if((0,a.isBox3Like)(e))return f(t,e,this.unitScale);if((0,c.isOrientedBox3Like)(e)){if(t.longitudeSpan>=90){const i=f(t,new r.Box3,this.unitScale);return l.MathUtils.newVector3(1,0,0,e.xAxis),l.MathUtils.newVector3(0,1,0,e.yAxis),l.MathUtils.newVector3(0,0,1,e.zAxis),e.position.x=.5*(i.max.x+i.min.x),e.position.y=.5*(i.max.y+i.min.y),e.position.z=.5*(i.max.z+i.min.z),e.extents.x=.5*(i.max.x-i.min.x),e.extents.y=.5*(i.max.y-i.min.y),e.extents.z=.5*(i.max.z-i.min.z),e}const{south:s,west:a,north:c,east:h,center:u}=t,p=u.longitude,d=u.latitude,m=Math.cos((0,n.degToRad)(s)),g=Math.sin((0,n.degToRad)(s)),y=Math.cos((0,n.degToRad)(a)),v=Math.sin((0,n.degToRad)(a)),_=Math.cos((0,n.degToRad)(c)),b=Math.sin((0,n.degToRad)(c)),x=Math.cos((0,n.degToRad)(h)),w=Math.sin((0,n.degToRad)(h)),S=Math.cos((0,n.degToRad)(p)),T=Math.sin((0,n.degToRad)(p)),E=Math.cos((0,n.degToRad)(d)),M=Math.sin((0,n.degToRad)(d));let A,C,P;l.MathUtils.newVector3(S*E,T*E,M,e.zAxis),l.MathUtils.newVector3(-T,S,0,e.xAxis),l.MathUtils.newVector3(-S*M,-T*M,E,e.yAxis),s>=0?(A=Math.abs(m*(S*(v-w)+T*(x-y))),C=E*g-M*m,P=E*b-M*_*(S*x+T*w)):(c<=0?(A=Math.abs(_*(S*(v-w)+T*(x-y))),P=E*b-M*_):(A=Math.abs(S*(v-w)+T*(x-y)),P=E*b-M*_*(T*w+S*x)),C=E*g-M*m*(S*x+T*w));const L=.5*(this.unitScale+(null!==(i=t.maxAltitude)&&void 0!==i?i:0)),R=.5*(this.unitScale+(null!==(o=t.minAltitude)&&void 0!==o?o:0)),I=E*(S*x+T*w),O=Math.min(_*I+b*M,m*I+g*M);return l.MathUtils.newVector3(A*L,(P-C)*L,L-O*R,e.extents),l.MathUtils.newVector3(0,(C+P)*L,L+L,e.position),function(t,e,i,r){const n=t.x*r.x+e.x*r.y+i.x*r.z,o=t.y*r.x+e.y*r.y+i.y*r.z,s=t.z*r.x+e.z*r.y+i.z*r.z;r.x=n,r.y=o,r.z=s}(e.xAxis,e.yAxis,e.zAxis,e.position),e.position.x=e.position.x-e.zAxis.x*e.extents.z,e.position.y=e.position.y-e.zAxis.y*e.extents.z,e.position.z=e.position.z-e.zAxis.z*e.extents.z,e}throw new Error("Invalid bounding box")}unprojectBox(t){throw new Error("Method not implemented.")}getScaleFactor(t){return 1}groundDistance(t){return m(t)-this.unitScale}scalePointToSurface(t){const e=this.unitScale/(m(t)||1);
2return t.x*=e,t.y*=e,t.z*=e,t}surfaceNormal(t,e){void 0===e&&(e={x:0,y:0,z:0});const i=1/(m(t)||1);return e.x=t.x*i,e.y=t.y*i,e.z=t.z*i,e}reprojectPoint(t,e,i){if(t===u.mercatorProjection||t===u.webMercatorProjection){const{x:r,y:n,z:o}=e,s=this.unitScale,a=r/s-Math.PI,l=n/s-Math.PI,c=Math.exp(l),h=c*c,p=2*c/(h+1),d=(h-1)/(h+1),m=s+o;return void 0===i&&(i={}),i.x=Math.cos(a)*p*m,i.y=Math.sin(a)*p*m,i.z=d*m,t===u.webMercatorProjection&&(i.z=-i.z),i}return super.reprojectPoint(t,e,i)}localTangentSpace(t,e){let i;(0,s.isGeoCoordinatesLike)(t)?(this.projectPoint(t,e.position),i=t):(l.MathUtils.copyVector3(t,e.position),i=this.unprojectPoint(t));const r=(0,n.degToRad)(i.latitude),o=(0,n.degToRad)(i.longitude),a=Math.cos(o),c=Math.sin(o),h=Math.cos(r),u=Math.sin(r);return l.MathUtils.newVector3(a*h,c*h,u,e.zAxis),l.MathUtils.newVector3(-c,a,0,e.xAxis),l.MathUtils.newVector3(-a*u,-c*u,h,e.yAxis),e}}e.sphereProjection=new g(h.EarthConstants.EQUATORIAL_RADIUS)},7289:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.transverseMercatorProjection=e.TransverseMercatorUtils=void 0;const r=i(2754),n=i(3334),o=i(3068),s=i(4860),a=i(9264),l=i(7523),c=i(58),h=i(5610),u=i(5234);class p extends u.Projection{static clampGeoPoint(t,e){const i=t.latitude,r=t.longitude,n=d.POLE_RADIUS,o=d.POLE_RADIUS_SQ,a=Math.round(r/90),l=90*a-r;if(a%2==0||Math.abs(l)>n)return t;const c=i-0,h=l*l+c*c;
2if(h<o){const t=Math.sqrt(h),e=(n-t)/t,o=0===l&&0===c?1*n:l;return new s.GeoCoordinates(i+c*e,r+o*e)}return t}constructor(t){super(t),this.unitScale=t,this.type=u.ProjectionType.Planar,this.m_phi0=0,this.m_lambda0=0}getScaleFactor(t){return Math.cosh(2*(t.x/this.unitScale-.5)*Math.PI)}worldExtent(t,e,i){return i||(i=new r.Box3),i.min.x=0,i.min.y=0,i.min.z=t,i.max.x=this.unitScale,i.max.y=this.unitScale,i.max.z=e,i}projectPoint(t,e){var i;e||(e={x:0,y:0,z:0});const r=p.clampGeoPoint(t,this.unitScale),o=r.longitude/360+.5,s=1===o?0:Math.floor(o),a=(0,n.degToRad)(r.latitude),l=(0,n.degToRad)(r.longitude-360*s)-this.m_lambda0,c=Math.cos(a)*Math.sin(l);e.x=Math.atanh(c),e.y=Math.atan2(Math.tan(a),Math.cos(l))-this.m_phi0;const h=.5/Math.PI;return e.x=this.unitScale*((0,n.clamp)(e.x*h+.5,0,1)+s),e.y=this.unitScale*(0,n.clamp)(e.y*h+.5,0,1),e.z=null!==(i=t.altitude)&&void 0!==i?i:0,e}unprojectPoint(t){const e=2*Math.PI,i=t.x/this.unitScale,r=t.y/this.unitScale,n=1===i?0:Math.floor(i),o=e*(i-.5-n),a=e*(r-.5),l=t.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))+n*e;return s.GeoCoordinates.fromRadians(h,u,l)}projectBox(t,e){const{north:i,south:n,east:o,west:h}=t,u=[t.center,t.northEast,t.southWest,new s.GeoCoordinates(n,o),new s.GeoCoordinates(i,h)],p=d.POLE_EDGE_DEG,m=h<90&&o>90,f=h<0&&o>0,g=h<p&&o>-p&&i>0&&n<0;h<-90&&o>-90&&(u.push(new s.GeoCoordinates(i,-90)),u.push(new s.GeoCoordinates(n,-90))),m&&(u.push(new s.GeoCoordinates(i,90)),u.push(new s.GeoCoordinates(n,90))),f&&(u.push(new s.GeoCoordinates(i,0)),u.push(new s.GeoCoordinates(n,0))),g&&(u.push(new s.GeoCoordinates(0,h)),u.push(new s.GeoCoordinates(0,o))),d.alignLatitude(u,u[0]);const y=u.map(t=>this.projectPoint(t)),v=y.map(t=>t.x),_=y.map(t=>t.y),b=y.map(t=>t.z),x=Math.min(...v),w=Math.min(..._),S=Math.min(...b),T=Math.max(...v),E=Math.max(..._),M=Math.max(...b);if(e||(e=new r.Box3),(0,a.isBox3Like)(e))e.min.x=x,e.min.y=w,e.min.z=S,e.max.x=T,e.max.y=E,e.max.z=M;else{if(!(0,c.isOrientedBox3Like)(e))throw new Error("invalid bounding box");l.MathUtils.newVector3(1,0,0,e.xAxis),l.MathUtils.newVector3(0,1,0,e.yAxis),l.MathUtils.newVector3(0,0,1,e.zAxis),e.position.x=(x+T)/2,e.position.y=(w+E)/2,e.position.z=(S+M)/2,e.extents.x=(T-x)/2,e.extents.y=(E-w)/2,e.extents.z=(M-S)/2}return e}unprojectBox(t){const e=this.unitScale,i=t.min,r=t.max,n=[{x:(i.x+r.x)/2,y:(i.y+r.y)/2,z:0},i,r,{x:i.x,y:r.y,z:0},{x:r.x,y:i.y,z:0}],a=.5*e,l=.25*e,c=.75*e,h=i.x<a&&r.x>a,u=i.y<a&&r.y>a,p=i.y<l&&r.y>l,m=i.y<c&&r.y>c;u&&(n.push({x:i.x,y:a,z:0}),n.push({x:r.x,y:a,z:0}),h&&n.push({x:a,y:a,z:0})),p&&(n.push({x:i.x,y:l,z:0}),n.push({x:r.x,y:l,z:0}),h&&n.push({x:a,y:l,z:0})),m&&(n.push({x:i.x,y:c,z:0}),n.push({x:r.x,y:c,z:0}),h&&n.push({x:a,y:c,z:0}));const f=n.map(t=>this.unprojectPoint(t));d.alignLongitude(f,f[0]);const g=f.map(t=>t.latitude),y=f.filter(t=>Math.abs(t.latitude)<90).map(t=>t.longitude),v=f.map(t=>{var e;return null!==(e=t.altitude)&&void 0!==e?e:0}),_=new s.GeoCoordinates(Math.min(...g),Math.min(...y),Math.min(...v)),b=new s.GeoCoordinates(Math.max(...g),Math.max(...y),Math.max(...v));return o.GeoBox.fromCoordinates(_,b)}unprojectAltitude(t){return t.z}groundDistance(t){return t.z}scalePointToSurface(t){return t.z=0,t}surfaceNormal(t,e){return void 0===e?e={x:0,y:0,z:-1}:(e.x=0,e.y=0,e.z=-1),e}}class d{static alignLatitude(t,e){for(const i of t)0===i.latitude&&(i.latitude=1e-9*e.latitude)}static alignLongitude(t,e){const i=e.longitude<0?180:-180,r=e.longitude<0?-180:180;for(const e of t)e.longitude===i&&(e.longitude=r)}}e.TransverseMercatorUtils=d,d.POLE_EDGE=1.4844222297453322,d.POLE_EDGE_DEG=(0,n.radToDeg)(d.POLE_EDGE),d.POLE_RADIUS=90-d.POLE_EDGE_DEG,d.POLE_RADIUS_SQ=Math.pow(d.POLE_RADIUS,2),e.transverseMercatorProjection=new p(h.EarthConstants.EQUATORIAL_CIRCUMFERENCE)},9861:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FlatTileBoundingBoxGenerator=void 0;const r=i(2754);e.FlatTileBoundingBoxGenerator=class{constructor(t,e=0,i=0){this.tilingScheme=t,this.minElevation=e,this.maxElevation=i,this.m_tilingScheme=t,this.m_worldBox=t.projection.worldExtent(e,i);const{min:r,max:n}=this.m_worldBox;this.m_worldDimensions={x:n.x-r.x,y:n.y-r.y,z:n.z-r.z}}get projection(){return this.m_tilingScheme.projection}get subdivisionScheme(){return this.m_tilingScheme.subdivisionScheme}getWorldBox(t,e){const i=t.level,n=this.subdivisionScheme.getLevelDimensionX(i),o=this.subdivisionScheme.getLevelDimensionY(i),s=this.m_worldDimensions.x/n,a=this.m_worldDimensions.y/o,l=this.m_worldBox.min.x+s*t.column,c=this.m_worldBox.min.y+a*t.row;return e||(e=new r.Box3),e.min.x=l,e.min.y=c,e.min.z=this.m_worldBox.min.z,e.max.x=l+s,e.max.y=c+a,e.max.z=this.m_worldBox.max.z,e}getGeoBox(t){const e=this.getWorldBox(t);return this.projection.unprojectBox(e)}}},435:(t,e)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.halfQuadTreeSubdivisionScheme=void 0,e.halfQuadTreeSubdivisionScheme=new class{getSubdivisionX(){return 2}getSubdivisionY(t){return 0===t?1:2}getLevelDimensionX(t){return 1<<t}getLevelDimensionY(t){return 0!==t?1<<t-1:1}}},4490:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.hereTilingScheme=void 0;const r=i(1515),n=i(435),o=i(6557);e.hereTilingScheme=new o.TilingScheme(n.halfQuadTreeSubdivisionScheme,r.normalizedEquirectangularProjection)},1635:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.mercatorTilingScheme=void 0;const r=i(9885),n=i(9447),o=i(6557);e.mercatorTilingScheme=new o.TilingScheme(n.quadTreeSubdivisionScheme,r.mercatorProjection)},1871:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.polarTilingScheme=void 0;const r=i(7289),n=i(9447),o=i(6557);e.polarTilingScheme=new o.TilingScheme(n.quadTreeSubdivisionScheme,r.transverseMercatorProjection)},7171:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.QuadTree=void 0;const r=i(6541);e.QuadTree=class{constructor(t){this.tilingScheme=t}visit(t){this.visitTileKey(r.TileKey.fromRowColumnLevel(0,0,0),t)}visitTileKey(t,e){if(e(t,this.tilingScheme.getGeoBox(t)))for(const i of this.tilingScheme.getSubTileKeys(t))this.visitTileKey(i,e)}}},9447:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.quadTreeSubdivisionScheme=void 0,e.quadTreeSubdivisionScheme=new class{getSubdivisionX(){return 2}getSubdivisionY(){return 2}getLevelDimensionX(t){return 1<<t}getLevelDimensionY(t){return 1<<t}}},3424:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SubTiles=void 0;const r=i(6541);class n{constructor(t,e,i){this.tileKey=t,this.sizeX=e,this.sizeY=i}[Symbol.iterator](){return 2===this.sizeX&&2===this.sizeY?n.ZCurveIterator(this.tileKey):n.RowColumnIterator(this.tileKey,this.sizeX,this.sizeY)}}e.SubTiles=n,function(t){t.RowColumnIterator=function*(t,e,i){for(let n=0;n<i;n++)for(let o=0;o<e;o++)yield r.TileKey.fromRowColumnLevel(t.row*i+n,t.column*e+o,t.level+1)},t.ZCurveIterator=function*(t){for(let e=0;e<4;e++)yield r.TileKey.fromRowColumnLevel(t.row<<1|e>>1,t.column<<1|1&e,t.level+1)}}(n=e.SubTiles||(e.SubTiles={}))},4948:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6541:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.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,
20x8000000000000,4503599627370496];class r{static fromRowColumnLevel(t,e,i){return new r(t,e,i)}static fromQuadKey(t){const e=t.length;let i=0,n=0;for(let r=0;r<t.length;++r){const o=1<<r,s=parseInt(t.charAt(e-r-1),10);1&s&&(n|=o),2&s&&(i|=o)}return r.fromRowColumnLevel(i,n,e)}static fromMortonCode(t){let e=0,i=0,n=0,o=t;for(;o>1;){const t=1<<e;1&o&&(n|=t),2&o&&(i|=t),e++,o=(o-(3&o))/4}const s=r.fromRowColumnLevel(i,n,e);return s.m_mortonCode=t,s}static fromHereTile(t){const e=r.fromMortonCode(parseInt(t,10));return e.m_hereTile=t,e}static columnsAtLevel(t){return Math.pow(2,t)}static rowsAtLevel(t){return Math.pow(2,t)}static atCoords(t,e,i,n,o){return r.fromRowColumnLevel(Math.floor(i/(o/r.rowsAtLevel(t))),Math.floor(e/(n/r.columnsAtLevel(t))),t)}static parentMortonCode(t){return Math.floor(t/4)}constructor(t,e,i){this.row=t,this.column=e,this.level=i}parent(){if(0===this.level)throw new Error("Cannot get the parent of the root tile key");return r.fromRowColumnLevel(this.row>>>1,this.column>>>1,this.level-1)}changedLevelBy(t){const e=Math.max(0,this.level+t);let i=this.row,n=this.column;return t>=0?(i<<=t,n<<=t):(i>>>=-t,n>>>=-t),r.fromRowColumnLevel(i,n,e)}changedLevelTo(t){return this.changedLevelBy(t-this.level)}mortonCode(){if(void 0===this.m_mortonCode){let t=this.column,e=this.row,r=i[this.level<<1];for(let n=0;n<this.level;++n)1&t&&(r+=i[2*n]),1&e&&(r+=i[2*n+1]),t>>>=1,e>>>=1;this.m_mortonCode=r}return this.m_mortonCode}toHereTile(){return void 0===this.m_hereTile&&(this.m_hereTile=this.mortonCode().toString()),this.m_hereTile}toQuadKey(){let t="";for(let e=this.level;e>0;--e){const i=1<<e-1,r=!!(this.column&i),n=!!(this.row&i);t+=r&&n?"3":n?"2":r?"1":"0"}return t}equals(t){return this.row===t.row&&this.column===t.column&&this.level===t.level}addedSubKey(t){const e=r.fromQuadKey(0===t.length?"-":t),i=this.changedLevelBy(e.level);return r.fromRowColumnLevel(i.row+e.row,i.column+e.column,i.level)}addedSubHereTile(t){const e=r.fromHereTile(t),i=this.changedLevelBy(e.level);return r.fromRowColumnLevel(i.row+e.row,i.column+e.column,i.level)}getSubHereTile(t){const e=1<<2*t;return(this.mortonCode()&e-1|e).toString()}rowCount(){return r.rowsAtLevel(this.level)}columnCount(){return r.columnsAtLevel(this.level)}}e.TileKey=r},7841:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TileKeyUtils=e.powerOfTwo=void 0;const r=i(4860),n=i(6541);e.powerOfTwo=(()=>{let t=.5;return new Array(53).fill(0).map(()=>t*=2)})(),function(t){function i(t,e,i){const r=t.projection,o=t.subdivisionScheme,s=o.getLevelDimensionX(i),a=o.getLevelDimensionY(i),{min:l,max:c}=r.worldExtent(0,0),h=c.x-l.x,u=c.y-l.y;if(e.x<l.x||e.x>c.x)return null;if(e.y<l.y||e.y>c.y)return null;const p=Math.min(s-1,Math.floor(s*(e.x-l.x)/h)),d=Math.min(a-1,Math.floor(a*(e.y-l.y)/u));return n.TileKey.fromRowColumnLevel(d,p,i)}function o(t,i,r=4){const n=function(t,i=4){let r=0;const n=e.powerOfTwo[i];for(t+=n/2;t<0;)t+=n;for(;t>=n;)t-=n;for(let n=0;n<i&&t>0;n++)1&t&&(r+=e.powerOfTwo[53-i+n]),t>>>=1;return r}(i,r);return t.mortonCode()+n}function s(t,i=4){let r=0,n=t,o=0;for(;o<i;o++){const t=e.powerOfTwo[52-o];n>=t&&(n-=t,r+=e.powerOfTwo[i-1-o])}return r-=e.powerOfTwo[i-1],{offset:r,mortonCode:n}}t.geoCoordinatesToTileKey=function(t,e,r){return i(t,t.projection.projectPoint(e),r)},t.worldCoordinatesToTileKey=i,t.geoRectangleToTileKeys=function(e,i,o){const s=(t,e,i)=>t<e?i-(e-t)%(i-e):e+(t-e)%(i-e),a=(t,e,i)=>Math.min(Math.max(t,e),i),l=s(i.southWest.longitudeInRadians,-Math.PI,Math.PI),c=a(i.southWest.latitudeInRadians,-.5*Math.PI,.5*Math.PI),h=s(i.northEast.longitudeInRadians,-Math.PI,Math.PI),u=a(i.northEast.latitudeInRadians,-.5*Math.PI,.5*Math.PI),p=t.geoCoordinatesToTileKey(e,r.GeoCoordinates.fromRadians(c,l),o),d=t.geoCoordinatesToTileKey(e,r.GeoCoordinates.fromRadians(u,h),o),m=e.subdivisionScheme.getLevelDimensionX(o);if(!p||!d)throw new Error("Invalid coordinates");const f=p.column;let g=d.column;l>h&&(g+=g!==f?m:m-1);const y=Math.min(p.row,d.row),v=Math.max(p.row,d.row),_=new Array;for(let t=y;t<=v;++t)for(let e=f;e<=g;++e)_.push(n.TileKey.fromRowColumnLevel(t,e%m,o));return _},t.getKeyForTileKeyAndOffset=o,t.extractOffsetAndMortonKeyFromKey=s,t.getParentKeyFromKey=function(t,e=4){const{offset:i,mortonCode:r}=s(t,e);return o(n.TileKey.fromMortonCode(n.TileKey.parentMortonCode(r)),i,e)}}(e.TileKeyUtils||(e.TileKeyUtils={}))},2801:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.TileTreeTraverse=void 0;const r=i(3424);e.TileTreeTraverse=class{constructor(t){this.m_subdivisionScheme=t}subTiles(t){const e=this.m_subdivisionScheme.getSubdivisionX(t.level),i=this.m_subdivisionScheme.getSubdivisionY(t.level);return new r.SubTiles(t,e,i)}}},6557:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TilingScheme=void 0;const r=i(9861),n=i(7841),o=i(2801);e.TilingScheme=class{constructor(t,e){this.subdivisionScheme=t,this.projection=e,this.boundingBoxGenerator=new r.FlatTileBoundingBoxGenerator(this),this.tileTreeTraverse=new o.TileTreeTraverse(t)}getSubTileKeys(t){return this.tileTreeTraverse.subTiles(t)}getTileKey(t,e){return n.TileKeyUtils.geoCoordinatesToTileKey(this,t,e)}getTileKeys(t,e){return n.TileKeyUtils.geoRectangleToTileKeys(this,t,e)}getGeoBox(t){return this.boundingBoxGenerator.getGeoBox(t)}getWorldBox(t,e){return this.boundingBoxGenerator.getWorldBox(t,e)}}},2224:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.webMercatorTilingScheme=void 0;const r=i(9885),n=i(9447),o=i(6557);e.webMercatorTilingScheme=new o.TilingScheme(n.quadTreeSubdivisionScheme,r.webMercatorProjection)},3211:function(t,e,i){var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(4388),e),n(i(3711),e),n(i(8487),e),n(i(3674),e)},8487:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.HighPrecisionLine=e.HighPrecisionWireFrameLine=void 0;const r=i(8333),n=i(4246),o=i(5269),s=i(3674);class a extends n.Line{constructor(t,e,i){super(t,e),this.matrixWorldInverse=new r.Matrix4,i&&this.setPositions(i)}get bufferGeometry(){return this.geometry}get shaderMaterial(){return this.material}setPositions(t){s.HighPrecisionUtils.setPositions(this,t)}setupForRendering(){this.onBeforeRender=(t,e,i,r,n,o)=>{s.HighPrecisionUtils.updateHpUniforms(this,i,this.shaderMaterial)}}updateMatrixWorld(t){const e=this.matrixWorldNeedsUpdate||t;super.updateMatrixWorld(t),e&&this.matrixWorldInverse.copy(this.matrixWorld).invert()}}e.HighPrecisionWireFrameLine=a;class l extends o.Mesh{constructor(t,e,i){super(t,e),this.matrixWorldInverse=new r.Matrix4,i&&this.setPositions(i)}get bufferGeometry(){return this.geometry}get shaderMaterial(){return this.material}setPositions(t){s.HighPrecisionUtils.setPositions(this,t)}setupForRendering(){this.onBeforeRender=(t,e,i,r,n,o)=>{s.HighPrecisionUtils.updateHpUniforms(this,i,this.shaderMaterial)}}updateMatrixWorld(t){const e=this.matrixWorldNeedsUpdate||t;super.updateMatrixWorld(t),e&&this.matrixWorldInverse.copy(this.matrixWorld).invert()}}e.HighPrecisionLine=l},1939:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.HighPrecisionPoints=void 0;const r=i(3148),n=i(8333),o=i(4994),s=i(4250),a=i(3674);class l extends o.Points{constructor(t,e,i,o,a){void 0===e&&(e=new s.HighPrecisionPointMaterial({color:o||s.HighPrecisionPointMaterial.DEFAULT_COLOR,opacity:void 0!==a?a:1})),super(void 0===t?new r.BufferGeometry:t,e),this.matrixWorldInverse=new n.Matrix4,i&&this.setPositions(i)}get bufferGeometry(){return this.geometry}clearGeometry(){return this.geometry=new r.BufferGeometry}get shaderMaterial(){return this.material}setPositions(t){a.HighPrecisionUtils.setPositions(this,t)}setupForRendering(){this.material.isHighPrecisionPointsMaterial&&void 0!==this.dimensionality&&this.material.setDimensionality(this.dimensionality),this.onBeforeRender=(t,e,i,r,n,o)=>{a.HighPrecisionUtils.updateHpUniforms(this,i,this.shaderMaterial)}}updateMatrixWorld(t){const e=this.matrixWorldNeedsUpdate||t;super.updateMatrixWorld(t),e&&this.matrixWorldInverse.copy(this.matrixWorld).invert()}}e.HighPrecisionPoints=l},3674:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.HighPrecisionUtils=void 0;const r=i(9365),n=i(3148),o=i(9044),s=i(6280),a=i(8333),l=i(6815),c=i(4250),h=i(8487),u=i(1939),p=i(3711);!function(t){function e(t){return new l.Vector3(Math.fround(t.x),Math.fround(t.y),Math.fround(t.z))}function i(t,i){const r=(new a.Matrix4).copy(t.projectionMatrix).multiply(t.matrixWorldInverse),n=new l.Vector3(0,0,0).applyMatrix4(i),o=e(n);return{viewProjection:r,eyePosHi:o,eyePosLo:e(n.sub(o))}}function d(t){if(t.length>0){const e=t[0];if(null==e)throw Error("Empty element in positions");const i=new Array,n=new Array,o=(...t)=>{for(const e of t){const t=Math.fround(e);n.push(e-t),i.push(t)}},s=t=>{o(t.x,t.y,t.z)};if(void 0!==e.z)t.forEach(t=>{s(t)});else{if(i.length%3!=0)throw Error("Positions must be 3D, not 2D");t.forEach(t=>{o(t)})}return{positionHigh:new r.Float32BufferAttribute(i,3),positionLow:new r.Float32BufferAttribute(n,3)}}return{positionHigh:new r.Float32BufferAttribute([],3),positionLow:new r.Float32BufferAttribute([],3)}}function m(t,e,i=0){const r=new Array,n=t.length;for(let o=0;o<n;o+=e){for(let e=0;e<i;e++)r.push(t[o+e]);const n=t[o+i],s=t[o+i+1],a=t[o+i+2],l=Math.fround(n),c=n-l,h=Math.fround(s),u=s-h,p=Math.fround(a),d=a-p;r.push(l,h,p,c,u,d);for(let n=i+3;n<e;n++)r.push(t[o+n])}return r}function f(t,e){const i=d(e);return t.bufferGeometry.setAttribute("position",i.positionHigh),t.bufferGeometry.setAttribute("positionLow",i.positionLow),i.positionHigh.itemSize}t.doubleToFloatVec=e,t.makeFloatVec=function(t){const e=Math.fround(t.x),i=Math.fround(t.y),r=Math.fround(t.z),n=new l.Vector3(t.x-e,t.y-i,t.z-r);return t.x=Math.fround(e),t.y=Math.fround(i),t.z=Math.fround(r),n},t.createHighPrecisionCameraPos=i,t.updateHpUniforms=function(t,e,r){const n=i(e,t.matrixWorldInverse),o=n.viewProjection;if(void 0===r||!r.isMaterial)throw Error("High pecision line has no high precision material");if(!(r.uniforms&&r.uniforms.u_mvp&&r.uniforms.u_eyepos&&r.uniforms.u_eyepos_lowpart))throw Error("High pecision material has missing uniforms");r.uniforms.u_mvp.value=new Float32Array(o.elements),r.uniforms.u_eyepos.value=new Float32Array(n.eyePosHi.toArray()),r.uniforms.u_eyepos_lowpart.value=new Float32Array(n.eyePosLo.toArray())},t.createAttributes=d,t.addInterleavedAttributes3=m,t.setPositions=f,t.convertPositions=function(t){if(t.length<=0)return{positions:[]};const e=t[0];if(null==e)throw Error("Empty element in positions");const i=e;if(void 0===i.y&&void 0===i.z)return{positions:t};const r=new Array;return t.forEach(t=>{r.push(t.x,t.y,t.z)}),{positions:r}},t.createLine=function(t,e){const i=void 0!==e.lineWidth?e.lineWidth:5,a=void 0!==e.addCircles&&e.addCircles,l=void 0!==e.wireFrame&&e.wireFrame,u=[],d=[];(0,p.triangulateLine)(t,i,u,d,a);const f=new n.BufferGeometry,g=m(u,3),y=new o.InterleavedBuffer(new Float32Array(g),6),v=new s.InterleavedBufferAttribute(y,3,0,!1),_=new s.InterleavedBufferAttribute(y,3,3,!1);f.setAttribute("position",v),f.setAttribute("positionLow",_),f.setIndex(new r.BufferAttribute(new Uint32Array(d),1));const b=new c.HighPrecisionLineMaterial(e),x=l?new h.HighPrecisionWireFrameLine(f,b):new h.HighPrecisionLine(f,b);return x.setupForRendering(),x},t.createPoints=function(t,e){const i=[];for(let e=0;e<t.length;e++)i.push(i.length/3);const r=new n.BufferGeometry,o=(0,c.isHighPrecisionPointMaterial)(e)?e:new c.HighPrecisionPointMaterial(e),s=new u.HighPrecisionPoints(r,o);return f(s,t),s.setupForRendering(),s}}(e.HighPrecisionUtils||(e.HighPrecisionUtils={}))},4388:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LineGroup=e.createSimpleLineGeometry=e.createLineGeometry=e.LineGeometry=void 0;const r=i(9365),n=i(3148),o=i(9044),s=i(6280),a=i(6815),l=i(4342),c=new a.Vector3,h=new a.Vector3,u=new a.Vector3,p={attributes:[{name:"extrusionCoord",itemSize:3,offset:0},{name:"position",itemSize:3,offset:3},{name:"tangent",itemSize:3,offset:6},{name:"tangent2",itemSize:3,offset:9}],stride:12},d={attributes:[{name:"uv",itemSize:2,offset:p.stride},{name:"normal",itemSize:3,offset:p.stride+2}],stride:5},m={attributes:[...p.attributes,...d.attributes],stride:p.stride+d.stride},f={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}
2],stride:15},g={attributes:[...f.attributes,...d.attributes],stride:f.stride+d.stride};class y{constructor(){this.vertices=[],this.vertexColors=[],this.indices=[]}}function v(t,e){return e?t?g:f:t?m:p}function _(t,e,i,r,n,o,s=new y,a=!1){if(0===e.length)return s;const p=v(void 0!==n,a).stride,d=e.length,m=d/3,f=new Array(m),g=new Array(d-3),_=s.vertices.length/p,b=void 0!==r&&r.length>0,x=void 0!==n&&n.length>0,w=void 0!==o&&o.length&&d;(0,l.assert)(!b||r.length===m),(0,l.assert)(!x||n.length/2===m),(0,l.assert)(!w||o.length===d);let S=.1;f[0]=S;for(let t=0;t<m-1;++t){let i=0;for(let r=0;r<3;++r){const n=e[3*(t+1)+r]-e[3*t+r];g[3*t+r]=n,i+=n*n}S+=Math.sqrt(i),f[t+1]=S}const T=b?Math.abs(r[r.length-1]-r[0]):1,E=f[f.length-1]/T;if(b)for(let t=0;t<m;++t)f[t]=r[t]*E+.1;let M=!0;for(let t=0;t<3;++t)M=M&&e[t]===e[e.length-3+t];const A=(r,l,p,d,m)=>{const f=[],y=[];f.push(d,-1*m,E),y.push(d,1*m,E);for(let t=0;t<3;++t){if(a){const i=Math.fround(e[3*r+t]),n=e[3*r+t]-i;f.push(i,n),y.push(i,n)}else f.push(e[3*r+t]),y.push(e[3*r+t]);c.setComponent(t,e[3*r+t]),h.setComponent(t,g[l+t]),u.setComponent(t,g[p+t])}h.normalize(),u.normalize(),f.push(h.x,h.y,h.z),y.push(h.x,h.y,h.z),f.push(u.x,u.y,u.z),y.push(u.x,u.y,u.z),c.add(t),i.surfaceNormal(c,c),x&&(f.push(n[2*r],n[2*r+1]),y.push(n[2*r],n[2*r+1]),f.push(c.x,c.y,c.z),y.push(c.x,c.y,c.z)),s.vertices.push(...f,...y),w&&(s.vertexColors.push(o[3*r],o[3*r+1],o[3*r+2]),s.vertexColors.push(o[3*r],o[3*r+1],o[3*r+2]))};for(let t=0;t<m;++t){const e=M&&0===t?g.length-3:3*Math.max(0,t-1),i=M&&t===m-1?0:Math.min(3*t,g.length-3);t>0&&A(t,e,i,f[t-1],f[t]),t+1<m&&A(t,e,i,-1*f[Math.min(t,f.length-1)],f[Math.min(t+1,f.length-1)])}for(let t=0;t<m-1;++t){const e=_+4*t;s.indices.push(e,e+1,e+2,e+2,e+1,e+3)}return s}function b(t,e,i=new y){if(0===t.length)return i;const r=t.length/3;let n=i.vertices.length/3;const o=void 0!==e&&e.length&&t.length;for(let s=0;s<r;++s,n++){s>0&&i.indices.push(n),s<r-1&&i.indices.push(n);for(let r=0;r<3;++r)i.vertices.push(t[3*s+r]),o&&i.vertexColors.push(e[3*s+r])}return i}e.LineGeometry=y,e.createLineGeometry=_,e.createSimpleLineGeometry=b;class x{static createGeometry(t,e,i,n,a=!1,l=!1,c=!1){if(c)return n.setAttribute("position",new r.BufferAttribute(new Float32Array(t),3)),e.length===t.length&&n.setAttribute("color",new r.BufferAttribute(new Float32Array(e),3)),n.setIndex(new r.BufferAttribute(new Uint32Array(i),1)),n;{const c=v(a,l),h=new o.InterleavedBuffer(new Float32Array(t),c.stride);return c.attributes.forEach(t=>{const e=new s.InterleavedBufferAttribute(h,t.itemSize,t.offset,!1);n.setAttribute(t.name,e)}),e.length===t.length&&n.setAttribute("color",new r.BufferAttribute(new Float32Array(e),3)),n.setIndex(new r.BufferAttribute(new Uint32Array(i),1)),n}}constructor(t=!1,e=!1,i=!1){this.hasNormalsAndUvs=t,this.highPrecision=e,this.isSimple=i,this.m_geometry=new y}clear(){this.m_geometry.vertices=[],this.m_geometry.vertexColors=[],this.m_geometry.indices=[]}add(t,e,i,r,n,o){return this.isSimple?b(e,o,this.m_geometry):((0,l.assert)(!this.hasNormalsAndUvs||void 0!==n),_(t,e,i,r,n,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 v(this.hasNormalsAndUvs,this.highPrecision).attributes}get stride(){return v(this.hasNormalsAndUvs,this.highPrecision).stride}createGeometry(t){return void 0===t&&(t=new n.BufferGeometry),x.createGeometry(this.m_geometry.vertices,this.m_geometry.vertexColors,this.m_geometry.indices,t,this.hasNormalsAndUvs,this.highPrecision)}}e.LineGroup=x},3711:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reconstructLineWidth=e.reconstructLine=e.triangulateLine=e.numCirclePoints=void 0;const r=i(5448),n=i(6815),o=new n.Vector3(0,0,1),s=[0,1,2,1,3,2],a=[0,1,3,3,1,2,0,3,4,5,4,3],l=Math.PI/8;function c(t,e,i,r,n,o){const s=n.length/3;n.push(t,e,0);for(let a=0;a<9;++a){const c=l*a+Math.PI/2+i;n.push(t+r*Math.cos(c),e+r*Math.sin(c),0),o.push(s,s+a+1,s+(a+1)%9+1)}}e.numCirclePoints=function(t){return 9}
2,e.triangulateLine=function(t,e,i,l,h=!0,u=h){if(t.length<3)return;const p=new r.Vector2;if(h){const r=3!==t.length?p.set(t[3]-t[0],t[4]-t[1]).angle():0;c(t[0],t[1],r,e,i,l)}const d=i.length/3,m=new n.Vector3,f=new n.Vector3,g=new n.Vector3,y=new n.Vector3,v=new n.Vector3,_=new n.Vector3,b=new n.Vector3,x=new n.Vector3,w=new n.Vector3,S=t.length/3;let T=0;for(let r=0;r<S;++r){let n=!1;if(f.set(t[3*r],t[3*r+1],t[3*r+2]),r+1<S){if(g.set(t[3*(r+1)],t[3*(r+1)+1],t[3*(r+1)+2]),y.copy(g).sub(f).normalize().cross(o),v.copy(y),r>0&&(v.add(m).multiplyScalar(1-.5*y.dot(m)),n=m.angleTo(y)>Math.PI/2,n)){const t=e/Math.cos(y.angleTo(m)/2);_.copy(y).add(m).normalize().multiplyScalar(-t).add(f),b.copy(m).multiplyScalar(e).add(f),x.copy(y).add(m).normalize().multiplyScalar(t).add(f),w.copy(y).multiplyScalar(e).add(f)}n?i.push(_.x,_.y,_.z,b.x,b.y,b.z,x.x,x.y,x.z,w.x,w.y,w.z):(_.copy(v).multiplyScalar(-e).add(f),b.copy(v).multiplyScalar(e).add(f),i.push(_.x,_.y,_.z,b.x,b.y,b.z)),m.copy(y)}else _.copy(m).multiplyScalar(-e).add(f),b.copy(m).multiplyScalar(e).add(f),i.push(_.x,_.y,_.z,b.x,b.y,b.z);r!==S-1&&((n?a:s).forEach(t=>l.push(d+T+t)),T+=n?4:2)}if(u){const r=2!==t.length?p.set(t[3*(S-3)]-t[3*(S-2)],t[3*(S-3)+1]-t[3*(S-2)+1]).angle():Math.PI;c(t[3*(S-2)],t[3*(S-2)+1],r,e,i,l)}},e.reconstructLine=function(t,e){const i=new Float32Array(t.length/2);for(let r=3*e,n=2*r;r<i.length;r+=3,n+=6)i[r]=t[n]+.5*(t[n+3]-t[n]),i[r+1]=t[n+1]+.5*(t[n+3+1]-t[n+1]),i[r+2]=t[n+2]+.5*(t[n+3+2]-t[n+2]);return i},e.reconstructLineWidth=function(t,e){const i=t[2*e+3]-t[2*e],r=t[2*e+3+1]-t[2*e+1],n=t[2*e+3+2]-t[2*e+2];return.5*Math.sqrt(i*i+r*r+n*n)}},8263:function(t,e,i){var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(8759),e)},8759:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.Entry=void 0;const r=i(4342);class n{constructor(t,e,i,r,n){this.key=t,this.value=e,this.size=i,this.newer=r,this.older=n}}e.Entry=n,e.LRUCache=class{constructor(t,e=()=>1){this.m_size=0,this.m_map=new Map,this.m_newest=null,this.m_oldest=null,this.m_capacity=t,this.m_sizeFunction=e}forEach(t,e){let i=this.m_newest;for(;null!==i;){const r=i.older;t.call(e,i.value,i.key,this),i=r}}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(t){this.m_capacity=t,this.evict()}setCapacityAndMeasure(t,e=()=>1){this.m_capacity=t,this.m_sizeFunction=e,this.shrinkToCapacity()}shrinkToCapacity(){let t=0;const e=this.m_sizeFunction;let i=this.m_newest;for(;null!==i;){const r=e(i.value);i.size=r,t+=r,i=i.older}this.m_size=t,this.evict()}set(t,e){const i=this.m_sizeFunction(e);let o=this.m_map.get(t);if(void 0!==o)this.m_size=this.m_size-o.size+i,o.value=e,o.size=i,this.promoteEntry(o),this.evict();else{if(i>this.m_capacity)return;if(o=new n(t,e,i,null,null),0===this.m_map.size)this.m_newest=this.m_oldest=o;else{(0,r.assert)(null!==this.m_newest);const t=this.m_newest;o.older=this.m_newest,t.newer=o,this.m_newest=o}this.m_map.set(t,o),this.m_size+=i,this.evict()}}get(t){const e=this.m_map.get(t);if(void 0!==e)return this.promoteEntry(e),e.value}has(t){return this.m_map.has(t)}clear(){this.m_newest=this.m_oldest=null,this.m_size=0,this.m_map.clear()}evictAll(){const t=this.evictionCallback;void 0!==t&&this.forEach((e,i)=>t(i,e)),this.clear()}evictSelected(t,e){const i=this.evictionCallback;let r=this.m_newest;for(;null!==r;){const n=r.older;t.call(e,r.value,r.key)&&(void 0!==i&&i(r.key,r.value),this.deleteEntry(r),this.m_map.delete(r.key)),r=n}}delete(t){const e=this.m_map.get(t);return void 0!==e&&(this.deleteEntry(e),this.m_map.delete(t))}evict(){for(;null!==this.m_oldest&&this.m_size>this.m_capacity;)if(void 0===this.evictOldest())return}evictOldest(){(0,r.assert)(null!==this.m_oldest);const t=this.m_oldest;(0,r.assert)(null===t.older);let e=t;if(void 0!==this.canEvict)for(;!this.canEvict(e.key,e.value);){if(null===e.newer)return;e=e.newer}if(e===t)this.m_oldest=e.newer,null!==e.newer&&((0,r.assert)(e.newer.older===e),e.newer.older=null);else{if(null===e.newer)return;(0,r.assert)(e.newer.older===e),e.newer.older=e.older,null!==e.older&&(e.older.newer=e.newer)}const i=this.m_map.delete(e.key);return(0,r.assert)(!0===i),i&&void 0!==this.evictionCallback&&this.evictionCallback(e.key,e.value),this.m_size-=e.size,e}deleteEntry(t){t===this.m_newest?this.m_newest=t.older:t.newer?t.newer.older=t.older:(0,r.assert)(!1),t===this.m_oldest?this.m_oldest=t.newer:t.older?t.older.newer=t.newer:(0,r.assert)(!1),this.m_size-=t.size}promoteEntry(t){if(t===this.m_newest)return;t.newer&&((0,r.assert)(t.newer.older===t),t.newer.older=t.older),t.older&&((0,r.assert)(t.older.newer===t),t.older.newer=t.newer),t===this.m_oldest&&(this.m_oldest=t.newer),t.newer=null,t.older=this.m_newest,(0,r.assert)(null!==this.m_newest);const e=this.m_newest;(0,r.assert)(null===e.newer),e.newer=t,this.m_newest=t}}}
2,2505:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CameraAnimationBuilder=void 0;const r=i(2616),n=i(2344),o=i(5448),s=i(6815),a=i(1350),l=i(9026);class c{static getLookAtFromView(t){return{target:t.target,heading:t.heading,tilt:t.tilt,distance:t.targetDistance}}static appendControlPoint(t,e,i){i=null!=i?i:10,t.controlPoints.length>0&&(void 0===e.timestamp||e.timestamp<=t.controlPoints[t.controlPoints.length-1].timestamp)&&(e.timestamp=t.controlPoints[t.controlPoints.length-1].timestamp+i),t.controlPoints.push(e)}static prependControlPoint(t,e,i){i=void 0!==i?i:10;for(const e of t.controlPoints)e.timestamp+=i;e.timestamp=0,t.controlPoints.unshift(e)}static createFlyToOptions(t,e,i,h,u){var p,d,m,f;const g=new l.ControlPoint(Object.assign({},c.getLookAtFromView(t))),y=void 0!==e.target?r.GeoCoordinates.fromObject(e.target):void 0;let v=null!=y?y:g.target;const _=void 0!==e.zoomLevel?n.MapViewUtils.calculateDistanceFromZoomLevel(t,e.zoomLevel):e.distance;let b=null!=_?_:t.targetDistance;if(void 0!==e.bounds){const i=Math.min(null!==(p=e.tilt)&&void 0!==p?p:t.tilt,n.MapViewUtils.MAX_TILT_DEG),r=-(null!==(d=e.heading)&&void 0!==d?d:t.heading),s=(0,a.getFitLookAtBoundsDistance)({target:t.target,camera:t.camera,cameraSettings:t,projection:t.projection,maxZoomLevel:t.maxZoomLevel,viewportSize:t.renderer.getSize(new o.Vector2),tileWrapping:t.tileWrappingEnabled},{bounds:e.bounds,target:y,distance:_,yaw:r,tilt:i,padding:e.padding});b=s.distance,v=s.target}if(h){const e=0|n.MapViewUtils.calculateZoomLevelFromDistance(t,b);b=n.MapViewUtils.calculateDistanceFromZoomLevel(t,e)}const x=new l.ControlPoint({target:v,distance:b,tilt:null!==(m=e.tilt)&&void 0!==m?m:g.tilt,heading:null!==(f=e.heading)&&void 0!==f?f:g.heading});if(n.MapViewUtils.closeToFrustum(t.projection.projectPoint(v,new s.Vector3),t.camera))return x.timestamp=i(g,x),{controlPoints:[g,x]};const w=[g],S=new s.Vector3;t.projection.projectPoint(g.target,S);let T=null!=u?u:2*S.distanceTo(t.projection.projectPoint(x.target));T=Math.max(g.distance+x.distance,T);const E=r.GeoCoordinates.lerp(g.target,x.target,.25),M=new l.ControlPoint({target:E,distance:T,timestamp:0,tilt:r.MathUtils.interpolateAnglesDeg(g.tilt,x.tilt,.25),heading:r.MathUtils.interpolateAnglesDeg(g.heading,x.heading,.25)});M.timestamp=M.timestamp+i(g,M),w.push(M);const A=r.GeoCoordinates.lerp(g.target,x.target,.75),C=new l.ControlPoint({target:A,distance:T,timestamp:0,tilt:r.MathUtils.interpolateAnglesDeg(g.tilt,x.tilt,.75),heading:r.MathUtils.interpolateAnglesDeg(g.heading,x.heading,.75)});return C.timestamp=M.timestamp+i(M,C),w.push(C),x.timestamp=C.timestamp+i(C,x),w.push(x),{controlPoints:w}}static createOrbitOptions(t,e=10){const i=[t],r=e/3;for(let t=1;t<4;t++){const e=i[t-1];i.push(Object.assign(Object.assign({},e),{heading:e.heading-120,timestamp:e.timestamp+r}))}return{controlPoints:i}}}e.CameraAnimationBuilder=c}
2,9026:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CameraKeyTrackAnimation=e.ControlPoint=void 0;const r=i(3827),n=i(4839),o=i(1993),s=i(2997),a=i(5760),l=i(6271),c=i(2481),h=i(3334),u=i(9747),p=i(6815),d=i(2616),m=i(2344),f=i(4342).LoggerManager.instance.create("CameraKeyTrackAnimation");e.ControlPoint=class{constructor(t){var e,i,r,n,o;this.timestamp=0,this.timestamp=null!==(e=t.timestamp)&&void 0!==e?e:0,this.target=t.target?d.GeoCoordinates.fromObject(t.target):new d.GeoCoordinates(0,0),this.tilt=null!==(i=t.tilt)&&void 0!==i?i:0,this.heading=null!==(r=t.heading)&&void 0!==r?r:0,this.distance=null!==(n=t.distance)&&void 0!==n?n:0,this.name=null!==(o=t.name)&&void 0!==o?o:Date.now().toString()}};class g extends c.Object3D{constructor(t){super(),this.distance=0,this.name=t}}e.CameraKeyTrackAnimation=class{constructor(t,e){var i,c,d,m;this.m_mapView=t,this.m_options=e,this.m_dummy=new g("dummy"),this.m_azimuthAxis=new p.Vector3(0,0,1),this.m_altitudeAxis=new p.Vector3(1,0,0),this.m_running=!1,this.m_lastFrameTime=0;const y=void 0!==this.m_options.interpolation?this.m_options.interpolation:l.InterpolateSmooth;this.m_options.loop=null!==(i=this.m_options.loop)&&void 0!==i?i:l.LoopOnce,this.m_options.repetitions=null!==(c=this.m_options.repetitions)&&void 0!==c?c:1,this.m_options.rotateOnlyClockwise=null===(d=this.m_options.rotateOnlyClockwise)||void 0===d||d,this.m_name=(null!==(m=this.m_options.name)&&void 0!==m?m:"CameraKeyTrackAnimation")+Date.now();const v=this.m_options.controlPoints.map(t=>t.timestamp),_=[],b=[];this.m_options.controlPoints.map(t=>{const e=this.m_mapView.projection.projectPoint(t.target);_.push(e.x),_.push(e.y),_.push(e.z);const i=new u.Quaternion;i.setFromAxisAngle(this.m_azimuthAxis,(0,h.degToRad)(t.heading)),i.multiply((new u.Quaternion).setFromAxisAngle(this.m_altitudeAxis,(0,h.degToRad)(t.tilt))),b.push(i.x),b.push(i.y),b.push(i.z),b.push(i.w)});const x=new a.VectorKeyframeTrack(".position",v,_,y),w=new s.QuaternionKeyframeTrack(".quaternion",v,b,y),S=new o.NumberKeyframeTrack(".distance",v,this.m_options.controlPoints.map(t=>t.distance),y);this.m_animationClip=new r.AnimationClip("cameraflyoveranimation",-1,[x,w,S]),this.m_animationClip.validate()||f.error("Review the entered controlpoints for: ",this.m_name,", The Animation was provided with invalid track data"),this.m_animationClip.resetDuration(),this.m_animationClip.trim(),this.m_animationMixer=new n.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(t){this.m_options.loop=t,this.m_animationAction.setLoop(this.m_options.loop,this.m_options.repetitions)}set repetitions(t){this.m_options.repetitions=t,this.m_animationAction.setLoop(this.m_options.loop,this.m_options.repetitions)}set rotateOnlyClockwise(t){this.m_options.rotateOnlyClockwise=t}start(t,e){this.stop(),this.m_onFinished=e,this.m_animationAction.reset().play(),this.m_lastFrameTime=Date.now(),this.m_mapView.addEventListener(m.MapViewEventNames.Render,this.m_animateCb),this.m_mapView.beginAnimation(),this.m_running=!0}stop(){this.m_running&&(this.m_mapView.removeEventListener(m.MapViewEventNames.Render,this.m_animateCb),this.m_mapView.endAnimation(),void 0!==this.m_onFinished&&window.setTimeout(()=>{var t;null===(t=this.m_onFinished)||void 0===t||t.call(this),this.m_onFinished=void 0},0),this.m_running=!1)}isRunning(){return this.m_running}updateCameraFromDummy(){let t=(0,h.radToDeg)(this.m_azimuthAxis.clone().applyQuaternion(this.m_dummy.quaternion).angleTo(this.m_azimuthAxis));t=(0,h.clamp)(t,0,m.MapViewUtils.MAX_TILT_DEG);const e=this.m_altitudeAxis.clone().applyQuaternion(this.m_dummy.quaternion);let i=e.angleTo(this.m_altitudeAxis);this.m_options.rotateOnlyClockwise&&this.m_azimuthAxis.dot(e.normalize().cross(this.m_altitudeAxis))>=0&&(i=2*Math.PI-i);const r=(0,h.radToDeg)(i),n=this.m_mapView.projection.unprojectPoint(this.m_dummy.position),o=Math.max(0,this.m_dummy.distance);(isNaN(t)||isNaN(r)||isNaN(o)||!n.isValid())&&f.error("Cannot update due to invali
2d data",t,r,o,n),this.m_mapView.lookAt({target:n,distance:o,tilt:t,heading:r})}animate(t){const e=(Date.now()-this.m_lastFrameTime)/1e3;this.m_animationMixer.update(e),this.m_lastFrameTime=Date.now(),this.updateCameraFromDummy()}}},1555:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getWidthAndHeightFromCanvas=e.safeParseDecimalInt=e.azimuthAltitudeToDirection=e.calculateNormalizedDeviceCoordinates=void 0;const r=i(5448),n=i(6815);function o(t,e){if(null==t||""===t)return e;if(!t.match(s))return e;const i=Number.parseInt(t,10);return isNaN(i)?e:i}e.calculateNormalizedDeviceCoordinates=function(t,e,i,n){return new r.Vector2(t/i*2-1,-e/n*2+1)},e.azimuthAltitudeToDirection=function(t,e){const i=new n.Vector3,r=Math.cos(e);return i.setX(Math.sin(t)*r),i.setY(Math.cos(t)*r),i.setZ(Math.sin(e)),i},e.safeParseDecimalInt=o;const s=/^\d+$/;e.getWidthAndHeightFromCanvas=function(t){return{width:o(t.style.width,t.clientWidth),height:o(t.style.height,t.clientHeight)}}},2626:function(t,e,i){var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(1153),e),n(i(5805),e),n(i(4773),e),n(i(2369),e),n(i(5199),e),n(i(1781),e)},8449:function(t,e,i){var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(8635),e),n(i(1930),e),n(i(4069),e)},8635:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DataProvider=void 0;const r=i(2356);class n extends r.EventDispatcher{constructor(){super(...arguments),this.m_clients=new Set}register(t){return 0===this.m_clients.size&&(this.m_connectPromise=this.connect()),this.m_clients.add(t),this.m_connectPromise}unregister(t){this.m_clients.delete(t)&&0===this.m_clients.size&&this.dispose()}}e.DataProvider=n},1781:(t,e,i)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.GeoJsonTiler=void 0;const n=i(242),o=i(8152),s=null!==(r=n.default)&&void 0!==r?r:n,a=-(-2&-Math.ceil(204.8));e.GeoJsonTiler=class{constructor(){this.indexes=new Map}dispose(){}async connect(){return await Promise.resolve()}async registerIndex(t,e){if(!this.indexes.has(t))return await this.updateIndex(t,e)}async updateIndex(t,e){if(e instanceof URL){const t=await fetch(e.href);if(!t.ok)throw new Error(`GeoJsonTiler: Unable to fetch ${e.href}: ${t.statusText}`);e=await t.json()}const i=(0,o.isFeatureGeometry)(e)||"GeometryCollection"===e.type||"Feature"===e.type&&void 0===e.id||"FeatureCollection"===e.type&&e.features.length>0&&void 0===e.features[0].id,r=s(e,{maxZoom:20,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:a,lineMetrics:!1,promoteId:null,generateId:i,debug:0});r.geojson=e,this.indexes.set(t,r)}async getTile(t,e){const i=this.indexes.get(t);if(void 0===i)throw new Error("Tile not found");const r=i.getTile(e.level,e.column,e.row);return null!==r&&(r.layer=t),r||{}}}},1153:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ThemedTileDecoder=void 0;const r=i(7769),n=i(4342).LoggerManager.instance.create("ThemedTileDecoder");e.ThemedTileDecoder=class{constructor(){this.m_storageLevelOffset=0}dispose(){}decodeTile(t,e,i){return void 0===this.m_styleSetEvaluator?(n.info("cannot decode tile, as there is not style available"),Promise.resolve(void 0)):this.decodeThemedTile(t,e,this.m_styleSetEvaluator,i)}getTileInfo(t,e,i){return Promise.resolve(void 0)}configure(t,e){void 0!==(null==t?void 0:t.styleSet)&&(this.m_styleSetEvaluator=new r.StyleSetEvaluator(t)),this.m_styleSetEvaluator&&t&&"enabledFeatures"in t&&this.m_styleSetEvaluator.setEnabledFeatures(t.enabledFeatures),void 0!==(null==t?void 0:t.languages)&&(this.languages=t.languages),void 0!==e&&void 0!==e.storageLevelOffset&&(this.m_storageLevelOffset=e.storageLevelOffset)}}}
2,1930:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TileDataSource=e.TileFactory=void 0;const r=i(2344),n=i(6586),o=i(1984),s=i(4342),a=i(4069);e.TileFactory=class{constructor(t){this.m_modelConstructor=t}create(t,e){const i=new this.m_modelConstructor(t,e);return i.tileLoader=new a.TileLoader(t,e,t.dataProvider(),t.decoder),i}};class l extends r.DataSource{constructor(t,e){var i,n;if(super(e),this.m_tileFactory=t,this.m_options=e,this.logger=s.LoggerManager.instance.create("TileDataSource"),this.m_isReady=!1,e.decoder)this.m_decoder=e.decoder;else{if(!e.concurrentDecoderServiceName)throw new Error(`TileDataSource[${this.name}]: unable to create, missing decoder or concurrentDecoderServiceName`);this.m_decoder=r.ConcurrentDecoderFacade.getTileDecoder(e.concurrentDecoderServiceName,e.concurrentDecoderScriptUrl,e.concurrentDecoderWorkerCount,e.workerConnectionTimeout)}this.useGeometryLoader=!0,this.cacheable=!0,this.m_unregisterClearTileCache=null===(n=(i=this.dataProvider()).onDidInvalidate)||void 0===n?void 0:n.call(i,()=>this.mapView.markTilesDirty(this))}dispose(){var t;null===(t=this.m_unregisterClearTileCache)||void 0===t||t.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 t={};void 0!==this.m_options.storageLevelOffset&&(t={storageLevelOffset:this.m_options.storageLevelOffset}),this.m_decoder.configure({languages:super.languages},t)}set languages(t){super.languages=t,this.m_decoder.configure({languages:t}),this.mapView.markTilesDirty(this)}get languages(){return super.languages}async setTheme(t,e){var i;t=await(0,n.load)(t,{baseUrl:e});const r=(0,o.getStyles)(t.styles).filter(t=>{var e;return!t.layer||(null===(e=this.layerNames)||void 0===e?void 0:e.includes(t.layer))});r.length>0&&(this.m_decoder.configure({styleSet:r,definitions:t.definitions,features:t.features,priorities:t.priorities,labelPriorities:t.labelPriorities,enabledFeatures:this.enabledFeatures}),this.isDetached()||null===(i=this.mapView)||void 0===i||i.markTilesDirty(this))}get enabledFeatures(){return this.m_enabledFeatures}set enabledFeatures(t){this.m_enabledFeatures=t,this.m_decoder.configure({enabledFeatures:t}),this.isDetached()||this.mapView.markTilesDirty(this)}dataProvider(){return this.m_options.dataProvider}getTilingScheme(){return this.m_options.tilingScheme}getTile(t,e=!1){const i=this.m_tileFactory.create(this,t);return i.copyrightInfo=this.m_options.copyrightInfo,void 0!==this.m_options.copyrightProvider&&this.m_options.copyrightProvider.getCopyrights(i.geoBox,t.level).then(t=>{i.copyrightInfo=void 0===i.copyrightInfo?t:[...i.copyrightInfo,...t],this.requestUpdate()}),e||i.load(),i}getTileInfo(t){return new Promise((e,i)=>{const n=new a.TileInfoLoader(this,t,this.m_options.dataProvider,this.decoder);n.loadAndDecode().then(t=>{t===r.TileLoaderState.Ready?e(n.tileInfo):i(new Error(`TileDataSource#getInfoTile wrong final state: ${t}`))})})}}e.TileDataSource=l},5805:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TileDecoderService=void 0;const r=i(8152),n=i(2616),o=i(1984),s=i(4342),a=i(2369),l=s.LoggerManager.instance.create("TileDecoderService");class c extends a.WorkerService{static start(t,e){return new c(t,e)}constructor(t,e){super(t),this.serviceId=t,this.m_decoder=e,this.m_decoder.connect()}handleRequest(t){return r.WorkerDecoderProtocol.isDecodeTileRequest(t)?this.handleDecodeTileRequest(t):r.WorkerDecoderProtocol.isTileInfoRequest(t)?this.handleTileInfoRequest(t):super.handleRequest(t)}handleMessage(t){r.WorkerDecoderProtocol.isConfigurationMessage(t)?this.handleConfigurationMessage(t):l.error(`[${this.serviceId}]: invalid message ${t.type}`)}async handleDecodeTileRequest(t){const e=n.TileKey.fromMortonCode(t.tileKey),i=(0,r.getProjection)(t.projection),s=await this.m_decoder.decodeTile(t.data,e,i),a=[],l=t=>{void 0!==t&&t.buffer.byteLength>0&&!a.includes(t.buffer)&&a.push(t.buffer)};
2return null==s||s.geometries.forEach(t=>{var e,i,r;if(null===(e=t.vertexAttributes)||void 0===e||e.forEach(t=>l(t)),null===(i=t.interleavedVertexAttributes)||void 0===i||i.forEach(t=>l(t)),l(t.index),l(t.edgeIndex),Array.isArray(t.objInfos)&&1===t.objInfos.length&&"object"==typeof t.objInfos[0]&&(null===(r=t.objInfos[0])||void 0===r?void 0:r.hasOwnProperty("displacementMap"))){const e=t.objInfos[0];l(e.displacementMap)}Array.isArray(t.attachments)&&t.attachments.forEach(t=>{l(t.index),l(t.edgeIndex)})}),null==s||s.techniques.forEach(t=>{(0,o.addBuffersToTransferList)(t,a)}),{response:s,transferList:a}}handleTileInfoRequest(t){const e=n.TileKey.fromMortonCode(t.tileKey),i=(0,r.getProjection)(t.projection);return this.m_decoder.getTileInfo(t.data,e,i).then(t=>({response:t,transferList:void 0!==t&&void 0!==t.transferList?t.transferList:[]}))}handleConfigurationMessage(t){this.m_decoder.configure(t,t.options)}}e.TileDecoderService=c},4069:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TileInfoLoader=e.TileLoader=void 0;const r=i(8152),n=i(2344),o=i(1406),s=i(4342).LoggerManager.instance.create("TileLoader");class a extends n.BaseTileLoader{constructor(t,e,i,r){super(t,e),this.dataSource=t,this.tileKey=e,this.dataProvider=i,this.tileDecoder=r}get priority(){return this.m_priority}set priority(t){this.m_priority=t,this.requestController&&(this.requestController.priority=t)}loadImpl(t,e,i){this.dataSource.taskQueue?this.dataSource.taskQueue.add({execute:this.loadData.bind(this,t,e,i),group:n.TileTaskGroups.FETCH_AND_DECODE,getPriority:()=>{var t;return null!==(t=this.priority)&&void 0!==t?t:0},isExpired:()=>t.aborted,estimatedProcessTime:()=>1}):this.loadData(t,e,i)}cancelImpl(){this.requestController=void 0}startDecodeTile(t,e,i){const n=this.payload;void 0!==n?(this.state=o.TileLoaderState.Decoding,this.payload=void 0,0===n.byteLength||n.constructor===Object&&0===Object.keys(n).length?this.onDecoded({geometries:[],techniques:[]},e):(this.requestController=new r.RequestController(this.priority,this.loadAbortController),this.tileDecoder.decodeTile(n,this.tileKey,this.dataSource.projection,this.requestController).then(i=>{t.aborted||this.onDecoded(i,e)}).catch(t=>{"AbortError"!==t.name&&"AbortError: Aborted"!==t.message&&i(t)}))):s.error("TileLoader#startDecodeTile: Cannot decode without payload")}loadData(t,e,i){this.dataProvider.getTile(this.tileKey,t).then(r=>{if(t.aborted){const t=new Error("Aborted");throw t.name="AbortError",t}this.onLoaded(r,e,i,t)}).catch(t=>{"AbortError"!==t.name&&"AbortError: Aborted"!==t.message&&i(t)})}onLoaded(t,e,i,r){this.state===o.TileLoaderState.Loading&&(this.state=o.TileLoaderState.Loaded,this.payload=t,this.startDecodeTile(r,e,i))}onDecoded(t,e){this.decodedTile=t,e(o.TileLoaderState.Ready)}}e.TileLoader=a,e.TileInfoLoader=class extends a{startDecodeTile(t,e,i){const n=this.payload;void 0!==n?(this.state=o.TileLoaderState.Decoding,this.requestController=new r.RequestController(this.priority),this.tileDecoder.getTileInfo(n,this.tileKey,this.dataSource.projection,this.requestController).then(i=>{t.aborted||(this.tileInfo=i,e(o.TileLoaderState.Ready))}).catch(t=>{"AbortError"!==t.name&&"AbortError: Aborted"!==t.message&&i(t)})):s.error("TileInfoLoader#startDecodeTile: Cannot decode without payload")}}},4773:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TilerService=void 0;const r=i(8152),n=i(2616),o=i(1781),s=i(2369);class a extends s.WorkerService{static start(t){return new a(t)}constructor(t){super(t),this.serviceId=t,this.tiler=new o.GeoJsonTiler}handleRequest(t){return r.WorkerTilerProtocol.isRegisterIndexRequest(t)?this.handleRegisterIndexRequest(t):r.WorkerTilerProtocol.isUpdateIndexRequest(t)?this.handleUpdateIndexRequest(t):r.WorkerTilerProtocol.isTileRequest(t)?this.handleTileRequest(t):super.handleRequest(t)}async handleTileRequest(t){const e=n.TileKey.fromMortonCode(t.tileKey);return{response:await this.tiler.getTile(t.index,e)||{}}}async handleRegisterIndexRequest(t){const e="string"==typeof t.input?new URL(t.input):t.input;return await this.tiler.registerIndex(t.id,e),{response:{}}}async handleUpdateIndexRequest(t){const e="string"==typeof t.input?new URL(t.input):t.input;return this.tiler.updateIndex(t.id,e),{response:{}}}}e.TilerService=a},2369:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerService=void 0;const r=i(8152),n=i(4342).LoggerManager.instance.create("WorkerService",{enabled:!0});e.WorkerService=class{constructor(t){this.serviceId=t,this.m_pendingRequests=new Map,this.onMessage=t=>{if("string"==typeof t.data.service&&t.data.service===this.serviceId)try{if(r.WorkerServiceProtocol.isRequestMessage(t.data)){const e=t.data,i={service:e.service,messageId:e.messageId,responseSent:!1};this.m_pendingRequests.set(e.messageId,i),this.tryHandleRequest(e.request).then(t=>{this.doSendResponse(i,{service:this.serviceId,type:r.WorkerServiceProtocol.ServiceMessageName.Response,messageId:e.messageId,response:t.response},t.transferList)}).catch(t=>{this.doSendResponse(i,{service:this.serviceId,type:r.WorkerServiceProtocol.ServiceMessageName.Response,messageId:e.messageId,errorMessage:t.toString(),errorStack:t.stack})})}else this.tryHandleMessage(t.data)}catch(e){n.error(`[${this.serviceId}]: Unhandled exception when handling ${t.type}`)}},self.addEventListener("message",this.onMessage);const e={service:t,type:r.WorkerServiceProtocol.ServiceMessageName.Initialized};self.postMessage(e)}destroy(){this.cancelAllPendingRequests(),self.removeEventListener("message",this.onMessage)}handleMessage(t){n.error(`[${this.serviceId}]: Invalid message ${t.type}`)}handleRequest(t){throw new Error(`ServiceAdapter[${this.serviceId}]: Invalid request '${t.type}'`)}tryHandleMessage(t){try{this.handleMessage(t)}catch(e){n.error(`[${this.serviceId}]: Failed, handling message ${t.type}`)}}tryHandleRequest(t){try{return this.handleRequest(t)}catch(t){return n.error(`[${this.serviceId}]: Failure`,t),Promise.reject(t)}}doSendResponse(t,e,i){t.responseSent||(void 0!==i?self.postMessage(e,i):self.postMessage(e),t.responseSent=!0,this.m_pendingRequests.delete(t.messageId))}cancelAllPendingRequests(){this.m_pendingRequests.forEach(t=>{this.doSendResponse(t,{service:this.serviceId,type:r.WorkerServiceProtocol.ServiceMessageName.Response,messageId:t.messageId,errorMessage:"cancelled"})})}}},5199:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerServiceManager=void 0;const r=i(8152),n=i(2369);class o extends n.WorkerService{static getInstance(){return void 0===this.m_service&&(this.m_service=new o(r.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID)),this.m_service}constructor(t=r.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID){super(t),this.m_factories=new Map,this.m_services=new Map}register(t){this.m_factories.set(t.serviceType,t.factory)}
2handleRequest(t){if(t.type===r.WorkerServiceProtocol.Requests.CreateService){if(void 0!==this.m_services.get(t.targetServiceId))throw Error(`error - service with targetServiceId='${t.targetServiceId}' already running, ignoring CreateService request`);const e=this.m_factories.get(t.targetServiceType);if(void 0===e)throw Error(`unknown targetServiceType requested: '${t.targetServiceType}'`);const i=e(t.targetServiceId);this.m_services.set(t.targetServiceId,i)}if(t.type===r.WorkerServiceProtocol.Requests.DestroyService){const e=this.m_services.get(t.targetServiceId);if(void 0===e)throw Error(`unknown targetServiceId '${t.targetServiceId}'`);e.destroy(),this.m_services.delete(t.targetServiceId)}return Promise.resolve({response:{}})}}e.WorkerServiceManager=o},2344:function(t,e,i){var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),e.ThemeLoader=void 0,n(i(2541),e),n(i(3509),e),n(i(7220),e),n(i(8907),e),n(i(4442),e),n(i(9978),e),n(i(207),e),n(i(5307),e),n(i(1818),e),n(i(7511),e),n(i(4549),e),n(i(8380),e),n(i(9348),e),n(i(9993),e),n(i(4757),e),n(i(4303),e),n(i(4055),e),n(i(1774),e),n(i(3103),e),n(i(5187),e),n(i(8427),e),n(i(2476),e),n(i(5071),e),n(i(2175),e),n(i(4988),e),n(i(1406),e),n(i(9237),e),n(i(5159),e),n(i(5482),e),n(i(3977),e),n(i(4247),e),n(i(3061),e),n(i(5146),e),n(i(8881),e),n(i(5738),e),n(i(8015),e),n(i(2967),e),n(i(304),e),n(i(3800),e),n(i(1797),e),e.ThemeLoader=i(6586),n(i(1447),e),n(i(5571),e),n(i(4269),e),n(i(541),e),n(i(5008),e),n(i(9931),e),n(i(3373),e),n(i(1973),e)},2541:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AnimatedExtrusionHandler=e.AnimatedExtrusionState=void 0;const r=i(8152),n=i(4250),o=i(1984),s=i(4342);var a;!function(t){t[t.None=0]="None",t[t.Started=1]="Started",t[t.Finished=2]="Finished"}(a=e.AnimatedExtrusionState||(e.AnimatedExtrusionState={})),e.AnimatedExtrusionHandler=class{constructor(t){this.m_mapView=t,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(t){this.m_forceEnabled=t,this.duration=750}get minZoomLevel(){return this.m_minZoomLevel}setAnimationProperties(t,e){if(!(0,o.isExtrudedPolygonTechnique)(t))return!1;if(t.hasOwnProperty("minZoomLevel")&&(this.m_minZoomLevel=t.minZoomLevel),this.forceEnabled)return this.enabled;void 0!==t.animateExtrusionDuration&&(this.duration=t.animateExtrusionDuration);const i=(0,r.getPropertyValue)(t.animateExtrusion,e);return null===i?this.enabled:"boolean"==typeof i?i:"number"==typeof i&&0!==i}update(t){const e=this.m_dataSourceMap.size>0&&t>=this.m_minZoomLevel;this.m_state===a.None&&e?this.m_state=a.Started:this.m_state===a.None||e||this.resetAnimation(!0),this.animateExtrusion()}add(t,e){t.addDisposeCallback(this.removeTile.bind(this));let i=!1;this.m_state!==a.None&&(i=this.skipAnimation(t),i?this.setTileExtrusionRatio(e,1):this.m_state===a.Finished&&this.resetAnimation(!1)),this.getOrCreateTileMap(t.dataSource).set(t.tileKey.mortonCode(),{materials:e,animated:i})}get isAnimating(){return this.m_state!==a.Finished&&this.m_state!==a.None}getTileMap(t,e=!1){return this.m_dataSourceMap.get(t)}getOrCreateTileMap(t){let e=this.m_dataSourceMap.get(t);return e||(e=new Map,this.m_dataSourceMap.set(t,e)),e}skipAnimation(t){return this.wasAnyAncestorAnimated(t)||this.wasAnyDescendantAnimated(t)}wasAnyAncestorAnimated(t){var e,i;const r=t.dataSource.getDataZoomLevel(this.m_minZoomLevel),n=Math.max(0,t.tileKey.level-r),o=Math.min(n,this.m_mapView.visibleTileSet.options.quadTreeSearchDistanceUp),s=this.getTileMap(t.dataSource);if(!s)return!1;let a=t.tileKey;for(let t=1;t<=o;++t)if(a=a.parent(),null!==(i=null===(e=s.get(a.mortonCode()))||void 0===e?void 0:e.animated)&&void 0!==i&&i)return!0;return!1}wasAnyDescendantAnimated(t){var e,i;const r=t.dataSource.maxDataLevel-t.tileKey.level,n=Math.min(r,this.m_mapView.visibleTileSet.options.quadTreeSearchDistanceDown),o=this.getTileMap(t.dataSource);if(!o)return!1;const s=t.dataSource.getTilingScheme();let a=[t.tileKey],l=[];for(let t=1;t<=n;++t){l.length=0;for(const t of a)for(const r of s.getSubTileKeys(t)){if(null!==(i=null===(e=o.get(r.mortonCode()))||void 0===e?void 0:e.animated)&&void 0!==i&&i)return!0;l.push(r)}[a,l]=[l,a]}return!1}removeTile(t){const e=this.getTileMap(t.dataSource);e&&(e.delete(t.tileKey.mortonCode()),0===e.size&&this.m_dataSourceMap.delete(t.dataSource))}animateExtrusion(){if(this.m_state!==a.Started)return;const t=Date.now();this.m_startTime<0&&(this.m_startTime=t);const e=this.duration,i=Math.min(t-this.m_startTime,e),r=s.MathUtils.easeInOutCubic(n.ExtrusionFeatureDefs.DEFAULT_RATIO_MIN,n.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX,i/e);this.setExtrusionRatio(r),i>=e&&(this.m_state=a.Finished),this.m_mapView.update()}resetAnimation(t){this.m_state=a.None,this.m_startTime=-1,t&&this.m_dataSourceMap.forEac
2h(t=>{t.forEach(t=>{t.animated=!1})})}setExtrusionRatio(t){this.m_dataSourceMap.forEach(e=>{e.forEach(e=>{e.animated||(this.setTileExtrusionRatio(e.materials,t),t>=1&&(e.animated=!0))})})}setTileExtrusionRatio(t,e){t.forEach(t=>{t.extrusionRatio=e})}}},5863:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BackgroundDataSource=void 0;const r=i(2616),n=i(8023),o=i(4303),s=i(8024),a=i(1447);class l extends o.DataSource{constructor(t){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!=t?t:l.DEFAULT_TILING_SCHEME}canProvideIconText(){return!1}get backgroundColor(){return this.m_backgroundColor}updateStorageLevelOffset(){let t;this.mapView.dataSources.forEach(e=>{e!==this&&e.getTilingScheme()===this.m_tilingScheme&&(t=void 0===t?e.storageLevelOffset:Math.max(t,e.storageLevelOffset))}),void 0===t&&(t=0),t!==this.storageLevelOffset&&(this.storageLevelOffset=t,this.mapView.clearTileCache(this.name))}async setTheme(t){if(this.mapView.clearTileCache(this.name),void 0!==t.clearColor){const e=n.Expr.fromJSON(t.clearColor,t.definitions);this.m_backgroundColor=e.isDynamic()?e:e.evaluate(this.mapView.env,n.ExprScope.Value)}else this.m_backgroundColor=l.DEFAULT_COLOR}getTilingScheme(){return this.m_tilingScheme}getTile(t){const e=new a.Tile(this,t);return e.forceHasGeometry(!0),(0,s.addGroundPlane)(e,l.GROUND_RENDER_ORDER,this.m_backgroundColor),e}}e.BackgroundDataSource=l,l.NAME="background",l.DEFAULT_COLOR=16777215,l.GROUND_RENDER_ORDER=Number.MIN_SAFE_INTEGER,l.DEFAULT_TILING_SCHEME=r.webMercatorTilingScheme},3509:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseTileLoader=void 0;const r=i(4342),n=i(1406),o=r.LoggerManager.instance.create("BaseTileLoader");e.BaseTileLoader=class{constructor(t,e){this.dataSource=t,this.tileKey=e,this.state=n.TileLoaderState.Initialized,this.m_priority=0,this.loadAbortController=new AbortController}get priority(){return this.m_priority}set priority(t){this.m_priority=t}loadAndDecode(){switch(this.state){case n.TileLoaderState.Loading:case n.TileLoaderState.Loaded:case n.TileLoaderState.Decoding:return this.donePromise;case n.TileLoaderState.Ready:case n.TileLoaderState.Failed:case n.TileLoaderState.Initialized:case n.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(n.TileLoaderState.Canceled)}get isFinished(){return this.state===n.TileLoaderState.Ready||this.state===n.TileLoaderState.Canceled||this.state===n.TileLoaderState.Failed}cancelImpl(){}startLoading(){(0,r.assert)(this.state!==n.TileLoaderState.Loading),this.state=n.TileLoaderState.Loading,this.loadImpl(this.loadAbortController.signal,this.onDone.bind(this),this.onError.bind(this)),void 0===this.donePromise&&(this.donePromise=new Promise((t,e)=>{this.resolveDonePromise=t,this.rejectedDonePromise=e}))}onDone(t){this.resolveDonePromise&&t===n.TileLoaderState.Ready?this.resolveDonePromise(t):this.rejectedDonePromise&&this.rejectedDonePromise(t),this.resolveDonePromise=void 0,this.rejectedDonePromise=void 0,this.donePromise=void 0,this.state=t}onError(t){if(this.state===n.TileLoaderState.Canceled)return;const e=this.dataSource;o.error(`[${e.name}]: failed to load tile ${this.tileKey.mortonCode()}`,t),this.error=t,this.onDone(n.TileLoaderState.Failed)}}},7220:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BoundsGenerator=void 0;const r=i(2616),n=i(6313),o=i(7284);e.BoundsGenerator=class{constructor(t){this.m_view=t,this.createViewBounds()}
2generate(){return this.m_view.projection!==this.m_viewBounds.projection&&this.createViewBounds(),this.m_viewBounds.generate()}createViewBounds(){this.m_viewBounds=this.m_view.projection.type===r.ProjectionType.Planar?new n.PlaneViewBounds(this.m_view.camera,this.m_view.projection,this.m_view):new o.SphereViewBounds(this.m_view.camera,this.m_view.projection)}}},8907:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CameraMovementDetector=void 0;const r=i(6815),n=i(541);e.CameraMovementDetector=class{constructor(t,e,i){this.m_throttlingTimeout=t,this.m_movementStartedFunc=e,this.m_movementFinishedFunc=i,this.m_lastCameraPos=new r.Vector3,this.m_newCameraPos=new r.Vector3,this.m_throttlingTimerId=void 0,this.m_movementDetectorDeadline=0,this.onDeadlineTimer=()=>{this.m_throttlingTimerId=void 0;const t=performance.now();t>=this.m_movementDetectorDeadline?this.movementFinished():this.startMovementFinishedTimer(t)},void 0===this.m_throttlingTimeout&&(this.m_throttlingTimeout=300)}checkCameraMoved(t,e){const i=n.MapViewUtils.extractAttitude(t,t.camera),r=t.camera.getWorldPosition(this.m_newCameraPos);if(void 0===this.m_lastAttitude)return this.m_lastCameraPos.copy(r),this.m_lastAttitude=i,!1;const o=!this.m_lastCameraPos.equals(r)||i.yaw!==this.m_lastAttitude.yaw||i.pitch!==this.m_lastAttitude.pitch||i.roll!==this.m_lastAttitude.roll;return o&&(this.m_lastCameraPos.copy(r),this.m_lastAttitude=i),o!==this.m_cameraMovedLastFrame&&(o&&this.movementStarted(),this.m_cameraMovedLastFrame=o),o&&(this.m_movementDetectorDeadline=e+this.m_throttlingTimeout,this.startMovementFinishedTimer(e)),this.m_cameraMovedLastFrame}clear(t){const e=t.camera.getWorldPosition(this.m_newCameraPos);this.m_lastCameraPos.set(e.x,e.y,e.z);const i=n.MapViewUtils.extractAttitude(t,t.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(t){if(void 0===this.m_throttlingTimerId){const e=Math.max(0,this.m_movementDetectorDeadline-t);this.m_throttlingTimerId=setTimeout(this.onDeadlineTimer,e)}}removeMovementFinishedTimer(){void 0!==this.m_throttlingTimerId&&(clearTimeout(this.m_throttlingTimerId),this.m_throttlingTimerId=void 0)}}},4442:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CameraUtils=void 0;const r=i(3334),n=i(5448),o=i(4342),s=i(3103);function a(t,e,i){return(0,o.assert)(t>0,"Focal length must be larger than 0"),Math.atan((1-e)*i*.5/t)}function l(t,e,i){return(0,o.assert)(t>0,"Focal length must be larger than 0"),0===e?2*Math.atan(.5*i/t):a(t,e,i)+a(t,-e,i)}function c(t){return t.userData.fovs}function h(t,e,i,n,o){const c=n*t.aspect;let h=l(i,e.x,c);if((h<s.MIN_FOV_RAD||h>s.MAX_FOV_RAD)&&(h=(0,r.clamp)(h,s.MIN_FOV_RAD,s.MAX_FOV_RAD),o=l(u(h,c,e.x),e.y,n)),t.fov=(0,r.radToDeg)(o),0===(p=e).x&&0===p.y)delete t.userData.fovs;else{const r=n*t.aspect;t.userData.fovs={top:a(i,e.y,n),right:a(i,e.x,r),horizontal:h}}var p;t.userData.focalLength=i}function u(t,e,i){const r=e/2;if(0===i)return r/Math.tan(t/2);const n=i**2;if(Math.abs(t-Math.PI/2)<1e-6)return r*Math.sqrt(1-n);const s=Math.tan(t),a=r*(1+Math.sign(s)*Math.sqrt(1+s**2*(1-n)))/s;return(0,o.assert)(a>=0,"Focal length must be larger than 0"),a}!function(t){function e(t){var e;return null===(e=t.userData)||void 0===e?void 0:e.focalLength}function i(t){return(0,r.degToRad)(t.fov)}function o(t,e,n){e=(0,r.clamp)(e,s.MIN_FOV_RAD,s.MAX_FOV_RAD);const o=a(t);return h(t,o,u(e,n,o.y),n,e),i(t)}function a(t,e=new n.Vector2){return e.x=-t.projectionMatrix.elements[8],e.y=-t.projectionMatrix.elements[9],e}function p(t){var e,i;return null!==(i=null===(e=c(t))||void 0===e?void 0:e.horizontal)&&void 0!==i?i:2*Math.atan(Math.tan((0,r.degToRad)(t.fov)/2)*t.aspect)}function d(t){var e,i;return null!==(i=null===(e=c(t))||void 0===e?void 0:e.top)&&void 0!==i?i:(0,r.degToRad)(t.fov/2)}function m(t){var e,i;return null!==(i=null===(e=c(t))||void 0===e?void 0:e.right)&&void 0!==i?i:p(t)/2}t.getFocalLength=e,t.setFocalLength=function(t,i,r){const n=a(t),c=l(i,n.y,r);return c<s.MIN_FOV_RAD||c>s.MAX_FOV_RAD?o(t,c,r):h(t,n,i,r,c),e(t)}
2,t.getVerticalFov=i,t.setVerticalFov=o,t.convertWorldToScreenSize=function(t,e,i){return t*i/e},t.convertScreenToWorldSize=function(t,e,i){return e*i/t},t.getPrincipalPoint=a,t.setPrincipalPoint=function(t,e){const i=t.aspect,n=.999999;t.setViewOffset(i,1,-(0,r.clamp)(e.x,-.999999,n)*i/2,1*(0,r.clamp)(e.y,-.999999,n)/2,i,1)},t.getHorizontalFov=p,t.getTopFov=d,t.getBottomFov=function(t){return(0,r.degToRad)(t.fov)-d(t)},t.getRightFov=m,t.getLeftFov=function(t){var e;return void 0!==(null===(e=c(t))||void 0===e?void 0:e.right)?p(t)-m(t):p(t)/2}}(e.CameraUtils||(e.CameraUtils={}))},9978:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createDefaultClipPlanesEvaluator=e.TiltViewClipPlanesEvaluator=e.TopViewClipPlanesEvaluator=e.ElevationBasedClipPlanesEvaluator=void 0;const r=i(2479),n=i(3216),o=i(3334),s=i(9747),a=i(5381),l=i(5448),c=i(6815),h=i(2616),u=i(4342),p=i(4442),d=i(541),m=1e-6;var f;!function(t){const e=[new c.Vector3,new c.Vector3],i=new n.Raycaster,r=new a.Sphere(new c.Vector3,h.EarthConstants.EQUATORIAL_RADIUS);function s(t,e){return t-e<m?0:Math.sqrt(t*t-e*e)}t.getFarDistanceFromElevatedHorizon=function(e,i,r,n){const o=s(i,r),a=s(n,r),l=Math.asin(r/i),c=Math.abs(l-t.getNormalToFwdAngle(e));return Math.cos(c)*(o+a)},t.getProjNearPlaneTanDistance=function(t,i,r){const n=t.getWorldDirection(e[0]),o=e[1].copy(n).multiplyScalar(-r).sub(t.position),s=o.dot(n);return s/o.length()>Math.cos(i)?s:void 0},t.getProjSphereIntersectionDistance=function(t,n,o){i.setFromCamera(n,t),r.radius=o;const s=i.ray.intersectSphere(r,e[0]);return null!==s?s.sub(t.position).dot(t.getWorldDirection(e[1])):void 0},t.getNormalToFwdAngle=function(t){const i=e[0].copy(t.position).negate().normalize().dot(t.getWorldDirection(e[1]));return Math.acos((0,o.clamp)(i,-1,1))}}(f||(f={}));class g{constructor(t,e){(0,u.assert)(t>=e),this.m_minElevation=e,this.m_maxElevation=t}set maxElevation(t){this.m_maxElevation=t,this.m_minElevation=Math.min(t,this.m_minElevation)}get maxElevation(){return this.m_maxElevation}set minElevation(t){this.m_minElevation=t,this.m_maxElevation=Math.max(t,this.m_maxElevation)}get minElevation(){return this.m_minElevation}}e.ElevationBasedClipPlanesEvaluator=g;class y extends g{constructor(t=h.EarthConstants.MAX_BUILDING_HEIGHT,e=0,i=1,r=.05,n=6){super(t,e),this.nearMin=i,this.nearFarMarginRatio=r,this.farMaxRatio=n,this.m_tmpVectors=[new c.Vector3,new c.Vector3,new c.Vector3],this.m_tmpQuaternion=new s.Quaternion,(0,u.assert)(i>0),(0,u.assert)(r>=0),(0,u.assert)(n>1);const o=r*i;this.m_minimumViewRange={near:i,far:i+o,minimum:this.nearMin,maximum:Math.max(i*n,i+o)}}evaluateClipPlanes(t,e,i){(0,u.assert)(t instanceof r.PerspectiveCamera,"Unsupported camera type.");const n=t;return e.type===h.ProjectionType.Spherical?this.evaluateDistanceSphericalProj(n,e,i):e.type===h.ProjectionType.Planar?this.evaluateDistancePlanarProj(n,e,i):((0,u.assert)(!1,"Unsupported projection type"),Object.assign({},this.minimumViewRange))}get minimumViewRange(){return this.m_minimumViewRange}evaluateDistancePlanarProj(t,e,i){(0,u.assert)(e.type!==h.ProjectionType.Spherical);let r=this.nearMin,n=this.nearMin*this.farMaxRatio;const o=e.groundDistance(t.position),s=o*this.farMaxRatio;r=o-this.maxElevation,n=o-this.minElevation,r=Math.max(r,this.nearMin),n=Math.min(n,s);const a=this.nearFarMarginRatio*(r+n)/2;return r=Math.max(r-a/2,this.nearMin),n=Math.max(n+a/2,r+a),{near:r,far:n,minimum:this.nearMin,maximum:Math.max(s,n)}}evaluateDistanceSphericalProj(t,e,i){(0,u.assert)(e.type===h.ProjectionType.Spherical);const r=e.groundDistance(t.position);let n=r-this.maxElevation;const s=h.EarthConstants.EQUATORIAL_RADIUS,a=Math.max(m,t.position.length()),l=Math.asin(s/a);let c=(0,o.degToRad)(t.fov/2);t.aspect>1&&(c=d.MapViewUtils.calculateHorizontalFovByVerticalFov(2*c,t.aspect));const p=s+this.maxElevation,g=f.getFarDistanceFromElevatedHorizon(t,a,s,p);let y=c>l?g:this.getFovBasedFarPlane(t,a,s,2*c,e);const v=r-this.minElevation,_=r*this.farMaxRatio;n=Math.max(n,this.nearMin),y=Math.max(y,v);const b=this.nearFarMarginRatio*(n+y)/2;return n=Math.max(n-b/2,this.nearMin),y=Math.max(y+b/2,n+b),{near:n,far:y,minimum:this.nearMin,maximum:_}}getFovBasedFarPlane(t,e,i,r,n){const o=t.position;t.matrixWorld.extractBasis(this.m_tmpVectors[0],this.m_tmpVectors[1],this.m_tmpVectors[2]),this.m_tmpQuaternion.setFromAxisAngle(this.m_tmpVectors[0],r/2);const s=this.m_tmpVectors[2],a=this.m_tmpVectors[1].copy(s).applyQuaternion(this.m_tmpQuaternion),l=o.dot(a);
2if(l<0)return n.groundDistance(t.position)*this.farMaxRatio;const c=o.dot(o)-l*l,h=i*i;return(0,u.assert)(c<=h,"Please use this evaluator only for top view camera poses."),l-Math.sqrt(h-c)}}e.TopViewClipPlanesEvaluator=y;class v extends y{constructor(){super(...arguments),this.m_tmpV2=new l.Vector2}evaluateDistancePlanarProj(t,e,i){(0,u.assert)(e.type!==h.ProjectionType.Spherical);const r=Object.assign({},this.minimumViewRange),n=Math.PI/2-m,s=e.groundDistance(t.position),a=d.MapViewUtils.extractCameraTilt(t,e),l=p.CameraUtils.getTopFov(t),c=p.CameraUtils.getBottomFov(t),f=(0,o.clamp)(a+l,-n,n),g=(0,o.clamp)(a-c,-n,n),y=Math.max(0,(s-this.minElevation)/Math.cos(f)),v=Math.max(0,(s-this.maxElevation)/Math.cos(g));return r.near=v*Math.cos(c),r.far=y*Math.cos(l),this.applyViewRangeConstraints(r,t,e,i)}evaluateDistanceSphericalProj(t,e,i){(0,u.assert)(e.type===h.ProjectionType.Spherical);const r=Object.assign({},this.minimumViewRange);return r.near=this.computeNearDistSphericalProj(t,e),r.far=this.computeFarDistSphericalProj(t,e),this.applyViewRangeConstraints(r,t,e,i)}computeNearDistSphericalProj(t,e){(0,u.assert)(e.type===h.ProjectionType.Spherical);const i=e.groundDistance(t.position)-this.maxElevation;if(i<=0)return 0;const r=h.EarthConstants.EQUATORIAL_RADIUS+this.maxElevation,n=p.CameraUtils.getBottomFov(t),o=f.getProjNearPlaneTanDistance(t,n,r);if(void 0!==o)return o;p.CameraUtils.getPrincipalPoint(t,this.m_tmpV2);const s=this.m_tmpV2.y>0,a=f.getProjSphereIntersectionDistance(t,this.m_tmpV2.setComponent(1,-1),r),l=s?f.getProjSphereIntersectionDistance(t,this.m_tmpV2.setComponent(1,1),r):1/0,c=Math.min(null!=a?a:1/0,null!=l?l:1/0);return(0,u.assert)(c!==1/0,"No reference point for near distance found"),null!=c?c:i}computeFarDistSphericalProj(t,e){(0,u.assert)(e.type===h.ProjectionType.Spherical);const i=h.EarthConstants.EQUATORIAL_RADIUS,r=i+this.minElevation,n=i+this.maxElevation,o=t.position.length();p.CameraUtils.getPrincipalPoint(t,this.m_tmpV2);const s=this.m_tmpV2.x<=0?1:-1,a=this.m_tmpV2.y>0,l=f.getProjSphereIntersectionDistance(t,this.m_tmpV2.set(s,1),r),c=a?f.getProjSphereIntersectionDistance(t,this.m_tmpV2.set(s,-1),r):0,d=Math.max(null!=l?l:1/0,null!=c?c:1/0);return d!==1/0?d:f.getFarDistanceFromElevatedHorizon(t,o,i,n)}applyViewRangeConstraints(t,e,i,r){const{distance:n}=d.MapViewUtils.getTargetAndDistance(i,e,r),s=i.groundDistance(e.position)-this.minElevation,a=n*this.farMaxRatio;t.near=Math.max(t.near,this.nearMin),t.far=(0,o.clamp)(t.far,s,a);const l=this.nearFarMarginRatio*(t.near+t.far)/2;return t.near=Math.max(t.near-l/2,this.nearMin),t.far=Math.max(t.far+l/2,t.near+l),t.minimum=this.nearMin,t.maximum=a,t}}e.TiltViewClipPlanesEvaluator=v,e.createDefaultClipPlanesEvaluator=()=>new v},207:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ColorCache=void 0;const r=i(5971);class n{constructor(){this.m_map=new Map}static get instance(){return this.m_instance}getColor(t){"number"==typeof t&&(t="#"+t.toString(16).padStart(6,"0"));let e=this.m_map.get(t);return void 0!==e||(e=new r.Color(t),this.m_map.set(t,e)),e}get size(){return this.m_map.size}clear(){this.m_map.clear()}}e.ColorCache=n,n.m_instance=new n},1818:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConcurrentDecoderFacade=void 0;const r=i(7685),n=i(9931);class o{static getTileDecoder(t,e,i,r){const o=this.getWorkerSet(e,i,r);return new n.WorkerBasedDecoder(o,t)}static getWorkerSet(t,e,i){void 0===t&&(t=this.defaultScriptUrl);let n=this.workerSets[t];if(void 0===n){const o=void 0!==i?1e3*i:void 0;n=new r.ConcurrentWorkerSet({scriptUrl:t,workerCount:null!=e?e:this.defaultWorkerCount,workerConnectionTimeout:o}),this.workerSets[t]=n}return n}static destroyWorkerSet(t){const e=this.workerSets[t];void 0!==e&&(e.destroy(),delete this.workerSets[t])}static destroy(){Object.keys(this.workerSets).forEach(t=>{this.workerSets[t].destroy()}),this.workerSets={}}static destroyIfTerminated(){let t=!0;Object.keys(this.workerSets).forEach(e=>{this.workerSets[e].terminated||(t=!1)}),t&&o.destroy()}}e.ConcurrentDecoderFacade=o,o.defaultScriptUrl="./decoder.bundle.js",o.defaultWorkerCount=void 0,o.workerSets={}},7511:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.ConcurrentTilerFacade=void 0;const r=i(7685),n=i(3373);class o{static getTiler(t,e,i,r){const o=this.getWorkerSet(e,i,r);return new n.WorkerBasedTiler(o,t)}static getWorkerSet(t,e,i){void 0===t&&(t=this.defaultScriptUrl);let n=this.workerSets[t];if(void 0===n){const o=void 0!==i?1e3*i:void 0;n=new r.ConcurrentWorkerSet({scriptUrl:t,workerCount:null!=e?e:this.defaultWorkerCount,workerConnectionTimeout:o}),this.workerSets[t]=n}return n}static destroyWorkerSet(t){const e=this.workerSets[t];void 0!==e&&(e.destroy(),delete this.workerSets[t])}static destroy(){Object.keys(this.workerSets).forEach(t=>{this.workerSets[t].destroy()}),this.workerSets={}}static destroyIfTerminated(){let t=!0;Object.keys(this.workerSets).forEach(e=>{this.workerSets[e].terminated||(t=!1)}),t&&o.destroy()}}e.ConcurrentTilerFacade=o,o.defaultScriptUrl="./decoder.bundle.js",o.defaultWorkerCount=1,o.workerSets={}},7685:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConcurrentWorkerSet=e.DEFAULT_WORKER_INITIALIZATION_TIMEOUT=e.isLoggingMessage=void 0;const r=i(3334),n=i(8152),o=i(4342),s=i(1973),a=o.LoggerManager.instance.create("ConcurrentWorkerSet");function l(t){return t&&"number"==typeof t.level&&t.type===o.WORKERCHANNEL_MSG_TYPE}e.isLoggingMessage=l,e.DEFAULT_WORKER_INITIALIZATION_TIMEOUT=1e4,e.ConcurrentWorkerSet=class{constructor(t){this.m_options=t,this.m_workerChannelLogger=o.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=(t,e)=>{if(n.WorkerServiceProtocol.isResponseMessage(e.data)){const i=e.data;if(null===i.messageId)return void a.error(`[${this.m_options.scriptUrl}]: Bad ResponseMessage: no messageId`);const r=this.m_requests.get(i.messageId);if(void 0===r)return void a.error(`[${this.m_options.scriptUrl}]: Bad ResponseMessage: invalid messageId`);if(t>=0&&t<this.m_workers.length){const e=this.m_workers[t];this.m_availableWorkers.push(e),this.checkWorkerRequestQueue()}else a.error(`[${this.m_options.scriptUrl}]: onWorkerMessage: invalid workerId`);if(void 0!==i.errorMessage){const t=new Error(i.errorMessage);void 0!==i.errorStack&&(t.stack=i.errorStack),r.resolver(t)}else r.resolver(void 0,i.response)}else if(n.WorkerServiceProtocol.isInitializedMessage(e.data)){const t=this.getReadyPromise(e.data.service);++t.count===this.m_workerPromises.length&&t.resolve()}else if(l(e.data))switch(e.data.level){case o.LogLevel.Trace:this.m_workerChannelLogger.trace(...e.data.message);break;case o.LogLevel.Debug:this.m_workerChannelLogger.debug(...e.data.message);break;case o.LogLevel.Log:this.m_workerChannelLogger.log(...e.data.message);break;case o.LogLevel.Info:this.m_workerChannelLogger.info(...e.data.message);break;case o.LogLevel.Warn:this.m_workerChannelLogger.warn(...e.data.message);break;case o.LogLevel.Error:this.m_workerChannelLogger.error(...e.data.message)}else this.eventHandler(e)},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(t){if(void 0!==t&&(this.m_options=t),!this.m_stopped)throw new Error("ConcurrentWorker set already started");this.m_workerCount=(0,o.getOptionValue)(this.m_options.workerCount,"undefined"!=typeof navigator&&void 0!==navigator.hardwareConcurrency?(0,r.clamp)(navigator.hardwareConcurrency-1,1,2):void 0,2);const i=(0,o.getOptionValue)(this.m_options.workerConnectionTimeout,e.DEFAULT_WORKER_INITIALIZATION_TIMEOUT),n=this.m_workers,a=this.m_availableWorkers;for(let t=0;t<this.m_workerCount;++t){const e=s.WorkerLoader.startWorker(this.m_options.scriptUrl,i).then(e=>{const i=e=>{this.onWorkerMessage(t,e)};return e.addEventListener("message",i),n.push(e),a.push(e),{worker:e,listener:i}});this.m_workerPromises.push(e)}this.m_stopped=!1}get workerCount(){return this.m_workerCount}async stop(){this.m_stopped=!0,await this.waitForAllResponses().then(()=>{this.terminateWorkers()})}
2destroy(){this.m_stopped=!0,this.m_requests.forEach(t=>{t.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(t){return this.ensureStarted(),await Promise.all(this.m_workerPromises),await this.getReadyPromise(t).promise}addEventListener(t,e){this.m_eventListeners.set(t,e)}removeEventListener(t){this.m_eventListeners.delete(t)}invokeRequest(t,e,i,r){this.ensureStarted();const o=this.m_nextMessageId++;let s;const a=new Promise((t,e)=>{s=(i,r)=>{this.m_requests.delete(o),void 0!==i?e(i):t(r)}});this.m_requests.set(o,{promise:a,resolver:s});const l={service:t,type:n.WorkerServiceProtocol.ServiceMessageName.Request,messageId:o,request:e};return this.postRequestMessage(l,i,r),a}broadcastRequest(t,e,i){const r=[];for(const o of this.m_workers){const s=this.m_nextMessageId++;let a;const l=new Promise((t,e)=>{a=(i,r)=>{this.m_requests.delete(s),void 0!==i?e(i):t(r)}});r.push(l),this.m_requests.set(s,{promise:l,resolver:a});const c={service:t,type:n.WorkerServiceProtocol.ServiceMessageName.Request,messageId:s,request:e};void 0!==i?o.postMessage(c,i):o.postMessage(c)}return Promise.all(r)}broadcastMessage(t,e){this.ensureStarted(),void 0!==e?this.m_workers.forEach(i=>i.postMessage(t,e)):this.m_workers.forEach(e=>e.postMessage(t))}get requestQueueSize(){return this.m_workerRequestQueue.length}get numWorkers(){return this.m_workers.length}get numIdleWorkers(){return this.m_availableWorkers.length}eventHandler(t){"string"==typeof t.data.type&&this.dispatchEvent(t.data.type,t)}postRequestMessage(t,e,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 e=this.m_requests.get(t.messageId);if(void 0===e)return void a.error(`[${this.m_options.scriptUrl}]: Bad RequestMessage: invalid messageId`);const i=new Error("Aborted");return i.name="AbortError",void e.resolver(i,void 0)}if(this.m_availableWorkers.length>0){const i=this.m_availableWorkers.pop();void 0!==e?i.postMessage(t,e):i.postMessage(t)}else void 0===i&&(i=new n.RequestController(0)),0===i.priority&&(i.priority=-this.m_nextMessageId),this.m_workerRequestQueue.unshift({message:t,buffers:e,requestController:i})}ensureStarted(){if(this.m_stopped)throw new Error("ConcurrentWorkerSet stopped")}async waitForAllResponses(){const t=new Array;this.m_requests.forEach(e=>{t.push(e.promise)}),await Promise.all(t)}dispatchEvent(t,e){const i=this.m_eventListeners.get(t);void 0!==i&&i(e)}terminateWorkers(){this.m_workerPromises.forEach(t=>{t.then(t=>{void 0!==t&&(t.worker.removeEventListener("message",t.listener),t.worker.terminate())})}),this.m_workers=[],this.m_availableWorkers=[],this.m_workerPromises=[],this.m_readyPromises.clear()}getReadyPromise(t){const e=this.m_readyPromises.get(t);if(void 0!==e)return e;const i={count:0,promise:void 0,resolve:()=>{},reject:t=>{i.error=t},error:void 0};return i.promise=new Promise((t,e)=>{const r=i;void 0!==r.error?e(r.error):r.count===this.m_workerPromises.length&&t(),r.resolve=t,r.reject=e}),this.m_readyPromises.set(t,i),i}checkWorkerRequestQueue(){if(0!==this.m_workerRequestQueue.length&&0!==this.m_availableWorkers.length)for(this.m_workerRequestQueue.sort((t,e)=>t.requestController.priority-e.requestController.priority);this.m_availableWorkers.length>0&&this.m_workerRequestQueue.length>0;){const t=this.m_workerRequestQueue.pop();this.postRequestMessage(t.message,t.buffers,t.requestController)}}}},4303:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DataSource=void 0;const r=i(2356),n=i(3334),o=i(8797),s=i(4342),a=s.LoggerManager.instance.create("DataSource");class l extends r.EventDispatcher{constructor(t={}){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 o.ExprPool,this.m_maxGeometryHeight=0,this.m_minGeometryHeight=0,this.m_storageLevelOffset=0,this.m_featureStateMap=new Map;let{name:e}=t;const{layerNames:i,languages:r,minZoomLevel:n,maxZoomLevel:s,minDataLevel:a,maxDataLevel:c,minDisplayLevel:h,maxDisplayLevel:u,storageLevelOffset:p,allowOverlappingTiles:d,enablePicking:m,minGeometryHeight:f,maxGeometryHeight:g,dataSourceOrder:y}=t;void 0!==e&&0!==e.length||(e="anonymous-datasource#"+ ++l.uniqueNameCounter),this.name=e,this.layerNames=i,this.m_languages=r,void 0!==a&&(this.minDataLevel=a),void 0!==c&&(this.maxDataLevel=c),void 0!==n&&(this.minZoomLevel=n),void 0!==s&&(this.maxZoomLevel=s),void 0!==h&&(this.minDisplayLevel=h),void 0!==u&&(this.maxDisplayLevel=u),void 0!==p&&(this.m_storageLevelOffset=p),void 0!==d&&(this.allowOverlappingTiles=d),void 0!==m&&(this.enablePicking=m),void 0!==f&&(this.minGeometryHeight=f),void 0!==g&&(this.maxGeometryHeight=g),y&&(this.dataSourceOrder=y)}getFeatureState(t){return this.m_featureStateMap.get(t)}clearFeatureState(){this.m_featureStateMap.clear()}setFeatureState(t,e){this.m_featureStateMap.set(t,e)}removeFeatureState(t){this.m_featureStateMap.delete(t)}get layerNames(){return this.m_layerNames}
2set layerNames(t){c(t,this.m_layerNames)||(this.m_layerNames=t,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(t){this.m_mapView=t}detach(t){(0,s.assert)(this.m_mapView===t),this.m_mapView=void 0}isDetached(){return void 0===this.m_mapView}async setTheme(t){}set languages(t){this.m_languages=t}get languages(){return this.m_languages}setPoliticalView(t){}updateTile(t){}shouldPreloadTiles(){return!1}get minZoomLevel(){return a.warn("DataSource.minZoomLevel is deprecated. Use minDataLevel and maxDataLevel instead."),this.minDataLevel}set minZoomLevel(t){a.warn("DataSource.minZoomLevel is deprecated. Use minDataLevel and minDisplayLevel instead."),this.minDataLevel=t}get maxZoomLevel(){return a.warn("DataSource.maxZoomLevel is deprecated. Use maxDataLevel and maxDisplayLevel instead."),this.maxDataLevel}set maxZoomLevel(t){a.warn("DataSource.maxZoomLevel is deprecated. Use maxDataLevel and maxDisplayLevel instead."),this.maxDataLevel=t}get maxGeometryHeight(){return this.m_maxGeometryHeight}set maxGeometryHeight(t){this.m_maxGeometryHeight=t}get minGeometryHeight(){return this.m_minGeometryHeight}set minGeometryHeight(t){this.m_minGeometryHeight=t}get storageLevelOffset(){return this.m_storageLevelOffset}set storageLevelOffset(t){this.m_storageLevelOffset=t}get taskQueue(){return this.m_mapView?this.m_mapView.taskQueue:void 0}setEnableElevationOverlay(t){}getDataZoomLevel(t){return(0,n.clamp)(t+this.m_storageLevelOffset,this.minDataLevel,this.maxDataLevel)}isVisible(t){return t>=this.minDisplayLevel&&t<=this.maxDisplayLevel}canGetTile(t,e){return e.level<=t}shouldSubdivide(t,e){return e.level<=t}canProvideIconText(){return!0}requestUpdate(){this.dispatchEvent(this.UPDATE_EVENT)}}e.DataSource=l,l.uniqueNameCounter=0;const c=(t,e)=>{let i=t===e;if(!i&&t&&e){let r=t.length;if(e.length===r)for(i=!0;i&&r--;)i=e.includes(t[r])}return i}},507:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.debugContext=e.DebugContext=void 0;const r=i(2356),n="undefined"==typeof window;class o extends r.EventDispatcher{constructor(t){super(),this.value=t}set(t,e){this.value=t,this.dispatchEvent({type:o.SET_EVENT_TYPE,name:e,value:t})}}o.SET_EVENT_TYPE="set";class s{constructor(){this.m_optionsMap=new Map,!n&&"undefined"!=typeof window&&window&&(window.__debugContext=this)}setValue(t,e){let i=this.m_optionsMap.get(t);i?i.set(e,t):(i=new o(e),this.m_optionsMap.set(t,i))}getValue(t){const e=this.m_optionsMap.get(t);return e?e.value:void 0}hasOption(t){return void 0!==this.m_optionsMap.get(t)}addEventListener(t,e){const i=this.m_optionsMap.get(t);if(!i)throw Error("Unknown option: "+t);i.addEventListener(o.SET_EVENT_TYPE,e)}hasEventListener(t,e){const i=this.m_optionsMap.get(t);if(i)return i.hasEventListener(o.SET_EVENT_TYPE,e);throw Error("Unknown option: "+t)}removeEventListener(t,e){const i=this.m_optionsMap.get(t);if(!i)throw Error("Unknown option: "+t);i.removeEventListener(o.SET_EVENT_TYPE,e)}get options(){return this.m_optionsMap}clear(){this.m_optionsMap.forEach(t=>{t.set(void 0,"")})}}e.DebugContext=s,e.debugContext=new s},8427:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.evaluateColorProperty=e.applySecondaryColorToMaterial=e.evaluateBaseColorProperty=e.buildMetricValueEvaluator=e.buildObject=e.usesObject3D=e.getBufferAttribute=e.createMaterial=void 0;const r=i(9365),n=i(2481),o=i(6307),s=i(3905),a=i(5448),l=i(4760),c=i(5269),h=i(394),u=i(8152),p=i(5535),d=i(4250),m=i(5562),f=i(1984),g=i(1667),y=i(8023),v=i(6331),_=i(4342),b=i(946),x=i(8673),w=i(7063),S=i(176),T=i(3977),E=i(5146),M=_.LoggerManager.instance.create("DecodedTileHelpers");function A(t,e,i){return t[i]=e,t.needsUpdate=!0,e}const C=new h.Texture;function P(t,e,i,r,n){return new Promise((o,s)=>{const a=(0,w.loadTexture)(e,n.textureCache,r,n.renderer,o,s);a&&A(t,a,i)})}const L=new a.Vector2;
2function R(t,e){return null==t?t:("string"==typeof t&&(t.endsWith("px")?(e="Pixel",t=Number.parseFloat(t)):t.endsWith("m")&&(t=Number.parseFloat(t))),"Pixel"===e?e=>{var i;return(null!==(i=e.env.lookup("$pixelToMeters"))&&void 0!==i?i:1)*(0,u.getPropertyValue)(t,e.env)}:t)}function I(t,e){if(t=function(t,e){return void 0!==e&&y.Expr.isExpr(t)&&(t=(0,u.getPropertyValue)(t,e)),t}(t,e),null!=t){if("number"==typeof t)return t;if("string"==typeof t){const e=(0,v.parseStringEncodedColor)(t);if(void 0!==e)return e}if(null==t?void 0:t.isRGBA)return g.ColorUtils.getHexFromRgba(t.r,t.g,t.b,t.a);M.error(`Unsupported color format: '${t}'`)}}e.createMaterial=function(t,e,i){const r=function(t,e){if(void 0!==t.name)switch(t.name){case"extruded-line":if(!(0,f.isExtrudedLineTechnique)(t))throw new Error("Invalid extruded-line technique");return"standard"===t.shading?d.MapMeshStandardMaterial:d.MapMeshBasicMaterial;case"standard":case"terrain":return d.MapMeshStandardMaterial;case"extruded-polygon":return d.MapMeshPhongMaterial;case"dashed-line":case"solid-line":return d.SolidLineMaterial;case"polygon":return e?d.MapMeshStandardMaterial:d.MapMeshBasicMaterial;case"squares":return s.PointsMaterial;case"circles":return d.CirclePointsMaterial;case"line":case"segments":return o.LineBasicMaterial;case"raster":case"text":case"labeled-icon":case"line-marker":case"label-rejection-line":return}}(t,!0===(null==i?void 0:i.shadowsEnabled)),n={};if(void 0===r)return;r.prototype instanceof d.RawShaderMaterial&&(n.rendererCapabilities=e.renderer.capabilities),r!==d.HighPrecisionLineMaterial&&(n.fog=null==i?void 0:i.fog),!0===(null==i?void 0:i.shadowsEnabled)&&"polygon"===t.name&&(n.removeDiffuseLight=!0);const a=new r(n);if(void 0!==t.id&&(a.name=t.id),(0,f.isExtrudedPolygonTechnique)(t)&&(a.flatShading=!0),(0,m.needsCanvasSize)(a)){const t=e.renderer.domElement;a.canvasSize=L.set(t.width,t.height),a.onResizeListener=()=>{const t=e.renderer.domElement;a.canvasSize=L.set(t.width,t.height)},a.onResizeTarget=e,a.onResizeTarget.addEventListener(T.MapViewEventNames.Resize,a.onResizeListener)}a.depthTest=(0,f.isExtrudedPolygonTechnique)(t)&&!1!==t.depthTest;const l=[];let c=!0;(0,f.supportsTextures)(t)&&f.TEXTURE_PROPERTY_KEYS.forEach(i=>{const r=function(t,e,i,r){let n=i[e];if(void 0===n)return Promise.reject(new Error(`textureProperty for texturePropertyName ${e} in technique ${i.name} is undefined`));if(y.Expr.isExpr(n)&&(n=(0,u.getPropertyValue)(n,r.env),!n))return Promise.resolve(A(t,C,e));if(!(0,f.isSolidLineTechnique)(i)){const o=i[e+"Properties"];return P(t,n,e,o,r)}return A(t,C,e),r.imageRepo.loadImage(n).then(i=>(null==i?void 0:i.imageItem.image)?P(t,null==i?void 0:i.imageItem.image,e,{minFilter:"linear",magFilter:"linear"},r):void 0)}(a,i,t,e).catch(t=>{c=!1});l.push(r)});const h=Promise.all(l).then(()=>Promise.resolve(c));return S.MapMaterialAdapter.create(a,function(t){var e;const i=(0,p.getTechniqueAutomaticAttrs)(t);switch(t.name){case"dashed-line":case"solid-line":{const r=(0,_.pick)(t,i);return r.width=R(null!==(e=t.width)&&void 0!==e?e:0,t.metricUnit),r.offset=R(t.offset,t.metricUnit),r}case"polygon":case"circles":case"squares":case"line":case"segments":return(0,_.pick)(t,i);case"standard":case"terrain":case"extruded-polygon":{const e=(0,_.pick)(t,i);return!0!==t.vertexColors&&(e.color=t.color),e}case"extruded-line":return(0,_.pick)(t,["color","wireframe","transparent","opacity","polygonOffset","polygonOffsetFactor","polygonOffsetUnits",...i]);case"raster":return(0,_.pick)(t,["brightness","gamma"]);default:return{}}}(t),e),"fog"in a&&(a.fog=n.fog),{material:a,texturesReady:h}},e.getBufferAttribute=function(t){switch(t.type){case"float":return new r.BufferAttribute(new Float32Array(t.buffer),t.itemCount);case"uint8":return new r.BufferAttribute(new Uint8Array(t.buffer),t.itemCount,t.normalized);case"uint16":return new r.BufferAttribute(new Uint16Array(t.buffer),t.itemCount,t.normalized);case"uint32":return new r.BufferAttribute(new Uint32Array(t.buffer),t.itemCount,t.normalized);case"int8":return new r.BufferAttribute(new Int8Array(t.buffer),t.itemCount,t.normalized);case"int16":return new r.BufferAttribute(new Int16Array(t.buffer),t.itemCount,t.normalized);case"int32":return new r.BufferAttribute(new Int32Array(t.buffer),t.itemCount,t.normalized);default:throw new Error(`unsupported buffer of type ${t.type}`)}},e.usesObject3D=function(t){const e=t.name;return void 0!==e&&"text"!==e&&"labeled-icon"!==e&&"line-marker"!==e&&"label-rejection-line"!==e}
2,e.buildObject=function(t,e,i,r,o){switch((0,_.assert)(void 0!==t.name),t.name){case"extruded-line":case"standard":case"extruded-polygon":case"polygon":return o?new b.DisplacedMesh(e,i,()=>({min:r.elevationRange.minElevation,max:r.elevationRange.maxElevation})):new c.Mesh(e,i);case"terrain":return new c.Mesh(e,i);case"dashed-line":case"solid-line":return o?new b.DisplacedMesh(e,i,()=>({min:r.elevationRange.minElevation,max:r.elevationRange.maxElevation}),x.SolidLineMesh.raycast):new x.SolidLineMesh(e,i);case"circles":return new E.Circles(e,i);case"squares":return new E.Squares(e,i);case"line":case"segments":return new l.LineSegments(e,i)}return(0,_.assert)(!1,"Invalid technique"),new n.Object3D},e.buildMetricValueEvaluator=R,e.evaluateBaseColorProperty=function(t,e){const i=function(t){const e=function(t){var e;return null===(e=(0,p.getTechniqueDescriptor)(t))||void 0===e?void 0:e.attrTransparencyColor}(t);if(void 0!==e)return t[e]}(t);if(void 0!==i)return I(i,e)},e.applySecondaryColorToMaterial=function(t,e,i){let r=I(e,i);void 0!==r&&(g.ColorUtils.hasAlphaInHex(r)&&(M.warn("Used RGBA value for technique color without transparency support!"),r=g.ColorUtils.removeAlphaFromHex(r)),t.setHex(r))},e.evaluateColorProperty=I},2476:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.setDepthPrePassStencil=e.createDepthPrePassMesh=e.isDepthPrePassMesh=e.createDepthPrePassMaterial=e.isRenderDepthPrePassEnabled=e.DEPTH_PRE_PASS_STENCIL_MASK=void 0;const r=i(6271),n=i(3148),o=i(5269),s=i(4250),a=i(1667),l=i(8427);function c(t){t.depthWrite=!1,t.depthFunc=r.EqualDepth,t.colorWrite=!0,(0,s.enforceBlending)(t);const e=t.clone();return e.isDepthPrepassMaterial=!0,e.depthWrite=!0,e.depthTest=!0,e.depthFunc=r.LessDepth,e.colorWrite=!1,e.opacity=1,e.blending=r.NoBlending,e}e.DEPTH_PRE_PASS_STENCIL_MASK=1,e.isRenderDepthPrePassEnabled=function(t,e){if(!1===t.enableDepthPrePass)return!1;let i=void 0!==t.opacity&&t.opacity>0&&t.opacity<1;if(!i){const r=(0,l.evaluateBaseColorProperty)(t,e);if(void 0!==r){const t=a.ColorUtils.getAlphaFromHex(r);i=t>0&&t<1}}return i},e.createDepthPrePassMaterial=c,e.isDepthPrePassMesh=function(t){if(!0!==t.isMesh)return!1;const e=t;return e.material instanceof Array?e.material.every(t=>!0===t.isDepthPrepassMaterial):!0===e.material.isDepthPrepassMaterial},e.createDepthPrePassMesh=function(t){const e=t.geometry;if(!(e instanceof n.BufferGeometry))throw new Error("#createDepthPassMesh only BufferGeometry is supported");const i=e.getAttribute("position");if(!i)throw new Error("#createDepthPassMesh position attribute not found");const r=new n.BufferGeometry;r.setAttribute("position",i);const s=e.getAttribute("uv");s&&r.setAttribute("uv",s);const a=e.getAttribute("normal");a&&r.setAttribute("normal",a);const l=e.getAttribute("extrusionAxis");l&&r.setAttribute("extrusionAxis",l),e.index&&r.setIndex(e.index);for(const t of e.groups){const{start:e,count:i,materialIndex:n}=t;r.addGroup(e,i,n)}const h=t.material instanceof Array?t.material.map(c):c(t.material),u=new o.Mesh(r,h);return u.renderOrder=t.renderOrder-1e-6,u},e.setDepthPrePassStencil=function(t,i){function n(t){const i=t;i.stencilWrite=!0,i.stencilFail=r.KeepStencilOp,i.stencilZFail=r.KeepStencilOp,i.stencilZPass=r.ReplaceStencilOp,i.stencilFunc=r.AlwaysStencilFunc,i.stencilRef=255,i.stencilFuncMask=e.DEPTH_PRE_PASS_STENCIL_MASK}function o(t){const i=t;i.stencilWrite=!0,i.stencilFail=r.KeepStencilOp,i.stencilZFail=r.KeepStencilOp,i.stencilZPass=r.ZeroStencilOp,i.stencilFunc=r.EqualStencilFunc,i.stencilRef=255,i.stencilFuncMask=e.DEPTH_PRE_PASS_STENCIL_MASK}t.material instanceof Array?t.material.map(n):n(t.material),i.material instanceof Array?i.material.map(o):o(i.material)}},5071:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2175:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4988:(t,e)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.CalculationStatus=void 0,(i=e.CalculationStatus||(e.CalculationStatus={}))[i.PendingApproximate=0]="PendingApproximate",i[i.FinalPrecise=1]="FinalPrecise"},4055:(t,e)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.EventDispatcher=void 0,e.EventDispatcher=class{constructor(){this.m_listeners=new Map}dispose(){this.removeAllEventListeners()}hasEventListener(t,e){const i=this.m_listeners.get(t);return void 0!==i&&(void 0===e||i.includes(e))}addEventListener(t,e){let i=this.m_listeners.get(t);void 0===i&&(i=[],this.m_listeners.set(t,i)),i.includes(e)||i.push(e)}removeEventListener(t,e){const i=this.m_listeners.get(t);if(void 0!==i)if(void 0===e)this.m_listeners.delete(t);else{const r=i.indexOf(e);-1!==r&&(i.splice(r,1),0===i.length&&this.m_listeners.delete(t))}}removeAllEventListeners(){const t=Array.from(this.m_listeners.keys());for(const e of t)this.removeEventListener(e)}get eventTypes(){return Array.from(this.m_listeners.keys())}listeners(t){return this.m_listeners.get(t)}dispatchEvent(t){const e=this.m_listeners.get(t.type);if(void 0!==e){t.target=this;const i=e.slice(0);for(let e=0,r=i.length;e<r;e++)i[e].call(this,t)}}}},1774:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FixedClipPlanesEvaluator=void 0,e.FixedClipPlanesEvaluator=class{constructor(t=1,e=10){this.minNear=t,this.minFarOffset=e,this.minFar=t+e,this.m_nearPlane=t,this.m_farPlane=this.minFar}get nearPlane(){return this.m_nearPlane}set nearPlane(t){this.invalidatePlanes(t,this.m_farPlane)}get farPlane(){return this.m_farPlane}set farPlane(t){this.invalidatePlanes(this.m_nearPlane,t)}set minElevation(t){}get minElevation(){return 0}set maxElevation(t){}get maxElevation(){return 0}evaluateClipPlanes(t,e,i){return{near:this.m_nearPlane,far:this.m_farPlane,minimum:this.minNear,maximum:this.m_farPlane}}invalidatePlanes(t,e){const i=Math.max(this.minNear,t),r=Math.max(this.minFar,e,i+this.minFarOffset);this.m_nearPlane=i,this.m_farPlane=r}}},3103:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MAX_FOV_RAD=e.MIN_FOV_RAD=e.MAX_FOV_DEG=e.MIN_FOV_DEG=e.DEFAULT_FOV_CALCULATION=void 0;const r=i(3334);e.DEFAULT_FOV_CALCULATION={type:"dynamic",fov:40},e.MIN_FOV_DEG=0,e.MAX_FOV_DEG=180,e.MIN_FOV_RAD=(0,r.degToRad)(e.MIN_FOV_DEG),e.MAX_FOV_RAD=(0,r.degToRad)(e.MAX_FOV_DEG)},8502:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FrustumIntersection=e.TileKeyEntry=void 0;const r=i(2754),n=i(6084),o=i(3334),s=i(8333),a=i(6815),l=i(6577),c=i(2616),h=i(4342),u=i(4988),p=i(9904),d=i(541),m=[new a.Vector3,new a.Vector3],f=new l.Vector4;class g{constructor(t,e,i=0,r,n=0){this.tileKey=t,this.area=e,this.offset=i,this.elevationRange=r,this.distance=n}}e.TileKeyEntry=g,e.FrustumIntersection=class{constructor(t,e,i,r,o,a=256){this.m_camera=t,this.mapView=e,this.m_extendedFrustumCulling=i,this.m_tileWrappingEnabled=r,this.m_enableMixedLod=o,this.m_tilePixelSize=a,this.m_frustum=new n.Frustum,this.m_viewProjectionMatrix=new s.Matrix4,this.m_rootTileKeys=[],this.m_tileKeyEntries=new Map,this.m_mapTileCuller=new p.MapTileCuller(t)}get camera(){return this.m_camera}get projection(){return this.mapView.projection}updateFrustum(t){this.m_viewProjectionMatrix.multiplyMatrices(void 0!==t?t: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(t,e,i,n){this.m_tileKeyEntries.clear(),(0,h.assert)(0!==this.mapView.viewportHeight);const o=Math.pow(this.m_tilePixelSize/this.mapView.viewportHeight,2),s=void 0!==e&&e.getTilingScheme()===t,a=this.mapView.projection.type===c.ProjectionType.Spherical||s,l=new Set(i);let u=0,p=0;n.forEach(t=>{u=Math.min(u,t.minGeometryHeight),p=Math.max(p,t.maxGeometryHeight)});const d={calculationFinal:!0,tileBounds:a?new c.OrientedBox3:new r.Box3};for(const t of l)this.m_tileKeyEntries.set(t,new Map);for(const i of this.m_rootTileKeys){const r=i.tileKey,n=i.offset,o=this.getTileKeyEntry(r,n,t,d,u,p,s?e:void 0);if(void 0!==o)for(const t of l)this.m_tileKeyEntries.get(t).set(c.TileKeyUtils.getKeyForTileKeyAndOffset(r,n),o)}const m=[...this.m_rootTileKeys.values()],f=this.mapView.projection===c.sphereProjection||this.mapView.tilt>0;for(;m.length>0;){const r=m.pop();if(void 0===r)break;const a=r.tileKey,h=r.offset;if(!n.some((t,e)=>t.shouldSubdivide(i[e],a)))continue;if(this.m_enableMixedLod&&f&&r.area<o)continue;const g=c.TileKeyUtils.getKeyForTileKeyAndOffset(a,h);for(const t of l)a.level>=t||this.m_tileKeyEntries.get(t).delete(g);for(const i of t.getSubTileKeys(a)){const r=this.getTileKeyEntry(i,h,t,d,u,p,s?e:void 0);if(void 0!==r){for(const t of l){if(r.tileKey.level>t)continue;const e=c.TileKeyUtils.getKeyForTileKeyAndOffset(i,h);this.m_tileKeyEntries.get(t).set(e,r)}m.push(r)}}}return{tileKeyEntries:this.m_tileKeyEntries,calculationFinal:d.calculationFinal}}getTileKeyEntry(t,e,i,r,n,o,s){var a,l;
2const c=function(t,e,i){const r=t.getGeoBox(e),n=360*i;return r.northEast.longitude+=n,r.southWest.longitude+=n,r}(i,t,e);if(void 0!==s){const e=s.getElevationRange(t);c.southWest.altitude=e.minElevation,c.northEast.altitude=e.maxElevation,r.calculationFinal=r.calculationFinal&&e.calculationStatus===u.CalculationStatus.FinalPrecise}c.southWest.altitude=(null!==(a=c.southWest.altitude)&&void 0!==a?a:0)+n,c.northEast.altitude=(null!==(l=c.northEast.altitude)&&void 0!==l?l:0)+o,this.mapView.projection.projectBox(c,r.tileBounds);const{area:h,distance:p}=this.computeTileAreaAndDistance(r.tileBounds);if(h>0)return new g(t,h,e,{minElevation:c.southWest.altitude,maxElevation:c.northEast.altitude},p)}computeTileAreaAndDistance(t){if(t instanceof r.Box3){if(this.m_extendedFrustumCulling&&!this.m_mapTileCuller.frustumIntersectsTileBox(t)||!this.m_frustum.intersectsBox(t))return{area:0,distance:1/0}}else if(!t.intersects(this.m_frustum))return{area:0,distance:1/0};const e=t.getCenter(m[0]),i=f.set(e.x,e.y,e.z,1).applyMatrix4(this.m_viewProjectionMatrix),n=.5*t.getSize(m[1]).length()/i.w;return{area:n*n,distance:i.z<=-i.w?-1:i.z>=i.w?1:i.z/i.w}}computeRequiredInitialRootTileKeys(t){this.m_rootTileKeys=[];const e=c.TileKey.fromRowColumnLevel(0,0,0);if(this.mapView.projection.type!==c.ProjectionType.Planar||!this.m_tileWrappingEnabled)return void this.m_rootTileKeys.push(new g(e,1/0,0));const i=this.mapView.projection.unprojectPoint(t),r=Math.round(i.longitude/360),n=this.m_camera,s=d.MapViewUtils.extractAttitude(this.mapView,n).pitch,l=n.aspect>1?n.aspect:1/n.aspect,h=(0,o.degToRad)(n.fov*l/2)+s,u=Math.tan(h)*n.position.z-Math.tan(s)*n.position.z,p=new a.Vector3(t.x-u,t.y,t.z),m=this.mapView.projection.unprojectPoint(p),f=(0,o.clamp)(Math.ceil(Math.abs((i.longitude-m.longitude)/360)*Math.SQRT2),0,7);for(let t=-f+r;t<=f+r;t++)this.m_rootTileKeys.push(new g(e,1/0,t))}}},1406:(t,e)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.TileLoaderState=void 0,(i=e.TileLoaderState||(e.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:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MapAnchors=void 0;const r=i(6815),n=i(2616);e.MapAnchors=class{constructor(){this.m_anchors=[],this.m_priorities=[]}get children(){return this.m_anchors}add(t){this.m_anchors.push(t)}remove(t){const e=this.m_anchors.findIndex(e=>e===t);e>-1&&this.m_anchors.splice(e,1)}clear(){this.m_anchors.length=0}setPriorities(t){this.m_priorities=t}update(t,e,i,o){const s=new r.Vector3;this.m_anchors.forEach(r=>{var a;if(void 0!==r.layer){const t=null===(a=this.m_priorities)||void 0===a?void 0:a.findIndex(t=>t.layer===r.layer&&t.category===r.category);void 0!==t&&-1!==t&&(r.renderOrder=10*(t+1))}const l=void 0!==r.geoPosition?r.geoPosition:r.anchor;void 0!==l&&((0,n.isVector3Like)(l)?s.set(l.x,l.y,l.z):(0,n.isGeoCoordinatesLike)(l)&&t.projectPoint(l,s),r.position.copy(s).sub(e)),!0===r.overlay?o.add(r):i.add(r)})}}},176:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MapMaterialAdapter=void 0;const r=i(6271),n=i(977),o=i(5971),s=i(3334),a=i(8152),l=i(4250),c=i(1984),h=i(1667),u=i(8023),p=i(7610),d=i(4342),m=i(8427),f=i(7063);function g(t){return"color"===t||"opacity"===t}class y{static create(t,e,i){const r=new y(t,e);return t.userData||(t.userData={}),t.userData.mapMaterialAdapter=r,i&&r.update(i),r}static update(t,e){var i,r;const n=null===(i=t.userData)||void 0===i?void 0:i.mapMaterialAdapter;return null!==(r=null==n?void 0:n.update(e))&&void 0!==r&&r}constructor(t,e){this.m_material=t,this.m_styledProperties=e,this.m_currentPropertyValues={},this.m_lastUpdateFrameNumber=-1,this.m_dynamicProperties=[];let i=!1;const r=(t,e)=>{u.Expr.isExpr(e)||"function"==typeof e?this.m_dynamicProperties.push([t,e]):null!=e&&(this.m_currentPropertyValues[t]=e,g(t)?i=!0:this.setProperty(t,e))};for(const t in e)e.hasOwnProperty(t)&&r(t,e[t]);i&&this.setBaseColorAndOpacity(),this.m_styledProperties["dash-image"]&&!this.m_styledProperties["dash-gap-color"]&&r("dash-gap-color",this.m_styledProperties.color)}toJSON(){}update(t){if(this.m_lastUpdateFrameNumber===t.frameNumber)return!1;this.m_lastUpdateFrameNumber=t.frameNumber;const e=this.updateDynamicProperties(t),i=this.updateTextureMagFilter(t);return e||i}updateTextureMagFilter(t){let e=!1;if(this.m_material instanceof n.MeshBasicMaterial&&this.m_material.map){const i=t.env.lookup("$shouldAntialiasRasterTile")?r.LinearFilter:r.NearestFilter;this.m_material.map.magFilter!==i&&(this.m_material.map.magFilter=i,e=!0,this.m_material.map.needsUpdate=!0)}return e}updateDynamicProperties(t){let e=!1,i=!1;for(const[r,n]of this.m_dynamicProperties){const o=u.Expr.isExpr(n)?(0,a.getPropertyValue)(n,t.env):n(t);o!==this.m_currentPropertyValues[r]&&(this.m_currentPropertyValues[r]=o,g(r)?i=!0:this.setProperty(r,o,t.textureCache),e=!0)}return i&&this.setBaseColorAndOpacity(),e}setTextureProperty(t,e,i){const r=this.m_material;if(!r[t]||null===e)return;const n=r[t],o=(0,f.loadTexture)(e,i,void 0,void 0,e=>{r[t]=e,n.dispose()});o&&(o.wrapS=n.wrapS,o.wrapT=n.wrapT,o.magFilter=n.magFilter,o.minFilter=n.minFilter,o.flipY=n.flipY,o.repeat=n.repeat)}isColorProperty(t){const e=this.m_material[t];
2return e instanceof o.Color||e instanceof p.RGBA}setProperty(t,e,i){var r;this.isColorProperty(t)?this.setColorProperty(t,e):(r=t,c.TEXTURE_PROPERTY_KEYS.includes(r)?i&&this.setTextureProperty(t,e,i):this.m_material[t]=e)}setColorProperty(t,e){const i=this.m_material;let r;if((0,d.assert)(i[t]instanceof o.Color||i[t]instanceof p.RGBA),null==e?void 0:e.isRGBA)r=p.RGBA.isRGBA(e)?e:(new p.RGBA).copy(e);else{const t=(0,m.evaluateColorProperty)(e);if(void 0===t)return;r=h.ColorUtils.getRgbaFromHex(t)}return i[t]instanceof o.Color?i[t]=new o.Color(r.r,r.g,r.b):i[t]=r,r}setOpacity(t){var e;let i=null!==(e=this.m_currentPropertyValues.opacity)&&void 0!==e?e:1;i=(0,s.clamp)(i,0,1);const r=i*t.a,n=r>=1;this.m_material.color instanceof o.Color&&(i=r),this.m_material instanceof l.RawShaderMaterial?this.m_material.setOpacity(i):this.m_material.opacity=i,n?(0,l.disableBlending)(this.m_material):(0,l.enableBlending)(this.m_material),this.m_material.needsUpdate=!0}setBaseColorAndOpacity(){var t;const e=null!==(t=this.m_currentPropertyValues.color)&&void 0!==t?t:16711680,i=this.setColorProperty("color",e);i&&this.setOpacity(i)}}e.MapMaterialAdapter=y},4572:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MapObjectAdapter=void 0;const r=i(1984),n=i(176);class o{static get(t){var e;return null===(e=null==t?void 0:t.userData)||void 0===e?void 0:e.mapObjectAdapter}static install(t){return t.object.userData||(t.object.userData={}),t.object.userData.mapObjectAdapter=t}static create(t,e){return o.install(new o(t,e))}static update(t,e){var i,r;return null!==(r=null===(i=o.get(t))||void 0===i?void 0:i.update(e))&&void 0!==r&&r}constructor(t,e){var i;this.m_lastUpdateFrameNumber=-1,this.m_notCompletlyTransparent=!0,this.object=t,this.technique=e.technique,this.dataSource=e.dataSource,this.m_pickability=null!==(i=e.pickability)&&void 0!==i?i:r.Pickability.onlyVisible,this.m_notCompletlyTransparent=this.getObjectMaterials().some(t=>t.opacity>0),this.tileKey=e.tileKey}toJSON(){return{technique:this.technique}}update(t){return this.m_lastUpdateFrameNumber!==t.frameNumber&&(this.m_lastUpdateFrameNumber=t.frameNumber,this.updateMaterials(t))}isVisible(){return this.object.visible&&this.m_notCompletlyTransparent}isPickable(){return this.pickability===r.Pickability.onlyVisible&&this.isVisible()||this.m_pickability===r.Pickability.all}get pickability(){return this.m_pickability}updateMaterials(t){let e=!1;const i=this.getObjectMaterials();for(const r of i){const i=n.MapMaterialAdapter.update(r,t);e=e||i}return e&&(this.m_notCompletlyTransparent=i.some(t=>t.opacity>0)),e}getObjectMaterials(){const t=this.object;return Array.isArray(t.material)?t.material:void 0!==t.material?[t.material]:[]}}e.MapObjectAdapter=o},9904:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MapTileCuller=void 0;const r=i(6815);e.MapTileCuller=class{constructor(t){this.m_camera=t,this.m_globalFrustumMin=new r.Vector3,this.m_globalFrustumMax=new r.Vector3,this.m_frustumCorners=[new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3]}setup(){const t=this.getFrustumCorners(),e=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 t)i.applyMatrix4(e),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(t){const e=this.m_globalFrustumMin,i=this.m_globalFrustumMax;return!(i.x<t.min.x||i.y<t.min.y||i.z<t.min.z||e.x>t.max.x||e.y>t.max.y||e.z>t.max.z)}getFrustumCorners(){const t=this.m_frustumCorners,e=this.m_camera.projectionMatrixInverse;let i=0;function r(r,n,o){t[i++].set(r,n,o).applyMatrix4(e)}return r(-1,-1,-1),r(1,-1,-1),r(-1,1,-1),r(1,1,-1),r(-1,-1,1),r(1,-1,1),r(-1,1,1),r(1,1,1),t}}}
2,3977:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MapView=e.MapViewPowerPreference=e.MapViewEventNames=e.TileTaskGroups=void 0,i(9677).ColorManagement.enabled=!1;const r=i(2479),n=i(6271),o=i(2481),s=i(3216),a=i(2754),l=i(5971),c=i(3334),h=i(8333),u=i(3850),p=i(5381),d=i(5448),m=i(6815),f=i(4814),g=i(5700),y=i(5808),v=i(2616),_=i(1984),b=i(4342),x=i(2541),w=i(5863),S=i(8907),T=i(4442),E=i(9978),M=i(5307),A=i(1818),C=i(7511),P=i(8380),L=i(4055),R=i(1350),I=i(3103),O=i(8502),D=i(9587),k=i(3801),N=i(304),F=i(8488),U=i(9297),z=i(5996),j=i(5482),B=i(3011),V=i(19),G=i(6272),H=i(8881),q=i(5187),W=i(8658),X=i(8015),Y=i(9780),K=i(541),Z=i(5008);var $,J;b.LoggerManager.instance.setLogLevelForAll(b.LogLevel.Error),(J=e.TileTaskGroups||(e.TileTaskGroups={})).FETCH_AND_DECODE="fetch",J.CREATE="create",function(t){t.Update="update",t.Resize="resize",t.Render="render",t.AfterRender="didrender",t.FrameComplete="frame-complete",t.ThemeLoaded="theme-loaded",t.AnimationStarted="animation-started",t.AnimationFinished="animation-finished",t.MovementStarted="movement-started",t.MovementFinished="movement-finished",t.DataSourceConnect="datasource-connect",t.CopyrightChanged="copyright-changed",t.ContextLost="webglcontext-lost",t.ContextRestored="webglcontext-restored",t.CameraPositionChanged="camera-changed",t.Dispose="dispose"}($=e.MapViewEventNames||(e.MapViewEventNames={}));const Q=b.LoggerManager.instance.create("MapView"),tt=4e6,et=["northpole","southpole"],it={vector2:[new d.Vector2],vector3:[new m.Vector3,new m.Vector3,new m.Vector3],rayCaster:new s.Raycaster,groundPlane:new u.Plane,groundSphere:new p.Sphere(void 0,v.EarthConstants.EQUATORIAL_RADIUS),matrix4:[new h.Matrix4,new h.Matrix4],transform:[{position:new m.Vector3,xAxis:new m.Vector3,yAxis:new m.Vector3,zAxis:new m.Vector3}],color:new l.Color};var rt;!function(t){t.Default="default",t.LowPower="low-power",t.HighPerformance="high-performance"}(rt=e.MapViewPowerPreference||(e.MapViewPowerPreference={}));const nt={projection:v.mercatorProjection,addBackgroundDatasource:!0,maxVisibleDataSourceTiles:100,extendedFrustumCulling:!0,tileCacheSize:200,resourceComputationType:Z.ResourceComputationType.EstimationInMb,quadTreeSearchDistanceUp:3,quadTreeSearchDistanceDown:2,pixelRatio:"undefined"!=typeof window&&void 0!==window.devicePixelRatio?window.devicePixelRatio:1,target:new v.GeoCoordinates(25,0),zoomLevel:5,tilt:0,heading:0,theme:{},maxTilesPerFrame:0};class ot extends L.EventDispatcher{constructor(t){var e;super(),this.UPDATE_EVENT={type:$.Update},this.RENDER_EVENT={type:$.Render},this.DID_RENDER_EVENT={type:$.AfterRender},this.FRAME_COMPLETE_EVENT={type:$.FrameComplete},this.THEME_LOADED_EVENT={type:$.ThemeLoaded},this.ANIMATION_STARTED_EVENT={type:$.AnimationStarted},this.ANIMATION_FINISHED_EVENT={type:$.AnimationFinished},this.MOVEMENT_STARTED_EVENT={type:$.MovementStarted},this.MOVEMENT_FINISHED_EVENT={type:$.MovementFinished},this.CONTEXT_LOST_EVENT={type:$.ContextLost},this.CONTEXT_RESTORED_EVENT={type:$.ContextRestored},this.COPYRIGHT_CHANGED_EVENT={type:$.CopyrightChanged},this.DISPOSE_EVENT={type:$.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 r.PerspectiveCamera,this.m_yaw=0,this.m_pitch=0,this.m_roll=0,this.m_targetDistance=0,this.m_targetGeoPos=v.GeoCoordinates.fromObject(nt.target),this.m_targetWorldPos=new m.Vector3,this.m_viewRanges={near:.1,far:tt,minimum:.1,maximum:tt},this.m_scene=new y.Scene,this.m_overlayScene=new y.Scene,this.m_sceneRoot=new o.Object3D,this.m_overlaySceneRoot=new o.Object3D,this.m_mapAnchors=new j.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 s.Raycaster,this.m_plane=new u.Plane(new m.Vector3(0,0,1)),this.m_sphere=new p.Sphere(void 0,v.EarthConstants.EQUATORIAL_RADIUS),this.m_env=new _.MapEnv({}),this.m_imageRepo=new U.ImageRepo,this.m_textureCache=new z.TextureCache,this.m_lastTileIds="",this.m_copyrightInfo=[],this.m_disposed=!1,this.onWebGLContextLost=t=>{this.dispatchEvent(this.CONTEXT_LOST_EVENT),Q.warn("WebGL context lost",t)},this.onWebGLContextRestored=t=>{this.dispatchEvent(this.CONTEXT_RESTORED_EVENT),void 0!==this.m_renderer&&(this.iconTextRenderer.restoreRenderers(this.m_renderer),this.update()),Q.warn("WebGL context restored",t)},this.m_options=Object.assign({},t),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&&(A.ConcurrentDecoderFacade.defaultScriptUrl=this.m_uriResolver?this.m_uriResolver.resolveUri(this.m_options.decoderUrl):this.m_options.decoderUrl),void 0!==this.m_options.decoderCount&&(A.ConcurrentDecoderFacade.defaultWorkerCount=this.m_options.decoderCount),this.m_visibleTileSetOptions=Object.assign(Object.assign({},nt),{clipPlanesEvaluator:void 0!==t.clipPlanesEvaluator?t.clipPlanesEvaluator:(0,E.createDefaultClipPlanesEvaluator)()}),void 0!==t.projection&&(this.m_visibleTileSetOptions.projection=t.projection),void 0!==t.extendedFrustumCulling&&(this.m_visibleTileSetOptions.extendedFrustumCulling=t.extendedFrustumCulling),void 0!==t.maxVisibleDataSourceTiles&&(this.m_visibleTileSetOptions.maxVisibleDataSourceTiles=t.maxVisibleDataSourceTiles),void 0!==t.tileCacheSize&&(this.m_visibleTileSetOptions.tileCacheSize=t.tileCacheSize),void 0!==t.resourceComputationType&&(this.m_visibleTileSetOptions.resourceComputationType=t.resourceComputationType),void 0!==t.quadTreeSearchDistanceUp&&(this.m_visibleTileSetOptions.quadTreeSearchDistanceUp=t.quadTreeSearchDistanceUp),void 0!==t.quadTreeSearchDistanceDown&&(this.m_visibleTileSetOptions.quadTreeSearchDistanceDown=t.quadTreeSearchDistanceDown),void 0!==t.enablePolarDataSource&&(this.m_enablePolarDataSource=t.enablePolarDataSource),this.m_pixelRatio=t.pixelRatio,this.m_options.maxFps=null!==(e=this.m_options.maxFps)&&void 0!==e?e: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!==f.WebGL1Renderer&&void 0!==f.WebGL1Renderer?f.WebGL1Renderer:g.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?rt.Default:this.m_options.powerPreference}
2),this.m_renderer.autoClear=!1,this.m_renderer.outputColorSpace=n.LinearSRGBColorSpace,this.m_renderer.debug.checkShaderErrors=!1,this.m_renderer.info.autoReset=!1,this.m_tileObjectRenderer=new Y.TileObjectRenderer(this.m_env,this.m_renderer),this.setupRenderer(this.m_tileObjectRenderer),this.m_options.fovCalculation=void 0===this.m_options.fovCalculation?I.DEFAULT_FOV_CALCULATION:this.m_options.fovCalculation,this.m_options.fovCalculation.fov=(0,c.clamp)(this.m_options.fovCalculation.fov,I.MIN_FOV_DEG,I.MAX_FOV_DEG);const{width:i,height:a}=this.getCanvasClientSize(),l=i/a;this.m_camera=new r.PerspectiveCamera(this.m_options.fovCalculation.fov,l,.1,tt),this.m_camera.up.set(0,0,1),this.setFovOnCamera(this.m_options.fovCalculation,a),this.projection.projectPoint(this.m_targetGeoPos,this.m_targetWorldPos),this.m_scene.add(this.m_camera),this.m_screenProjector=new W.ScreenProjector(this.m_camera),this.m_taskScheduler=new V.MapViewTaskScheduler(this.maxFps),this.m_tileGeometryManager=new k.TileGeometryManager(this),void 0!==t.enableMixedLod&&(this.m_enableMixedLod=t.enableMixedLod),void 0!==t.lodMinTilePixelSize&&(this.m_lodMinTilePixelSize=t.lodMinTilePixelSize),this.m_visibleTiles=this.createVisibleTileSet(),this.m_sceneEnvironment=new B.MapViewEnvironment(this,t),this.setupCamera(),this.m_pickHandler=new H.PickHandler(this,this.m_rteCamera,!0===this.m_options.enablePickTechnique),this.m_movementDetector=new S.CameraMovementDetector(this.m_options.movementThrottleTimeout,()=>this.movementStarted(),()=>this.movementFinished());const h=this.m_options.customAntialiasSettings;if(this.mapRenderingManager=new M.MapRenderingManager(i,a,this.m_options.dynamicPixelRatio,h),this.m_animatedExtrusionHandler=new x.AnimatedExtrusionHandler(this),this.m_enablePolarDataSource){const e=void 0!==t.polarLayerNames?t.polarLayerNames:et;this.m_polarDataSource=new q.PolarTileDataSource({layerNames:e,geometryLevelOffset:t.polarGeometryLevelOffset}),this.updatePolarDataSource()}this.m_taskScheduler.addEventListener($.Update,()=>{this.update()}),void 0!==t.throttlingEnabled&&(this.m_taskScheduler.throttlingEnabled=t.throttlingEnabled),this.m_themeManager=new G.MapViewThemeManager(this,(0,b.getOptionValue)(this.m_options.theme,nt.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(t){this.m_renderLabels=t}get delayLabelsUntilMovementFinished(){return this.iconTextRenderer.delayLabelsUntilMovementFinished}set delayLabelsUntilMovementFinished(t){this.iconTextRenderer.delayLabelsUntilMovementFinished=t}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(t){this.m_enableMixedLod!==t&&(this.m_enableMixedLod=t,this.createVisibleTileSet(),this.update())}get tileWrappingEnabled(){return this.m_tileWrappingEnabled}set tileWrappingEnabled(t){this.projection.type!==v.ProjectionType.Spherical?(t!==this.m_tileWrappingEnabled&&(this.m_tileWrappingEnabled=t,this.createVisibleTileSet()),this.update()):Q.warn("Setting this with spherical projection has no affect. Was this intended?")}dispose(t=!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 t of this.m_tileDataSources)t.dispose();this.m_visibleTiles.clearTileCache(),this.m_iconTextRenderer.clearRenderStates(),this.m_textureCache.evictAll(),this.m_renderer.dispose(),t&&this.m_renderer.forceContextLoss(),this.m_imageRepo.iconTextManager.clear(),this.m_tileGeometryManager.clear(),this.m_movementDetector.dispose(),this.m_themeManager.dispose(),A.ConcurrentDecoderFacade.destroyIfTerminated(),C.ConcurrentTilerFacade.destroyIfTerminated(),this.m_taskScheduler.clearQueuedTasks(),super.dispose()}get disposed(){return this.m_disposed}get resourceComputationType(){return this.m_visibleTiles.resourceComputationType}set resourceComputationType(t){this.m_visibleTiles.resourceComputationType=t}getCacheSize(){return this.m_visibleTiles.getDataSourceCacheSize()}setCacheSize(t,e){this.m_visibleTiles.setDataSourceCacheSize(t),e=void 0!==e?e:t/2,this.m_visibleTiles.setNumberOfVisibleTiles(Math.floor(e)),this.m_iconTextRenderer.invalidateCache(),this.update()}
2get extendedFrustumCulling(){return void 0===this.m_options.extendedFrustumCulling||this.m_visibleTileSetOptions.extendedFrustumCulling}set extendedFrustumCulling(t){this.m_visibleTileSetOptions.extendedFrustumCulling=t}get lockVisibleTileSet(){return this.m_visibleTileSetLock}set lockVisibleTileSet(t){this.m_visibleTileSetLock=t}get pointOfView(){return this.m_pointOfView}set pointOfView(t){this.m_pointOfView=t,this.update()}loadPostEffects(t){fetch(t).then(t=>t.json()).then(t=>{this.m_postEffects=t,this.setPostEffects()})}get postEffects(){return this.m_postEffects}set postEffects(t){this.m_postEffects=t,this.setPostEffects()}async setTheme(t,e){if(this.animatedExtrusionHandler.enabled){this.animatedExtrusionHandler.enabled=!1;const t=()=>{this.animatedExtrusionHandler.enabled=!0,this.removeEventListener($.FrameComplete,t)};this.addEventListener($.FrameComplete,t)}const i=await this.m_themeManager.setTheme(t,e);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(t){this.m_forceCameraAspect=t}get copyrightInfo(){return this.m_copyrightInfo}set disableFading(t){this.m_iconTextRenderer.disableFading=t}get disableFading(){return this.m_iconTextRenderer.disableFading}get frameNumber(){return this.m_frameNumber}resetFrameNumber(){this.m_frameNumber=0,this.m_previousFrameTimeStamp=void 0}addEventListener(t,e){super.addEventListener(t,e)}removeEventListener(t,e){super.removeEventListener(t,e)}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 t=this.m_renderer.getClearColor(it.color);return void 0!==t?t.getHex():0}set clearColor(t){this.m_renderer.setClearColor(t)}get clearAlpha(){const t=this.m_renderer.getClearAlpha();return void 0!==t?t:0}set clearAlpha(t){this.m_renderer.setClearAlpha(t)}get projection(){return this.m_visibleTileSetOptions.projection}set projection(t){const e=this.tilt,i=this.heading;this.m_visibleTileSetOptions.projection=t,this.updatePolarDataSource(),this.clearTileCache(),this.iconTextRenderer.clearRenderStates(),this.createVisibleTileSet(),this.geoMaxBounds=this.geoMaxBounds,this.lookAtImpl({tilt:e,heading:i})}get clipPlanesEvaluator(){return this.m_visibleTileSetOptions.clipPlanesEvaluator}set clipPlanesEvaluator(t){this.m_visibleTileSetOptions.clipPlanesEvaluator=t}get focalLength(){var t;return null!==(t=T.CameraUtils.getFocalLength(this.m_camera))&&void 0!==t?t: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(t){if(void 0!==t.altitude)this.projection.projectPoint(t,this.m_camera.position);else{const e=this.geoCenter.altitude;this.projection.projectPoint(new v.GeoCoordinates(t.latitude,t.longitude,e),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(t){this.m_minZoomLevel=t,this.update()}get maxZoomLevel(){return this.m_maxZoomLevel}set maxZoomLevel(t){this.m_maxZoomLevel=t,this.update()}get geoMaxBounds(){return this.m_geoMaxBounds}set geoMaxBounds(t){this.m_geoMaxBounds=t,this.m_worldMaxBounds=this.m_geoMaxBounds?this.projection.projectBox(this.m_geoMaxBounds,this.projection.type===v.ProjectionType.Planar?new a.Box3:new v.OrientedBox3):void 0}get worldMaxBounds(){return this.m_worldMaxBounds}get zoomLevel(){return this.m_zoomLevel}set zoomLevel(t){this.lookAtImpl({zoomLevel:t})}get tilt(){return(0,c.radToDeg)(this.m_pitch)}set tilt(t){this.lookAtImpl({tilt:t})}get heading(){return-(0,c.radToDeg)(this.m_yaw)}set heading(t){this.lookAtImpl({heading:t})}get env(){return this.m_env}get storageLevel(){return(0,c.clamp)(Math.floor(this.m_zoomLevel),this.m_minZoomLevel,this.m_maxZoomLevel)}
2get 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(t){this.m_options.fovCalculation=t,this.updateCameras()}getDataSourceByName(t){return this.m_tileDataSources.find(e=>e.name===t)}getDataSourcesByLayerName(t){return this.m_tileDataSources.filter(e=>{var i;return null===(i=e.layerNames)||void 0===i?void 0:i.includes(t)})}isDataSourceEnabled(t){return t.enabled&&t.ready()&&this.m_connectedDataSources.has(t.name)&&t.isVisible(this.zoomLevel)}async addDataSource(t){var e,i;if(void 0!==this.getDataSourceByName(t.name))throw new Error(`A DataSource with the name "${t.name}" already exists in this MapView.`);t.attach(this),t.setEnableElevationOverlay(void 0!==this.m_elevationProvider);const r=this.m_tileDataSources.find(t=>!0===t.addGroundPlane&&!(t instanceof w.BackgroundDataSource));!0===t.addGroundPlane&&void 0!==r&&Q.warn(`The DataSources ${t.name} and ${r.name} both have a ground plane added, this will cause problems with the fallback logic, see HARP-14728 & HARP-15488.`),this.m_tileDataSources.push(t),this.m_connectingDataSources++,null===(e=this.m_sceneEnvironment)||void 0===e||e.updateBackgroun
2dDataSource();try{if(await t.connect(),!this.m_tileDataSources.includes(t))return;t.addEventListener($.Update,()=>{this.update()});const e=await this.getTheme().catch(()=>{});(null==e?void 0:e.styles)&&await t.setTheme(e),this.m_connectedDataSources.add(t.name),this.dispatchEvent({type:$.DataSourceConnect,dataSourceName:t.name}),this.update()}catch(e){Q.debug(`Failed to connect to datasource ${t.name}: ${null!==(i=e.message)&&void 0!==i?i:e}`),this.dispatchEvent({type:$.DataSourceConnect,dataSourceName:t.name,error:e})}finally{this.m_connectingDataSources--}}removeDataSource(t){const e=this.m_tileDataSources.indexOf(t);-1!==e&&(t.detach(this),this.m_visibleTiles.removeDataSource(t),this.m_tileDataSources.splice(e,1),this.m_connectedDataSources.delete(t.name),this.m_sceneEnvironment.updateBackgroundDataSource(),this.update())}get visibleTileSet(){return this.m_visibleTiles}addOverlayText(t){this.m_iconTextRenderer.addOverlayText(t),this.update()}clearOverlayText(){this.m_iconTextRenderer.clearOverlayText()}lookAt(t,e,i,r){if((0,v.isGeoCoordinatesLike)(t)){const n={target:t,zoomLevel:void 0!==e?K.MapViewUtils.calculateZoomLevelFromDistance(this,e):void 0,tilt:i,heading:r};this.lookAtImpl(n)}else"object"==typeof t&&this.lookAtImpl(t)}setCameraGeolocationAndZoom(t,e,i=0,r=0){this.geoCenter=t;let n=Math.min(K.MapViewUtils.MAX_TILT_DEG,r);if(this.projection.type===v.ProjectionType.Spherical){const t=Math.asin(v.EarthConstants.EQUATORIAL_RADIUS/(K.MapViewUtils.calculateDistanceToGroundFromZoomLevel(this,e)+v.EarthConstants.EQUATORIAL_RADIUS)),i=(0,c.radToDeg)(t);n=Math.min(n,i)}K.MapViewUtils.zoomOnTargetPosition(this,0,0,e),K.MapViewUtils.setRotation(this,i,n),this.update()}setDynamicProperty(t,e){if(t.startsWith("$"))throw new Error(`failed to update the value of the dynamic property '${t}'`);this.m_env.entries[t]=e,this.update()}removeDynamicProperty(t){if(t.startsWith("$"))throw new Error(`failed to remove the dynamic property '${t}'`);delete this.m_env.entries[t],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,b.assert)(this.m_camera instanceof r.PerspectiveCamera),(0,b.assert)(void 0!==this.m_options.fovCalculation);const t=T.CameraUtils.getFocalLength(this.m_camera);return(0,b.assert)(void 0!==t),T.CameraUtils.convertScreenToWorldSize(t,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(t){this.m_pixelRatio=t,this.renderer.getPixelRatio()!==this.pixelRatio&&this.renderer.setPixelRatio(this.pixelRatio)}set maxFps(t){this.m_options.maxFps=t,this.m_taskScheduler.maxFps=t}get maxFps(){return this.m_options.maxFps}set dynamicPixelRatio(t){this.mapRenderingManager.lowResPixelRatio=t}get dynamicPixelRatio(){return this.mapRenderingManager.lowResPixelRatio}getScreenPosition(t){(0,v.isVector3Like)(t)?it.vector3[0].copy(t):this.projection.projectPoint(v.GeoCoordinates.fromObject(t),it.vector3[0]);const e=this.m_screenProjector.project(it.vector3[0]);if(void 0!==e){const{width:t,height:i}=this.getCanvasClientSize();e.x=e.x+t/2,e.y=i-(e.y+i/2)}return e}getWorldPositionAt(t,e,i){this.m_raycaster.setFromCamera(this.getNormalizedScreenCoordinates(t,e),this.m_camera);const r=this.projection.type===v.ProjectionType.Spherical?this.m_raycaster.ray.intersectSphere(this.m_sphere,it.vector3[0]):this.m_raycaster.ray.intersectPlane(this.m_plane,it.vector3[0]);if(null===r&&!0===i){const t=this.m_camera.getWorldDirection(it.vector3[0]).dot(this.m_raycaster.ray.direction);return it.vector3[0].copy(this.m_raycaster.ray.direction).multiplyScalar(this.m_camera.far/t).add(this.m_camera.position)}return r}getGeoCoordinatesAt(t,e,i){const r=this.getWorldPositionAt(t,e,i);if(!r)return null;const n=this.projection.unprojectPoint(r);return this.tileWrappingEnabled||this.projection.type!==v.ProjectionType.Planar||(n.longitude=(0,c.clamp)(n.longitude,-180,180)),n}getNormalizedScreenCoordinates(t,e){const{width:i,height:r}=this.getCanvasClientSize();return new d.Vector2(t/i*2-1,-e/r*2+1)}intersectMapObjects(t,e,i){return this.m_pickHandler.intersectMapObjects(t,e,i)}resize(t,e){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(t,e,!1),this.m_renderer.getPixelRatio()!==this.pixelRatio&&this.m_renderer.setPixelRatio(this.pixelRatio),void 0!==this.mapRenderingManager&&this.mapRenderingManager.setSize(t,e),void 0!==this.collisionDebugCanvas&&(this.collisionDebugCanvas.width=t,this.collisionDebugCanvas.height=e),this.updateCameras(),this.update(),this.updateLookAtSettings(),this.dispatchEvent({type:$.Re
2size,size:{width:t,height:e}})}renderSync(t){void 0===t&&(t=b.PerformanceTimer.now()),this.render(t)}update(){this.disposed?Q.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()}clearTileCache(t,e){if(void 0!==this.m_visibleTiles){if(void 0!==t){const i=this.getDataSourceByName(t);i&&(this.m_visibleTiles.clearTileCache(i,e),i.clearCache())}else this.m_visibleTiles.clearTileCache(void 0,e),this.m_tileDataSources.forEach(t=>t.clearCache());void 0!==this.m_elevationProvider&&this.m_elevationProvider.clearCache()}}forEachVisibleTile(t){this.m_visibleTiles.forEachVisibleTile(t)}forEachCachedTile(t){this.m_visibleTiles.forEachCachedTile(t)}markTilesDirty(t,e){this.m_visibleTiles.markTilesDirty(t,e),this.update()}async setElevationSource(t,e,i){this.m_elevationSource&&this.m_elevationSource!==t&&this.removeDataSource(this.m_elevationSource),this.m_tileDataSources.includes(t)||await this.addDataSource(t),this.m_elevationSource=t,this.m_elevationRangeSource=e,this.m_elevationRangeSource.ready()||await this.m_elevationRangeSource.connect(),this.m_elevationProvider=i,this.dataSources.forEach(t=>{t.setEnableElevationOverlay(!0)}),this.m_tileGeometryManager.setTileUpdateCallback(t=>{(0,D.overlayOnElevation)(t)}),this.clearTileCache()}clearElevationSource(t){this.removeDataSource(t),this.m_elevationSource=void 0,this.m_elevationRangeSource=void 0,this.m_elevationProvider=void 0,this.dataSources.forEach(t=>{t.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(t){this.m_taskScheduler.throttlingEnabled=t}get shadowsEnabled(){return!0===this.m_options.enableShadows}set shadowsEnabled(t){void 0!==this.m_renderer.shadowMap&&t!==this.m_renderer.shadowMap.enabled&&(this.m_options.enableShadows=t,this.m_renderer.shadowMap.enabled=t,this.m_renderer.shadowMap.type=n.PCFSoftShadowMap,this.clearTileCache())}extractAttitude(){const t=this.m_camera,e=this.projection,i=it.vector3[1],r=it.transform[0],n=it.matrix4[1];i.setFromMatrixPosition(t.matrixWorld),e.localTangentSpace(this.m_targetGeoPos,r),n.makeBasis(r.xAxis,r.yAxis,r.zAxis),it.matrix4[0].copy(n).invert().multiply(t.matrixWorld),r.xAxis.setFromMatrixColumn(it.matrix4[0],0),r.yAxis.setFromMatrixColumn(it.matrix4[0],1),r.zAxis.setFromMatrixColumn(it.matrix4[0],2);let o=0,s=0,a=0;const l=r.zAxis.dot(i.set(0,0,1));return l<1-1e-10?l>1e-10-1?(o=Math.atan2(r.zAxis.x,-r.zAxis.y),s=Math.acos(r.zAxis.z),a=Math.atan2(r.xAxis.x,r.yAxis.z)):(o=-Math.atan2(-r.yAxis.x,r.xAxis.x),s=180,a=0):(o=Math.atan2(-r.yAxis.x,r.xAxis.x),s=0,a=0),{yaw:o,pitch:s,roll:a}}lookAtImpl(t){var e,i;const r=this.projection,n=this.camera,o=Math.min(null!==(e=t.tilt)&&void 0!==e?e:this.tilt,K.MapViewUtils.MAX_TILT_DEG),s=-(null!==(i=t.heading)&&void 0!==i?i:this.heading),a=void 0!==t.zoomLevel?K.MapViewUtils.calculateDistanceFromZoomLevel(this,(0,c.clamp)(t.zoomLevel,this.m_minZoomLevel,this.m_maxZoomLevel)):t.distance,l=t.target?v.GeoCoordinates.fromObject(t.target):void 0;
2if(t.bounds)(0,R.fitLookAtBounds)({target:this.target,camera:this.camera,cameraSettings:this,projection:this.projection,maxZoomLevel:this.maxZoomLevel,viewportSize:this.m_renderer.getSize(it.vector2[0]),tileWrapping:this.tileWrappingEnabled},{bounds:t.bounds,target:l,distance:a,yaw:s,tilt:o,padding:t.padding});else{const t=null!=l?l:this.target;K.MapViewUtils.getCameraRotationAtTarget(r,t,s,o,n.quaternion);const e=null!=a?a:this.m_targetDistance;K.MapViewUtils.getCameraPositionFromTarget(t,e,s,o,r,n.position),n.updateMatrixWorld(!0)}this.updateLookAtSettings(),this.update()}updatePolarDataSource(){const t=this.m_polarDataSource;if(!0===this.m_enablePolarDataSource&&void 0!==t){const e=this.getDataSourceByName(t.name);this.projection.type===v.ProjectionType.Spherical?void 0===e&&this.addDataSource(t):void 0!==e&&this.removeDataSource(t)}}updateCameras(t){var e;this.m_camera.updateMatrixWorld(!1),this.updateLookAtSettings();const{width:i,height:r}=this.m_renderer.getSize(it.vector2[0]);this.m_camera.aspect=void 0!==this.m_forceCameraAspect?this.m_forceCameraAspect:i/r,this.setFovOnCamera(this.m_options.fovCalculation,r);const n=this.projection.getScaleFactor(this.camera.position),o=n*this.m_tileDataSources.reduce((t,e)=>Math.max(t,e.maxGeometryHeight),0),s=n*this.m_tileDataSources.reduce((t,e)=>Math.min(t,e.minGeometryHeight),0);Object.assign(this.m_viewRanges,void 0===t?this.m_visibleTiles.updateClipPlanes(o,s):t),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===(e=this.m_iconTextRenderer)||void 0===e||e.updateCamera(),this.m_screenProjector.update(this.camera,i,r),this.updateEnv(),this.m_sceneEnvironment.update()}updateLookAtSettings(){let{target:t,distance:e,final:i}=K.MapViewUtils.getTargetAndDistance(this.projection,this.camera,this.elevationProvider);i||this.update(),this.geoMaxBounds&&({target:t,distance:e}=K.MapViewUtils.constrainTargetAndDistanceToViewBounds(t,e,this)),this.m_targetWorldPos.copy(t),this.m_targetGeoPos=this.projection.unprojectPoint(this.m_targetWorldPos),this.m_targetDistance=e,this.m_zoomLevel=K.MapViewUtils.calculateZoomLevelFromDistance(this,this.m_targetDistance);const{yaw:r,pitch:n,roll:o}=this.extractAttitude();this.m_yaw=r,this.m_pitch=n,this.m_roll=o}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(t,e){return e.set(t.x,t.y,t.z).applyMatrix4(this.camera.projectionMatrixInverse).applyMatrix4(this.m_rteCamera.matrixWorld),e}renderLoop(t){if(!0!==this.m_options.synchronousRendering&&!this.disposed){if(0===this.maxFps)this.render(t);else{const e=3,i=1e3/this.maxFps;t>=(void 0===this.m_previousFrameTimeStamp?0:this.m_previousFrameTimeStamp)+i-e&&this.render(t)}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 t=[];for(const e of this.m_tileDataSources)this.isDataSourceEnabled(e)&&t.push(e);return t}render(t){if(this.m_drawing)return;if(this.disposed)return void Q.warn("render(): MapView has been disposed of.");let e;this.RENDER_EVENT.time=t,this.dispatchEvent(this.RENDER_EVENT),this.m_tileObjectRenderer.prepareRender(),++this.m_frameNumber;const i=X.PerformanceStatistics.instance,r=i.enabled;if(r){if(e=i.currentFrame,void 0!==this.m_previousFrameTimeStamp){const i=t-this.m_previousFrameTimeStamp;e.setValue("render.fps",1e3/i)}i.storeAndClearFrameInfo(),e.setValue("renderCount.frameNumber",this.m_frameNumber)}let n,o,s,a,l,c;if(this.m_previousFrameTimeStamp=t,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,r&&(n=b.PerformanceTimer.now()),!this.lockVisibleTileSet){const t=this.m_visibleTiles.updateRenderList(this.storageLevel,Math.floor(this.zoomLevel),this.getEnabledTileDataSources(),this.m_frameNumber,this.m_elevationRangeSource);t.viewRangesChanged&&this.updateCameras(t.viewRanges)}r&&(o=b.PerformanceTimer.now());const h=this.m_visibleTiles.dataSourceTileList;
2if(h.forEach(({zoomLevel:t,renderedTiles:e})=>{e.forEach(e=>{this.m_tileObjectRenderer.render(e,t,this.zoomLevel,this.m_camera.position,this.m_sceneRoot),e.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!==e&&(e.addValue("renderCount.numTilesRendered",0),e.addValue("renderCount.numTilesVisible",0),e.addValue("renderCount.numTilesLoading",0),h.forEach(({zoomLevel:t,renderedTiles:i,visibleTiles:r,numTilesLoading:n})=>{e.addValue("renderCount.numTilesRendered",i.size),e.addValue("renderCount.numTilesVisible",r.length),e.addValue("renderCount.numTilesLoading",n)})),this.m_movementDetector.checkCameraMoved(this,t)){const{latitude:t,longitude:e,altitude:i}=this.geoCenter;this.dispatchEvent({type:$.CameraPositionChanged,latitude:t,longitude:e,altitude:i,yaw:this.m_yaw,pitch:this.m_pitch,roll:this.m_roll,tilt:this.tilt,heading:this.heading,zoom:this.zoomLevel})}const u=void 0!==this.m_pointOfView?this.m_pointOfView:this.m_rteCamera;if(this.renderLabels&&!this.m_pointOfView&&this.m_iconTextRenderer.placeText(h,t),r&&(s=b.PerformanceTimer.now()),this.mapRenderingManager.render(this.m_renderer,this.m_scene,u,!this.isDynamicFrame),r&&(a=b.PerformanceTimer.now()),this.renderLabels&&!this.m_pointOfView&&this.m_iconTextRenderer.renderText(this.m_viewRanges.maximum),this.m_overlaySceneRoot.children.length>0&&this.m_renderer.render(this.m_overlayScene,u),r&&(l=b.PerformanceTimer.now()),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(t)},0),void 0!==e){c=b.PerformanceTimer.now();const r=c-t;e.setValue("render.setupTime",n-t),e.setValue("render.cullTime",o-n),e.setValue("render.textPlacementTime",s-o),e.setValue("render.drawTime",a-s),e.setValue("render.textDrawTime",l-a),e.setValue("render.cleanupTime",c-l),e.setValue("render.frameRenderTime",r),e.setValue("render.fullFrameTime",r),e.setValue("render.geometryCreationTime",0),i.addWebGLInfo(this.m_renderer.info),i.addMemoryInfo()}this.DID_RENDER_EVENT.time=t,this.dispatchEvent(this.DID_RENDER_EVENT),this.isDynamicFrame||this.dispatchEvent(this.FRAME_COMPLETE_EVENT)}setupCamera(){(0,b.assert)(void 0!==this.m_visibleTiles),this.m_options.target=v.GeoCoordinates.fromObject((0,b.getOptionValue)(this.m_options.target,nt.target)),this.m_options.target.altitude=0,this.m_options.tilt=(0,b.getOptionValue)(this.m_options.tilt,nt.tilt),this.m_options.heading=(0,b.getOptionValue)(this.m_options.heading,nt.heading),this.m_options.zoomLevel=(0,b.getOptionValue)(this.m_options.zoomLevel,nt.zoomLevel),this.lookAtImpl(this.m_options);const{width:t,height:e}=this.getCanvasClientSize();this.resize(t,e)}createVisibleTileSet(){(0,b.assert)(void 0!==this.m_tileGeometryManager),this.m_visibleTiles&&(this.m_visibleTiles.clearTileCache(),this.m_visibleTiles.disposePendingTiles());const t=void 0===this.m_enableMixedLod?this.projection.type===v.ProjectionType.Spherical:this.m_enableMixedLod;return this.m_visibleTiles=new Z.VisibleTileSet(new O.FrustumIntersection(this.m_camera,this,this.m_visibleTileSetOptions.extendedFrustumCulling,this.m_tileWrappingEnabled,t,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 t=this.m_visibleTiles.dataSourceTileList,e=[];e.length=0,t.forEach(({dataSource:t,renderedTiles:i})=>
2{i.forEach(i=>{e.push(t.name+"-"+i.tileKey.mortonCode())})}),e.sort();const i=e.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 t=this.getRenderedTilesCopyrightInfo();if(t!==this.m_copyrightInfo){if(t.length===this.m_copyrightInfo.length){let e=!0;for(let i=0;i<t.length;i++){const r=t[i],n=this.m_copyrightInfo[i];if(r.label!==n.label){e=!1;break}}if(e)return}this.m_copyrightInfo=t,this.dispatchEvent(this.COPYRIGHT_CHANGED_EVENT)}}getRenderedTilesCopyrightInfo(){let t=[];for(const e of this.m_visibleTiles.dataSourceTileList)for(const i of e.renderedTiles.values()){const e=i.copyrightInfo;void 0!==e&&0!==e.length&&(t=P.CopyrightInfo.mergeArrays(t,e))}return t}setupStats(t){new X.PerformanceStatistics(t,1e3)}setupRenderer(t){var e;this.m_scene.add(this.m_sceneRoot),this.m_overlayScene.add(this.m_overlaySceneRoot),this.shadowsEnabled=null!==(e=this.m_options.enableShadows)&&void 0!==e&&e,t.setupRenderer()}createTextRenderer(){return new N.IconTextRenderer(new F.MapViewState(this,this.checkIfTilesChanged.bind(this)),this.m_screenProjector,this.m_imageRepo,this.m_textureCache,this.m_renderer,this.m_options)}setFovOnCamera(t,e){const i=(0,c.degToRad)(t.fov);if("fixed"===t.type)return void T.CameraUtils.setVerticalFov(this.m_camera,i,e);let r=T.CameraUtils.getFocalLength(this.m_camera);void 0===r&&(T.CameraUtils.setVerticalFov(this.m_camera,i,e),r=T.CameraUtils.getFocalLength(this.m_camera)),T.CameraUtils.setFocalLength(this.m_camera,r,e)}getCanvasClientSize(){let t,e;const{clientWidth:i,clientHeight:r}=this.canvas;if(i>0&&r>0)t=i,e=r;else{const i=this.m_renderer.getPixelRatio();t=Math.round(this.canvas.width/i),e=Math.round(this.canvas.height/i)}return 0!==t&&0!==e||(t=e=1),{width:t,height:e}}}e.MapView=ot},4247:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MapViewAtmosphere=e.AtmosphereLightMode=void 0;const r=i(2479),n=i(6271),o=i(8817),s=i(5814),a=i(977),l=i(8282),c=i(5971),h=i(5448),u=i(6815),p=i(5269),d=i(2616),m=i(4250),f=i(4342),g=i(9978);var y,v,_;!function(t){t[t.Ground=1]="Ground",t[t.Sky=2]="Sky",t[t.SkyAndGround=3]="SkyAndGround"}(y||(y={})),function(t){t[t.ScatteringShader=0]="ScatteringShader",t[t.SimpleColor=1]="SimpleColor",t[t.Wireframe=2]="Wireframe"}(v||(v={})),function(t){t[t.LightOverhead=0]="LightOverhead",t[t.LightDynamic=1]="LightDynamic"}(_=e.AtmosphereLightMode||(e.AtmosphereLightMode={}));const b={clipPlanes:{near:0,far:0}};class x{static isPresent(t){for(const e of t.children)if(e.name===x.SkyAtmosphereUserName||e.name===x.GroundAtmosphereUserName)return!0;return!1}constructor(t,e,i,r,n,o=y.SkyAndGround,s=v.ScatteringShader){this.m_mapAnchors=t,this.m_sceneCamera=e,this.m_projection=i,this.m_rendererCapabilities=r,this.m_updateCallback=n,this.m_atmosphereVariant=o,this.m_materialVariant=s,this.m_enabled=!0,this.m_clipPlanesEvaluator=new g.TiltViewClipPlanesEvaluator(.025*d.EarthConstants.EQUATORIAL_RADIUS,0,1,.05,1e7),this.m_lightDirection=new u.Vector3(0,1,0),this.m_atmosphereVariant&y.Sky&&this.createSkyGeometry(),this.m_atmosphereVariant&y.Ground&&this.createGroundGeometry(),this.addToMapAnchors(this.m_mapAnchors)}get skyMesh(){return this.m_skyMesh}get groundMesh(){return this.m_groundMesh}set enabled(t){if(this.disposed)return;if(this.m_enabled===t)return;this.m_enabled=t;const e=x.isPresent(this.m_mapAnchors);t&&!e?this.addToMapAnchors(this.m_mapAnchors):!t&&e&&this.removeFromMapAnchors(this.m_mapAnchors)}get enabled(){return this.m_enabled}set lightMode(t){if(this.m_materialVariant!==v.ScatteringShader)return;const e=t===_.LightDynamic;void 0!==this.m_groundMaterial&&this.m_groundMaterial.setDynamicLighting(e),void 0!==this.m_skyMaterial&&this.m_skyMaterial.setDynamicLighting(e)}dispose(){var t,e,i,r;this.enabled&&(this.enabled=!1),null===(t=this.m_skyMaterial)||void 0===t||t.dispose(),null===(e=this.m_groundMaterial)||void 0===e||e.dispose(),null===(i=this.m_skyGeometry)||void 0===i||i.dispose(),null===(r=this.m_groundGeometry)||void 0===r||r.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(t){}get disposed(){return void 0===this.m_skyMesh&&void 0===this.m_groundMesh}addToMapAnchors(t){(0,f.assert)(!x.isPresent(t),"Atmosphere already added"),void 0!==this.m_skyMesh&&t.add(w(this.m_skyMesh,Number.MIN_SAFE_INTEGER)),void 0!==this.m_groundMesh&&t.add(w(this.m_groundMesh,Number.MAX_SAFE_INTEGER)),this.m_updateCallback&&this.m_updateCallback()}removeFromMapAnchors(t){if(!x.isPresent(t))return;let e=!1;void 0!==this.m_skyMesh&&(t.remove(this.m_skyMesh),e=!0),void 0!==this.m_groundMesh&&(t.remove(this.m_groundMesh),e=!0),e&&this.m_updateCallback&&this.m_updateCallback()}createSkyGeometry(){this.m_projection.type===d.ProjectionType.Spherical?this.m_skyGeometry=new s.SphereGeometry(1.025*d.EarthConstants.EQUATORIAL_RADIUS,256,256):this.m_skyGeometry=new o.PlaneGeometry(200,200),this.m_skyGeometry.translate(0,0,0),this.m_materialVariant===v.ScatteringShader?this.m_skyMaterial=new m.SkyAtmosphereMaterial({rendererCapabilities:this.m_rendererCapabilities}):this.m_materialVariant===v.SimpleColor?this.m_skyMaterial=new a.MeshBasicMaterial({color:new c.Color(12908781),opacity:.4,transparent:!1,depthTest:!0,depthWrite:!1,side:n.BackSide,blending:n.NormalBlending,fog:!1}):this.m_skyMaterial=new l.MeshStandardMaterial({color:8388607,depthTest:!1,depthWrite:!1,normalScale:new h.Vector2(-1,-1),side:n.BackSide,wireframe:!0}),this.m_skyMesh=new p.Mesh(this.m_skyGeometry,this.m_skyMaterial),this.m_skyMesh.name=x.SkyAtmosphereUserName,this.setupSkyForRendering()}createGroundGeometry(){this.m_projection.type===d.ProjectionType.Spherical?this.m_groundGeometry=new s.SphereGeometry(1.0001*d.EarthConstants.EQUATORIAL_RADIUS,256,256):this.m_groundGeometry=new o.PlaneGeometry(200,200),this.m_groundGeometry.translate(0,0,0),this.m_materialVariant===v.ScatteringShader?this.m_groundMaterial=new m.GroundAtmosphereMaterial({rendererCapabilities:this.m_rendererCapabilities}):this.m_materialVariant===v.SimpleColor?this.m_groundMaterial=new a.MeshBasicMaterial({color:new c.Color(50687),opacity:.4,transparent:!0,depthTest:!1,depthWrite:!1,side:n.FrontSide,blending:n.NormalBlending,fog:!1}):this.m_groundMaterial=new l.MeshStandardMaterial({color:1149338,depthTest:!0,depthWrite:!1,side:n.FrontSide,wireframe:!0}),this.m_groundMesh=new p.Mesh(this.m_groundGeometry,this.m_groundMaterial),this.m_groundMesh.name=x.GroundAtmosphereUserName,this.setupGroundForRendering()}setupSkyForRendering(){if(void 0===this.m_skyMesh)return;let t;t=this.m_materialVariant!==v.ScatteringShader?(t,e)=>{this.overrideClipPlanes(t)}:(t,e)=>{this.overrideClipPlanes(t),(0,f.assert)(e instanceof m.SkyAtmosphereMaterial);const i=this.m_skyMaterial;i.updateUniforms(i,this.m_skyMesh,t,this.m_lightDirection)},(0,f.assert)(void 0!==this.m_skyMaterial),this.m_skyMesh.onBeforeRender=(e,i,r,n,o,s)=>{t(r,o)},this.m_skyMesh.onAfterRender=(t,e,i,r,n,o)=>{this.revertClipPlanes(i)}}setupGroundForRendering(){void 0!==this.m_groundMesh&&this.m_materialVariant===v.ScatteringShader&&((0,f.assert)(void 0!==this.m_groundMaterial),this.m_groundMesh.onBeforeRender=(t,e,i,r,n,o)=>{(0,f.assert)(n instanceof m.GroundAtmosphereMaterial);const s=this.m_groundMaterial;s.updateUniforms(s,this.m_groundMesh,i,this.m_lightDirection)})}overrideClipPlanes(t){const e=this.m_sceneCamera;b.clipPlanes.near=e.near,b.clipPlanes.far=e.far;const i=this.m_clipPlanesEvaluator.evaluateClipPlanes(this.m_sceneCamera,this.m_projection);(0,f.assert)(t instanceof r.PerspectiveCamera);const n=t;n.near=i.near,n.far=i.far+.1*d.EarthConstants.EQUATORIAL_RADIUS,n.updateProjectionMatrix()}revertClipPlanes(t){(0,f.assert)(t instanceof r.PerspectiveCamera);const e=t;e.near=b.clipPlanes.near,e.far=b.clipPlanes.far,e.updateProjectionMatrix()}}function w(t,e){const i=t;return i.renderOrder=e,i.pickable=!1,i.anchor=new u.Vector3(0,0,0),i}e.MapViewAtmosphere=x,x.SkyAtmosphereUserName="SkyAtmosphere",x.GroundAtmosphereUserName="GroundAtmosphere"},3011:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.MapViewEnvironment=e.DEFAULT_CLEAR_COLOR=void 0;const r=i(2616),n=i(8023),o=i(7610),s=i(4342),a=i(6815),l=i(4307),c=i(3334),h=i(2754),u=i(5863),p=i(3977),d=i(3061),m=i(7775),f=i(5640),g=s.LoggerManager.instance.create("MapViewEnvironment");e.DEFAULT_CLEAR_COLOR=16777215;const y={vector3:[new a.Vector3,new a.Vector3,new a.Vector3],frustumPoints:[new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3]};e.MapViewEnvironment=class{constructor(t,e){this.m_mapView=t,this.m_lastZoomLevelOnUpdate=NaN,this.onMapViewContextRestored=t=>{void 0!==this.m_mapView.renderer&&this.m_mapView.getTheme().then(t=>{this.updateClearColor(t.clearColor,t.clearAlpha,t.definitions),this.m_mapView.update()})},this.applyClearColorAndAlpha=()=>{const t=this.evaluateClearColor(),e=n.Expr.isExpr(this.m_clearAlpha)?this.m_clearAlpha.evaluate(this.m_mapView.env,n.ExprScope.Dynamic):this.m_clearAlpha;void 0!==this.m_mapView.renderer&&this.m_mapView.renderer.setClearColor(t,e)},this.m_fog=new d.MapViewFog(this.m_mapView.scene),!1!==e.addBackgroundDatasource&&(this.m_backgroundDataSource=new u.BackgroundDataSource(e.backgroundTilingScheme),this.m_mapView.addDataSource(this.m_backgroundDataSource)),this.m_mapView.addEventListener(p.MapViewEventNames.ContextRestored,this.onMapViewContextRestored),this.updateClearColor()}get lights(){var t;return null!==(t=this.m_createdLights)&&void 0!==t?t:[]}get fog(){return this.m_fog}
2updateBackgroundDataSource(){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===r.ProjectionType.Planar&&this.m_skyBackground.updateCamera(this.m_mapView.camera),this.updateLights()}updateClearColor(t,i,r){if(void 0===t)this.m_clearColor=e.DEFAULT_CLEAR_COLOR;else{const e=n.Expr.fromJSON(t,r);this.m_clearColor=e.isDynamic()?e:e.evaluate(this.m_mapView.env,n.ExprScope.Value)}if(void 0===i)this.m_clearAlpha=i;else{const t=n.Expr.fromJSON(i,r);this.m_clearAlpha=t.isDynamic()?t:t.evaluate(this.m_mapView.env,n.ExprScope.Value)}this.applyClearColorAndAlpha()}evaluateClearColor(){let t;if(n.Expr.isExpr(this.m_clearColor)){const e=this.m_clearColor.evaluate(this.m_mapView.env,n.ExprScope.Dynamic);t=e instanceof o.RGBA?e.getHex():e}else t=this.m_clearColor;return t}updateSkyBackground(t){t?this.setSkyBackground(t):this.removeSkyBackGround()}updateLighting(t){var e;this.m_createdLights&&this.m_createdLights.forEach(t=>{this.m_mapView.scene.remove(t)}),null===(e=this.m_overlayCreatedLights)||void 0===e||e.forEach(t=>{this.m_mapView.overlayScene.remove(t),t instanceof l.DirectionalLight&&this.m_mapView.overlayScene.remove(t.target)}),void 0!==t&&(this.m_createdLights=[],this.m_overlayCreatedLights=[],t.forEach(t=>{const e=(0,f.createLight)(t);if(!e)return void g.warn(`MapView: failed to create light ${t.name} of type ${t.type}`);if(this.m_mapView.scene.add(e),e.isDirectionalLight){const t=e;this.m_mapView.scene.add(t.target)}this.m_createdLights.push(e);const i=e.clone();this.m_mapView.overlayScene.add(i),i instanceof l.DirectionalLight&&this.m_mapView.overlayScene.add(i.target.clone())}))}updateLights(){if(!this.m_mapView.shadowsEnabled||this.m_mapView.projection.type===r.ProjectionType.Spherical||void 0===this.m_createdLights||0===this.m_createdLights.length)return;const t=[{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((t,e)=>this.m_mapView.ndcToView(t,y.frustumPoints[e]));this.m_createdLights.forEach(e=>{const i=e;if(!0===i.isDirectionalLight){const e=y.vector3[0];e.copy(i.target.position),e.sub(i.position),e.normalize();const n=y.vector3[1];this.m_mapView.projection.type===r.ProjectionType.Planar&&n.set(0,0,-1);const o=this.m_mapView.tilt,s=this.m_mapView.targetDistance*Math.cos((0,c.degToRad)(o))/n.dot(e);i.target.position.copy(this.m_mapView.worldTarget).sub(this.m_mapView.camera.position),i.position.copy(this.m_mapView.worldTarget),i.position.addScaledVector(e,-s),i.position.sub(this.m_mapView.camera.position),i.updateMatrixWorld(),i.shadow.updateMatrices(i);const a=i.shadow.camera,l=t.map(t=>this.viewToLightSpace(t.clone(),a)),u=new h.Box3;l.forEach(t=>{u.expandByPoint(t)}),a.left=u.min.x,a.right=u.max.x,a.top=u.max.y,a.bottom=u.min.y,a.near=.95*-u.max.z,a.far=-u.min.z,a.updateProjectionMatrix()}})}removeSkyBackGround(){this.m_mapView.scene.background=null,void 0!==this.m_skyBackground&&(this.m_skyBackground.dispose(),this.m_skyBackground=void 0)}setSkyBackground(t){var e;this.m_skyBackground?this.m_skyBackground.updateTexture(t,this.m_mapView.projection.type):this.m_skyBackground=new m.SkyBackground(t,this.m_mapView.projection.type,this.m_mapView.camera),this.m_mapView.scene.background=null===(e=this.m_skyBackground)||void 0===e?void 0:e.texture}viewToLightSpace(t,e){return t.applyMatrix4(e.matrixWorldInverse)}}},3061:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MapViewFog=void 0;const r=i(3334),n=i(5269),o=i(7436),s=i(4250),a=i(4342);e.MapViewFog=class{constructor(t){this.m_scene=t,this.m_enabled=!0,this.m_fog=new o.Fog(0),this.m_fogIsDefined=!1}set enabled(t){this.m_enabled=t,t&&this.m_fogIsDefined&&null===this.m_scene.fog?this.add():t||null===this.m_scene.fog||this.remove()}get enabled(){return this.m_enabled}reset(t){this.m_cachedFog=t,void 0!==t&&void 0!==t.color&&void 0!==t.startRatio?(this.m_fogIsDefined=!0,this.m_fog.color.set(t.color),this.m_enabled&&null===this.m_scene.fog&&this.add()):(this.m_fogIsDefined=!1,null!==this.m_scene.fog&&this.remove())}update(t,e){if(null!==this.m_scene.fog&&void 0!==this.m_cachedFog&&this.m_cachedFog&&void 0!==this.m_cachedFog.startRatio&&(void 0!==t.camera.far||void 0!==e)){const i=void 0!==e?e:t.camera.far,n=1,o=0,s=this.m_cachedFog.startRatio,l=1;(0,a.assert)(s<=l);const c=Math.abs(Math.cos(t.tilt)),h=a.MathUtils.smoothStep(n,o,c);this.m_fog.near=(0,r.lerp)(i*s,i,1-h),this.m_fog.far=(0,r.lerp)(i*l,i,h),this.m_fog.near=Math.min(this.m_fog.near,t.camera.far),this.m_fog.far=Math.min(this.m_fog.far,t.camera.far)}}add(){this.m_scene.fog=this.m_fog,this.setFogInRawShaderMaterials(!0)}remove(){this.m_scene.fog=null,this.setFogInRawShaderMaterials(!1)}setFogInRawShaderMaterials(t){this.m_scene.traverse(e=>{if(e instanceof n.Mesh){const i=e.material;!("fog"in i)||i instanceof s.HighPrecisionLineMaterial||i.fog===t||(i.fog=t,i instanceof s.RawShaderMaterial&&i.invalidateFog())}})}}}
2,5146:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Squares=e.Circles=e.MapViewPoints=void 0;const r=i(5448),n=i(6815),o=i(4994);class s extends o.Points{constructor(){super(...arguments),this.enableRayTesting=!0}raycast(t,e){if(!this.enableRayTesting)return;const i=this.geometry,r=this.matrixWorld,o=a(t.ray.origin.clone().add(t.ray.direction).project(t.camera),t),s=(i,n)=>{const s=function(t,e,i){const r=t.clone().applyMatrix4(e),n=r.distanceTo(i.ray.origin),o=r.project(i.camera),s=o.x<1&&o.x>-1&&o.y<1&&o.y>-1;return s?{absoluteScreenPosition:a(o,i),pointIsOnScreen:s,distance:n}:{pointIsOnScreen:s}}(i,r,t);s.pointIsOnScreen&&this.testPoint(i,s.absoluteScreenPosition,o,n,s.distance,e)},l=new n.Vector3,c=i.index,h=i.attributes.position.array;if(null!==c){const t=c.array;for(let e=0,i=t.length;e<i;e++)s(l.fromArray(h,3*t[e]),e)}else for(let t=0,e=h.length/3;t<e;t++)s(l.fromArray(h,3*t),t)}}function a(t,e){return new r.Vector2(t.x+1,1-t.y).divideScalar(2).multiply(e.canvasSize).ceil()}e.MapViewPoints=s,e.Circles=class extends s{testPoint(t,e,i,r,n,o){const s=e.x-i.x,a=e.y-i.y;Math.sqrt(s*s+a*a)<=this.material.size/2&&o.push({point:t,distance:n,index:r,object:this})}},e.Squares=class extends s{testPoint(t,e,i,r,n,o){const s=e.x-i.x,a=e.y-i.y,l=this.material.size/2;Math.abs(s)<=l&&Math.abs(a)<=l&&o.push({point:t,distance:n,index:r,object:this})}}},19:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MapViewTaskScheduler=void 0;const r=i(4342),n=i(2356),o=i(3977),s=i(8015),a={type:"update"};class l extends n.EventDispatcher{constructor(t=60){super(),this.m_maxFps=t,this.m_throttlingEnabled=!1,this.m_taskQueue=new r.TaskQueue({groups:[o.TileTaskGroups.FETCH_AND_DECODE,o.TileTaskGroups.CREATE],prioSortFn:(t,e)=>t.getPriority()-e.getPriority()}),this.maxFps=t}set maxFps(t){this.m_maxFps=t<=0?60:t}get maxFps(){return this.m_maxFps}get taskQueue(){return this.m_taskQueue}get throttlingEnabled(){return!0===this.m_throttlingEnabled}set throttlingEnabled(t){this.m_throttlingEnabled=t}requestUpdate(){this.dispatchEvent(a)}processPending(t){const e=s.PerformanceStatistics.instance,i=e.enabled?e.currentFrame:void 0;let n;e.enabled&&(n=r.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(t);l=l>2?l-2:l,null==i||i.setValue("TaskScheduler.estimatedAvailableTime",l);let c=0;for(;l>0&&a>0;){function h(t){var e,i;return l-=null!==(i=null===(e=t.estimatedProcessTime)||void 0===e?void 0:e.call(t))&&void 0!==i?i:2,l>0||1===c}c++,[o.TileTaskGroups.CREATE,o.TileTaskGroups.FETCH_AND_DECODE].forEach(t=>{this.m_taskQueue.numItemsLeft(t)&&this.m_taskQueue.processNext(t,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(o.TileTaskGroups.CREATE,void 0,this.m_taskQueue.numItemsLeft(o.TileTaskGroups.CREATE)),this.m_taskQueue.processNext(o.TileTaskGroups.FETCH_AND_DECODE,void 0,this.m_taskQueue.numItemsLeft(o.TileTaskGroups.FETCH_AND_DECODE));e.enabled&&(null==i||i.setValue("TaskScheduler.pendingTasksTime",r.PerformanceTimer.now()-n))}clearQueuedTasks(){this.m_taskQueue.clear()}spaceInFrame(t){const e=(performance||Date).now()-t;return Math.max(1e3/this.m_maxFps-e,0)}}e.MapViewTaskScheduler=l},6272:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MapViewThemeManager=void 0;const r=i(6586);function n(t,e){return JSON.stringify(t)===JSON.stringify(e)}e.MapViewThemeManager=class{constructor(t,e,i,r){this.m_mapView=t,this.m_theme=e,this.m_imageRepo=i,this.m_uriResolver=r,this.m_isUpdating=!1,this.m_cachedCompleteTheme={},this.m_abortController=new AbortController,this.m_completeThemePromise=this.setTheme(this.m_theme)}setTheme(t,e){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(t,e,null===(i=this.m_abortController)||void 0===i?void 0:i.signal).then(t=>{var e;return this.updateTheme(t,null===(e=this.m_abortController)||void 0===e?void 0:e.signal)}
2).finally(()=>{this.m_isUpdating=!1}),this.m_completeThemePromise}getTheme(){return this.m_completeThemePromise}isUpdating(){return this.m_isUpdating}dispose(){this.m_imageRepo.imageCache.clear(this)}loadTheme(t,e,i){return"string"!=typeof t&&(0,r.isThemeLoaded)(t)?Promise.resolve(t):(0,r.load)(t,{baseUrl:e,uriResolver:this.m_uriResolver,signal:i})}async updateTheme(t,e){var i,r;const o=this.m_mapView.sceneEnvironment;if(this.m_cachedCompleteTheme.clearAlpha===t.clearAlpha&&this.m_cachedCompleteTheme.clearColor===t.clearColor||(this.m_cachedCompleteTheme.clearColor=t.clearColor,this.m_cachedCompleteTheme.clearAlpha=t.clearAlpha,o.updateClearColor(t.clearColor,t.clearAlpha,t.definitions)),n(this.m_cachedCompleteTheme.sky,t.sky)||(this.m_cachedCompleteTheme.sky=t.sky,o.updateSkyBackground(t.sky)),n(this.m_cachedCompleteTheme.fog,t.fog)||(this.m_cachedCompleteTheme.fog=t.fog,o.fog.reset(t.fog)),n(this.m_cachedCompleteTheme.lights,t.lights)||(this.m_cachedCompleteTheme.lights=t.lights,o.updateLighting(t.lights)),!n(this.m_cachedCompleteTheme.assets,t.assets))try{await this.updateAssets(t.assets,e),this.m_cachedCompleteTheme.assets=t.assets}catch(t){throw this.m_cachedCompleteTheme.assets=void 0,t}if(!n(this.m_cachedCompleteTheme.textStyles,t.textStyles)||!n(this.m_cachedCompleteTheme.defaultTextStyle,t.defaultTextStyle)||!n(this.m_cachedCompleteTheme.fontCatalogs,t.fontCatalogs))try{await this.m_mapView.iconTextRenderer.setTheme(t,e),this.m_cachedCompleteTheme.textStyles=t.textStyles,this.m_cachedCompleteTheme.defaultTextStyle=t.defaultTextStyle,this.m_cachedCompleteTheme.fontCatalogs=t.fontCatalogs}catch(t){throw this.m_cachedCompleteTheme.textStyles=void 0,this.m_cachedCompleteTheme.defaultTextStyle=void 0,this.m_cachedCompleteTheme.fontCatalogs=void 0,t}Array.isArray(t.priorities)&&(this.m_cachedCompleteTheme.priorities=t.priorities,this.m_mapView.mapAnchors.setPriorities(null!==(i=t.priorities)&&void 0!==i?i:[])),Array.isArray(t.labelPriorities)&&(this.m_cachedCompleteTheme.labelPriorities=t.labelPriorities),this.m_cachedCompleteTheme.styles=null!==(r=t.styles)&&void 0!==r?r:[],this.m_cachedCompleteTheme.definitions=t.definitions,this.m_cachedCompleteTheme.features=t.features;for(const t of this.m_mapView.dataSources)await t.setTheme(this.m_cachedCompleteTheme);return this.m_cachedCompleteTheme}async updateAssets(t,e){if(this.m_imageRepo.iconTextManager.clear(),this.m_imageRepo.imageCache.clear(this),this.m_mapView.textureCache.evictAll(),t)for(const[i,{url:r,atlas:n,preload:o,scalable:s=!1}]of Object.entries(t)){const a=this.m_imageRepo.imageCache.registerImageByUrl(this,r,void 0,s);o&&a.loadImage(),"string"==typeof n?await this.m_imageRepo.iconTextManager.addTextureAtlas(r,n,o,e):this.m_imageRepo.iconTextManager.addImageTexture(t[i],i)}}}},9701:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PathBlockingElement=void 0;const r=i(6815),n=i(414);e.PathBlockingElement=class{constructor(t){this.points=t,this.screenSpaceLines=new Array(t.length>=2?t.length-1:0);for(let t=0;t<this.screenSpaceLines.length;t++)this.screenSpaceLines[t]=new n.Line3(new r.Vector3,new r.Vector3)}}},8881:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PickHandler=e.PickObjectType=void 0;const r=i(5448),n=i(6815),o=i(8152),s=i(2616),a=i(4572),l=i(5146),c=i(6946),h=i(7979),u=i(541);var p;!function(t){t[t.Unspecified=0]="Unspecified",t[t.Point=1]="Point",t[t.Line=2]="Line",t[t.Area=3]="Area",t[t.Text=4]="Text",t[t.Icon=5]="Icon",t[t.Object3D=6]="Object3D"}(p=e.PickObjectType||(e.PickObjectType={}));const d=new n.Vector3,m=new s.OrientedBox3;function f(t,e,i,r,n){for(const o of t.dependencies){const s=o.mortonCode();if(r.has(s))continue;r.add(s);const a=n.visibleTileSet.getCachedTile(t.dataSource,o,t.offset,n.frameNumber);void 0!==a&&i.intersectObjects(a.objects,!0,e)}}e.PickHandler=class{constructor(t,e,i=!1){this.mapView=t,this.camera=e,this.enablePickTechnique=i,this.m_pickingRaycaster=new c.PickingRaycaster(t.renderer.getSize(new r.Vector2))}intersectMapObjects(t,e,i){const n=this.mapView.getNormalizedScreenCoordinates(t,e),o=this.setupRaycaster(t,e),s=new h.PickListener(i),{clientWidth:a,clientHeight:l}
2=this.mapView.canvas,c=n.x*a*.5,u=n.y*l*.5,d=new r.Vector2(c,u);this.mapView.iconTextRenderer.pickIconTexts(d,(t,e)=>{const i={type:e?p.Text:p.Icon,point:d,distance:0,renderOrder:t.renderOrder,featureId:t.featureId,userData:t.userData,dataSourceName:t.dataSourceName,dataSourceOrder:t.dataSourceOrder};i.technique=this.enablePickTechnique?t.technique:void 0,s.addResult(i)});const m=[],g=this.getIntersectedTiles(o),y=new Set;for(const{tile:t,distance:e}of g){const i=1e-4;if(s.done&&e-s.furthestResult.distance>i)break;m.length=0,o.intersectObjects(t.objects,!0,m),f(t,m,o,y,this.mapView);for(const t of m)s.addResult(this.createResult(t))}m.length=0;for(const t of this.mapView.mapAnchors.children){o.intersectObject(t,!0,m);for(const t of m)s.addResult(this.createResult(t))}return s.finish(),s.results}raycasterFromScreenPoint(t,e){return this.m_pickingRaycaster.setFromCamera(this.mapView.getNormalizedScreenCoordinates(t,e),this.camera),this.mapView.renderer.getSize(this.m_pickingRaycaster.canvasSize),this.m_pickingRaycaster}createResult(t){var e,i,r;const n=a.MapObjectAdapter.get(t.object),s={type:p.Unspecified,point:t.point,distance:t.distance,dataSourceName:null===(e=null==n?void 0:n.dataSource)||void 0===e?void 0:e.name,dataSourceOrder:null===(i=null==n?void 0:n.dataSource)||void 0===i?void 0:i.dataSourceOrder,intersection:t,tileKey:null==n?void 0:n.tileKey};if(void 0===t.object.userData||void 0===t.object.userData.feature)return s;if(this.enablePickTechnique){const e=a.MapObjectAdapter.get(t.object);s.technique=null==e?void 0:e.technique}s.renderOrder=null===(r=t.object)||void 0===r?void 0:r.renderOrder;const l=t.object.userData.feature;if(this.addObjInfo(l,t,s),s.userData){const t=(0,o.getFeatureId)(s.userData);s.featureId=0===t?void 0:t}let c;switch(l.geometryType){case o.GeometryType.Point:case o.GeometryType.Text:c=p.Point;break;case o.GeometryType.Line:case o.GeometryType.ExtrudedLine:case o.GeometryType.SolidLine:case o.GeometryType.TextPath:c=p.Line;break;case o.GeometryType.Polygon:case o.GeometryType.ExtrudedPolygon:c=p.Area;break;case o.GeometryType.Object3D:c=p.Object3D;break;default:c=p.Unspecified}return s.type=c,s}getIntersectedTiles(t){const e=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 r=i.computeWorldOffsetX();m.position.x+=r;const n=m.intersectsRay(t.ray);void 0!==n&&e.push({tile:i,distance:n})})}),e.sort((t,e)=>t.distance-e.distance),e}addObjInfo(t,e,i){if(void 0===t.objInfos)return;if(i.intersection.object instanceof l.MapViewPoints)return void(i.userData=t.objInfos[e.index]);if(void 0===t.starts||0===t.starts.length||"number"!=typeof e.faceIndex&&void 0===e.index)return void(1===t.objInfos.length&&(i.userData=t.objInfos[0]));if(1===t.starts.length)return void(i.userData=t.objInfos[0]);const r="number"==typeof e.faceIndex?3*e.faceIndex:e.index;let n=0;for(const e of t.starts){if(e>r)break;n++}i.userData=t.objInfos[n-1]}setupRaycaster(t,e){const i=this.mapView.camera,r=this.raycasterFromScreenPoint(t,e),n=this.mapView.getWorldPositionAt(t,e,!0),o=i.position.distanceTo(n)/this.mapView.camera.getWorldDirection(d).dot(r.ray.direction);return r.params.Line.threshold=u.MapViewUtils.calculateWorldSizeByFocalLength(this.mapView.focalLength,o,1),r}}},7979:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PickListener=void 0;const r=i(4342),n=i(4572);function o(t,e){var i,r;const n=null!==(i=t.dataSourceOrder)&&void 0!==i?i:0,o=null!==(r=e.dataSourceOrder)&&void 0!==r?r:0;if(n!==o)return o-n;const s=t.distance-e.distance,a=void 0!==t.renderOrder&&void 0!==e.renderOrder;return Math.abs(s)>1e-4||!a?s:e.renderOrder-t.renderOrder}e.PickListener=class{constructor(t){this.m_parameters=t,this.m_results=[],this.m_sorted=!0,this.m_finished=!0}addResult(t){var e,i,r,s,a;let l=-1;if(!(null===(e=this.m_parameters)||void 0===e?void 0:e.allowDuplicates))for(l=this.m_results.length;l--;){const e=this.m_results[l];if(e.type===t.type){const o=null===(r=n.MapObjectAdapter.get(null===(i=t.intersection)||void 0===i?void 0:i.object))||void 0===r?void 0:r.dataSource,l=null===(a=n.MapObjectAdapter.get(null===(s=e.intersection)||void 0===s?void 0:s.object))||void 0===a?void 0:a.dataSource;if(o&&l===o){const i=t.featureId;if(e.featureId===i&&(void 0!==i||t.userData&&e.userData===t.userData))break}}}l<0?(this.m_sorted=!1,this.m_finished=!1,this.m_results.push(t)):o(t,this.m_results[l])<0&&(this.m_results[l]=t,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,r.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 t,e;const i=null!==(e=null===(t=this.m_parameters)||void 0===t?void 0:t.maxResultCount)&&void 0!==e?e:0;return i>0?i:void 0}sortResults(){if(this.m_sorted)return;const t=[],e=[];
2this.m_results.sort(o).forEach(i=>(0===i.distance?t:e).push(i)),this.m_results=t.concat(e),this.m_sorted=!0}}},6946:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PickingRaycaster=void 0;const r=i(3216),n=i(4572);function o(t,e,i,r){if(t.layers.test(e.layers)&&t.visible){const r=n.MapObjectAdapter.get(t);r&&!r.isPickable()||t.raycast(e,i)}if(!0===r)for(const r of t.children)o(r,e,i,!0)}class s extends r.Raycaster{constructor(t){super(),this.canvasSize=t}intersectObject(t,e,i){const r=null!=i?i:[];return o(t,this,r,e),r}intersectObjects(t,e,i){const r=null!=i?i:[];for(const i of t)o(i,this,r,e);return r}}e.PickingRaycaster=s},6313:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PlaneViewBounds=void 0;const r=i(6084),n=i(414),o=i(8333),s=i(3850),a=i(2309),l=i(6815),c=i(2616),h=i(4342),u=i(541);e.PlaneViewBounds=class{constructor(t,e,i){this.camera=t,this.projection=e,this.m_options=i,this.m_groundPlaneNormal=new l.Vector3(0,0,1),this.m_groundPlane=new s.Plane(this.m_groundPlaneNormal.clone()),(0,h.assert)(e.type===c.ProjectionType.Planar)}generate(){const t=[];if(this.addCanvasCornerIntersection(t),4===t.length)return this.createPolygon(t);this.addHorizonIntersection(t);const e=(new r.Frustum).setFromProjectionMatrix((new o.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,e,t)}),this.m_options.tileWrappingEnabled){const r=(new l.Vector3).subVectors(i.sw,i.se).normalize(),n=(new l.Vector3).subVectors(i.se,i.sw).normalize();[new a.Ray(i.se,r),new a.Ray(i.se,n),new a.Ray(i.ne,r),new a.Ray(i.ne,n)].forEach(i=>{this.addFrustumIntersection(i,e,t)})}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
2h(i=>{this.addFrustumIntersection(i,e,t)});return this.createPolygon(t)}createPolygon(t){if(t.length>2)return new c.GeoPolygon(t,!0)}getWorldConers(t){const e=t.worldExtent(0,0);return{sw:e.min,se:new l.Vector3(e.max.x,e.min.y,0),nw:new l.Vector3(e.min.x,e.max.y,0),ne:e.max}}addNDCRayIntersection(t,e){t.forEach(t=>{const i=u.MapViewUtils.rayCastWorldCoordinates({camera:this.camera,projection:this.projection},t[0],t[1]);i&&this.validateAndAddToGeoPolygon(i,e)})}addHorizonIntersection(t){const e=this.getVerticalHorizonPositionInNDC();e&&this.addNDCRayIntersection([[-1,e],[1,e]],t)}addCanvasCornerIntersection(t){this.addNDCRayIntersection([[-1,-1],[1,-1],[1,1],[-1,1]],t)}validateAndAddToGeoPolygon(t,e){this.isInVisibleMap(t)&&e.push(this.projection.unprojectPoint(t))}isInVisibleMap(t){return!(t.y<0||t.y>c.EarthConstants.EQUATORIAL_CIRCUMFERENCE||!this.m_options.tileWrappingEnabled&&(t.x<0||t.x>c.EarthConstants.EQUATORIAL_CIRCUMFERENCE))}addPointInFrustum(t,e,i){if(e.containsPoint(t)){const e=this.projection.unprojectPoint(t);e.altitude=0,i.push(e)}}addFrustumIntersection(t,e,i){e.planes.forEach(e=>{let r=null;const o=new l.Vector3;if(t instanceof a.Ray&&t.intersectsPlane(e)?r=t.intersectPlane(e,o):t instanceof n.Line3&&e.intersectsLine(t)&&(r=e.intersectLine(t,o)),r&&u.MapViewUtils.closeToFrustum(r,this.camera)){const t=this.projection.unprojectPoint(r);t.altitude=0,i.push(t)}})}getVerticalHorizonPositionInNDC(){const t=new l.Vector3(-1,-1,1).unproject(this.camera).add(new l.Vector3(1,-1,1).unproject(this.camera)).multiplyScalar(.5),e=new l.Vector3(-1,1,1).unproject(this.camera).add(new l.Vector3(1,1,1).unproject(this.camera)).multiplyScalar(.5),i=new n.Line3(t,e),r=new l.Vector3;if(this.m_groundPlane.intersectLine(i,r))return r.project(this.camera).y}}},5187:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PolarTileDataSource=void 0;const r=i(3148),n=i(977),o=i(3334),s=i(6815),a=i(5269),l=i(7769),c=i(2616),h=i(1984),u=i(4303),p=i(8427),d=i(4572),m=i(6586),f=i(1447);class g extends u.DataSource{constructor({name:t="polar",layerNames:e=["northpole","southpole"],minDataLevel:i,maxDataLevel:r,minDisplayLevel:n,maxDisplayLevel:s,storageLevelOffset:a=-2,geometryLevelOffset:l=1,debugTiles:h=!1}){super({name:t,layerNames:e,minDataLevel:i,maxDataLevel:r,minDisplayLevel:n,maxDisplayLevel:s,storageLevelOffset:a}),this.m_tilingScheme=c.polarTilingScheme,this.m_maxLatitude=(0,o.radToDeg)(c.MercatorConstants.MAXIMUM_LATITUDE),this.m_geometryLevelOffset=l,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(t){if(!this.m_styleSetEvaluator)return;const e=new l.MapEnv({$geometryType:"polygon",$layer:"earth",kind:t}),i=this.m_styleSetEvaluator.getMatchingTechniques(e);if(0===i.length)return;const r=i[0],n=(0,p.createMaterial)(r,this.mapView);return n?{material:n.material,technique:r}:void 0}async setTheme(t){t=await(0,m.load)(t);const e=(0,h.getStyles)(t.styles).filter(t=>{var e;return!t.layer||(null===(e=this.layerNames)||void 0===e?void 0:e.includes(t.layer))});e.length>0&&(this.m_styleSetEvaluator=new l.StyleSetEvaluator({styleSet:e,definitions:t.definitions,priorities:t.priorities,labelPriorities:t.labelPriorities})),this.m_northPoleEntry=this.createTechiqueEntry("north_pole"),this.m_southPoleEntry=this.createTechiqueEntry("south_pole"),this.mapView.markTilesDirty(this)}canGetTile(t,e){if(t!==e.level||e.level<1)return!1;const{north:i,south:r}=this.m_tilingScheme.getGeoBox(e);return i>this.m_maxLatitude||r<-this.m_maxLatitude}shouldSubdivide(t,e){if(t<=e.level)return!1;const{north:i,south:r}=this.m_tilingScheme.getGeoBox(e);return i>this.m_maxLatitude||r<-this.m_maxLatitude}getTilingScheme(){return this.m_tilingScheme}getTile(t){const e=new f.Tile(this,t);return this.createTileGeometry(e),e}get geometryLevelOffset(){return this.m_geometryLevelOffset}set geometryLevelOffset(t){this.m_geometryLevelOffset=t}intersectEdge(t,e,i){const r=e.latitude,n=i.latitude;let o=e.longitude,s=i.longitude;90===Math.abs(r)&&(o=s),90===Math.abs(n)&&(s=o);const a=s-o,l=(t-r)/(n-r);return new c.GeoCoordinates(t,o+a*l,0)}createTileGeometry(t){const{north:e,south:i}=t.geoBox,o=e>0&&i>=0,l=o?this.m_northPoleEntry:this.m_southPoleEntry;if(void 0===l)return void t.forceHasGeometry(!0);const h=this.m_tilingScheme.projection,u=this.projection,p=this.m_maxLatitude,m=o?p:-p,f=this.m_tilingScheme.boundingBoxGenerator.getWorldBox(t.tileKey),g=h.unprojectPoint(new s.Vector3(f.min.x,f.min.y,0)),y=h.unprojectPoint(new s.Vector3(f.max.x,f.min.y,0)),v=h.unprojectPoint(new s.Vector3(f.max.x,f.max.y,0)),_=h.unprojectPoint(new s.Vector3(f.min.x,f.max.y,0));let b,x=!1;if(1===t.tileKey.level){const t=0===f.min.x,e=t?f.max.x:f.min.x,i=(f.max.y+f.min.y)/2,r=h.unprojectPoint(new s.Vector3(e,i,0)),n=t?g:y;b=o?t?[r,v,n,y]:[r,g,n,_]:t?[r,y,n,v]:[r,_,n,g],x=!0}else{b=o?[g,y,v,_]:[g,_,v,y];const t=b.map(t=>t.latitude),e=Math.max(...t),i=Math.min(...t);if(o?e<m:i>m)return;if(x=o?i<m:e>m,x){const r=t.indexOf(o?e:i);if(0!==r)for(let t=0;t<r;t++)b.push(b.shift())}}if(x){const e=(f.min.x+f.max.x)/2,i=(f.min.y+f.max.y)/2,r=h.unprojectPoint(new s.Vector3(e,i,0));c.TransverseMercatorUtils.alignLongitude(b,r);const n=b[0],o=b[1],a=b[2],l=b[3],u=Math.abs(o.latitude)>
2=p,d=Math.abs(l.latitude)>=p,g=u?this.intersectEdge(m,o,a):this.intersectEdge(m,n,o),y=d?this.intersectEdge(m,l,a):this.intersectEdge(m,n,l);b.splice(u?2:1,4,g);const v=t.tileKey.level-this.storageLevelOffset+this.m_geometryLevelOffset,_=360/(1<<Math.max(0,v)),x=Math.floor((g.longitude+180)/_),w=Math.ceil((y.longitude+180)/_);for(let t=x+1;t<w;t++)b.push(new c.GeoCoordinates(m,t*_-180,0));b.push(y),d&&b.push(l)}const w=new r.BufferGeometry,S=b.map(e=>{const i=u.projectPoint(e,new s.Vector3);return i.sub(t.center),i});w.setFromPoints(S);const T=[];for(let t=1;t<S.length-1;t++)o?T.push(0,t,t+1):T.push(0,t+1,t);w.setIndex(T);const E=new a.Mesh(w,l.material);if(E.userData={dataSource:this.name,tileKey:t.tileKey},this.m_debugTiles){const e=Math.round(16777215*Math.abs(Math.sin(11*t.tileKey.mortonCode())));E.material=new n.MeshBasicMaterial({color:e,transparent:!0,opacity:.5}),t.objects.push(new a.Mesh(w,new n.MeshBasicMaterial({color:e,wireframe:!0})))}d.MapObjectAdapter.create(E,{dataSource:this,technique:l.technique}),t.objects.push(E)}}e.PolarTileDataSource=g},7362:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ScreenCollisionsDebug=e.ScreenCollisions=e.isLineWithBound=e.DetailedCollisionBox=e.CollisionBox=void 0;const r=i(433),n=i(4342),o=i(507),s=i(1102),a=n.LoggerManager.instance.create("ScreenCollisions");class l extends n.Math2D.Box{constructor(t){super(),void 0!==t&&this.copy(t)}copy(t){return t instanceof n.Math2D.Box?this.set(t.x,t.y,t.w,t.h):t instanceof r.Box2?this.set(t.min.x,t.min.y,t.max.x-t.min.x,t.max.y-t.min.y):this.set(t.minX,t.minY,t.maxX-t.minX,t.maxY-t.minY),this}get minX(){return this.x}set minX(t){this.x=t}get maxX(){return this.x+this.w}set maxX(t){this.w=t-this.x}get minY(){return this.y}set minY(t){this.y=t}get maxY(){return this.y+this.h}set maxY(t){this.h=t-this.y}}e.CollisionBox=l;class c extends l{constructor(t,e){super(t),this.detailBoxes=e}}function h(t){return void 0!==t.line}e.DetailedCollisionBox=c,e.isLineWithBound=h;const u=new l;class p{constructor(){this.screenBounds=new n.Math2D.Box,this.rtree=new s}reset(){this.rtree.clear()}update(t,e){this.screenBounds.set(t/-2,e/-2,t,e),this.reset()}allocate(t){const e=t instanceof l?t:new l(t);this.rtree.insert(e)}allocateIBoxes(t){this.rtree.load(t)}search(t){return this.rtree.search(t)}isAllocated(t){const e=t instanceof l?t:u.copy(t),i=this.search(e);return this.intersectsDetails(e,i)}isVisible(t){return this.screenBounds.intersects(t)}isFullyVisible(t){return this.screenBounds.containsBox(t)}intersectsDetails(t,e){for(const i of e)if(i instanceof c){for(const e of i.detailBoxes)if(e.intersects(t))return!0}else{if(!h(i))return!0;{const e=i;if(this.intersectsLine(t,e))return!0}}return!1}intersectsLine(t,e){const i=e.line,r=i.end.x-i.start.x;let n,o,s,a;if(0!==r){const e=i.end.y-i.start.y,l=e,c=-r,h=i.start.y-e/r*i.start.x;n=Math.sign(t.minX*l+(t.minY-h)*c),o=Math.sign(t.maxX*l+(t.minY-h)*c),s=Math.sign(t.minX*l+(t.maxY-h)*c),a=Math.sign(t.maxX*l+(t.maxY-h)*c)}else n=Math.sign(t.minX-i.start.x),o=Math.sign(t.maxX-i.start.x),s=Math.sign(t.minX-i.start.x),a=Math.sign(t.maxX-i.start.x);return n!==o||n!==s||n!==a}}e.ScreenCollisions=p,e.ScreenCollisionsDebug=class extends p{constructor(t){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!=t&&(this.m_renderContext=t.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(t,e){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(t,e),null!==this.m_renderContext&&(this.m_renderContext.canvas.width=t,this.m_renderContext.canvas.height=e),this.m_renderingEnabled=o.debugContext.getValue("DEBUG_SCREEN_COLLISIONS")}allocate(t){super.allocate(t),this.m_numAllocations++,this.m_renderingEnabled&&null!==this.m_renderContext&&(this.m_renderContext.strokeStyle="#6666ff",this.m_renderContext.strokeRect(t.x-this.screenBounds.x,this.screenBounds.y+this.screenBounds.h-t.y,t.w,-t.h))}allocateIBoxes(t){for(const e of t)this.m_numAllocations++,this.m_renderingEnabled&&null!==this.m_renderContext&&(this.m_renderContext.strokeStyle="#aa2222",this.m_renderContext.strokeRect(e.minX-this.screenBounds.x,this.screenBounds.y+this.screenBounds.h-e.minY,e.maxX-e.minX,-(e.maxY-e.minY)));super.allocateIBoxes(t)}intersectsDetails(t,e){const i=super.intersectsDetails(t,e);if(this.m_renderingEnabled&&null!==this.m_renderContext){const e=i?2:1;this.m_renderContext.strokeStyle=i?"#FF0000":"#00ff00",this.m_renderContext.strokeRect(t.x-this.screenBounds.x-e,this.screenBounds.y+this.screenBounds.h-t.y+e,t.w+2*e,-t.h-2*e)}return i?this.m_numFailedTests++:this.m_numSuccessfulTests++,i}isVisible(t){const e=super.isVisible(t);return e?this.m_numSuccessfulVisibilityTests++:this.m_numFailedVisibilityTests++,e}}},8658:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.ScreenProjector=void 0;const r=i(5448),n=i(6815);function o(t){return t.z>-1&&t.z<1}class s{constructor(t){this.m_camera=t,this.m_width=0,this.m_height=0}get width(){return this.m_width}get height(){return this.m_height}project(t,e=new r.Vector2){const i=this.projectVector(t,s.tempV3);return this.ndcToScreen(i,e)}projectToScreen(t,e=new r.Vector2){const i=this.projectVector(t,s.tempV3);if(o(i))return this.ndcToScreen(i,e)}projectAreaToScreen(t,e,i,n=new r.Vector2){e*=2,i*=2;const a=this.projectVector(t,s.tempV3);if(o(a)&&a.x+e>=-1&&a.x-e<=1&&a.y+i>=-1&&a.y-i<=1)return this.ndcToScreen(a,n)}project3(t,e=new n.Vector3){const i=this.projectVector(t,s.tempV3);if(i.z>-1&&i.z<1)return e.set(i.x*this.m_width/2,i.y*this.m_height/2,i.z),e}projectVector(t,e){return e.set(t.x,t.y,t.z).project(this.m_camera),e}onScreen(t){return(e=this.projectVector(t,s.tempV3)).z>-1&&e.z<1&&e.x>=-1&&e.x<=1&&e.y>=-1&&e.y<=1;var e}update(t,e,i){this.m_camera=t,this.m_width=e,this.m_height=i}ndcToScreen(t,e){return e.set(t.x*this.m_width/2,t.y*this.m_height/2)}}e.ScreenProjector=s,s.tempV2=new r.Vector2,s.tempV3=new n.Vector3},7775:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SkyBackground=void 0;const r=i(3307),n=i(4257);e.SkyBackground=class{constructor(t,e,i){switch(this.m_sky=t,this.m_projectionType=e,this.m_sky.type){case"gradient":this.m_skyTexture=new n.SkyGradientTexture(this.m_sky,this.m_projectionType),this.updateCamera(i);break;case"cubemap":this.m_skyTexture=new r.SkyCubemapTexture(this.m_sky)}}dispose(){this.m_skyTexture.dispose()}get texture(){return this.m_skyTexture.texture}updateCamera(t){"gradient"===this.m_sky.type&&this.m_skyTexture.update(t)}updateTexture(t,e){const i=this.m_sky.type===t.type&&this.m_projectionType===e;switch(t.type){case"gradient":i?this.m_skyTexture.updateTexture(t):this.m_skyTexture=new n.SkyGradientTexture(t,e);break;case"cubemap":i?this.m_skyTexture.updateTexture(t):this.m_skyTexture=new r.SkyCubemapTexture(t)}this.m_projectionType=e,this.m_sky=t}}},3307:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SkyCubemapTexture=e.SkyCubemapFaceId=e.SKY_CUBEMAP_FACE_COUNT=void 0;const r=i(8497),n=i(862),o=i(4342).LoggerManager.instance.create("SkyCubemapTexture");var s;e.SKY_CUBEMAP_FACE_COUNT=6,function(t){t[t.positiveX=0]="positiveX",t[t.negativeX=1]="negativeX",t[t.positiveY=2]="positiveY",t[t.negativeY=3]="negativeY",t[t.positiveZ=4]="positiveZ",t[t.negativeZ=5]="negativeZ"}(s=e.SkyCubemapFaceId||(e.SkyCubemapFaceId={})),e.SkyCubemapTexture=class{constructor(t){const e=this.createCubemapFaceArray(t);this.m_skybox=void 0!==e?(new r.CubeTextureLoader).load(e):new n.CubeTexture}dispose(){this.m_skybox.dispose()}get texture(){return this.m_skybox}updateTexture(t){const e=this.createCubemapFaceArray(t);void 0!==e&&(this.m_skybox=(new r.CubeTextureLoader).load(e))}createCubemapFaceArray(t){const i=[void 0,void 0,void 0,void 0,void 0,void 0];for(let r=0;r<e.SKY_CUBEMAP_FACE_COUNT;++r){const e=t[s[r]];if(void 0===e)return void o.error(`Face "${s[r]}" was not defined.`);i[r]=e}return i}}},4257:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SkyGradientTexture=e.DEFAULT_MONOMIAL_POWER=e.DEFAULT_TEXTURE_SIZE=void 0;const r=i(6271),n=i(5971),o=i(414),s=i(3850),a=i(6815),l=i(862),c=i(7941),h=i(2616),u=i(4342);e.DEFAULT_TEXTURE_SIZE=512,e.DEFAULT_MONOMIAL_POWER=1;const p=[new a.Vector3(1,0,0),new a.Vector3(-1,0,0),new a.Vector3(0,-1,0),new a.Vector3(0,1,0),new a.Vector3(0,0,1),new a.Vector3(0,0,-1)],d=[new a.Vector3(0,0,-1),new a.Vector3(0,0,1),new a.Vector3(1,0,0),new a.Vector3(1,0,0),new a.Vector3(1,0,0),new a.Vector3(-1,0,0)],m=[new a.Vector3(0,1,0),new a.Vector3(0,1,0),new a.Vector3(0,0,1),new a.Vector3(0,0,-1),new a.Vector3(0,1,0),new a.Vector3(0,1,0)];e.SkyGradientTexture=class{constructor(t,i,u=e.DEFAULT_TEXTURE_SIZE){this.m_projectionType=i,this.m_height=u;const p=new n.Color(t.topColor),d=new n.Color(t.bottomColor),m=new n.Color(t.groundColor);this.m_width=this.m_projectionType===h.ProjectionType.Planar?1:this.m_height,this.m_faceCount=this.m_projectionType===h.ProjectionType.Planar?1:6,this.m_faces=[];for(let e=0;e<this.m_faceCount;++e){const i=new Uint8Array(4*this.m_width*this.m_height);this.fillTextureData(i,e,p,d,m,t.monomialPower);const n=new c.DataTexture(i,this.m_width,this.m_height,r.RGBAFormat);n.needsUpdate=!0,n.unpackAlignment=1,this.m_faces.push(n)}this.m_projectionType===h.ProjectionType.Spherical?(this.m_skybox=new l.CubeTexture(this.m_faces),this.m_skybox.needsUpdate=!0):(this.m_farClipPlaneDividedVertically=new o.Line3,this.m_groundPlane=new s.Plane(new a.Vector3(0,0,1)),this.m_bottomMidFarPoint=new a.Vector3,this.m_topMidFarPoint=new a.Vector3,this.m_horizonPosition=new a.Vector3,this.m_farClipPlaneCorners=[new a.Vector3,
2new a.Vector3,new a.Vector3,new a.Vector3])}dispose(){for(let t=0;t<this.m_faceCount;++t)this.m_faces[t].dispose();this.m_projectionType===h.ProjectionType.Spherical&&this.m_skybox.dispose()}get texture(){return this.m_projectionType===h.ProjectionType.Planar?this.m_faces[0]:this.m_skybox}update(t){this.m_projectionType===h.ProjectionType.Planar&&(this.setHorizonPosition(t),this.updateTexturePosition())}updateTexture(t){for(let e=0;e<this.m_faceCount;++e)this.fillTextureData(this.m_faces[e].image.data,e,new n.Color(t.topColor),new n.Color(t.bottomColor),new n.Color(t.groundColor),t.monomialPower),this.m_faces[e].needsUpdate=!0;this.m_projectionType===h.ProjectionType.Spherical&&(this.m_skybox.needsUpdate=!0)}fillTextureData(t,i,r,o,s,l){const c=new n.Color,f=new a.Vector3,g=new a.Vector3,y=new a.Vector3,v=new a.Vector3(0,0,1);for(let n=0;n<this.m_height;++n)for(let a=0;a<this.m_width;++a){if(this.m_projectionType===h.ProjectionType.Spherical){const t=g.copy(d[i]).multiplyScalar((a+.5)/this.m_width*2-1),h=y.copy(m[i]).multiplyScalar((n+.5)/this.m_height*2-1);f.copy(p[i]).add(t).add(h).normalize();const _=Math.max(v.dot(f),0);c.copy(s).lerp(o,Math.min(100*_,1)).lerp(r,_**(0,u.getOptionValue)(l,e.DEFAULT_MONOMIAL_POWER)).multiplyScalar(255)}else{const t=n/this.m_height;0===n?c.copy(s).multiplyScalar(255):c.copy(o).lerp(r,t**(0,u.getOptionValue)(l,e.DEFAULT_MONOMIAL_POWER)).multiplyScalar(255)}const _=4;t.set([c.r,c.g,c.b,255],n*this.m_width*_+a*_)}}setHorizonPosition(t){this.m_farClipPlaneCorners[0].set(-1,-1,1).unproject(t),this.m_farClipPlaneCorners[1].set(1,-1,1).unproject(t),this.m_farClipPlaneCorners[2].set(-1,1,1).unproject(t),this.m_farClipPlaneCorners[3].set(1,1,1).unproject(t),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 t=this.m_bottomMidFarPoint.distanceTo(this.m_horizonPosition)/this.m_farClipPlaneDividedVertically.distance(),e=0===this.m_horizonPosition.length()?1:t-2/this.m_height;this.m_faces[0].offset.set(0,this.m_bottomMidFarPoint.z<=0?-e:t)}}},3228:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SphereHorizon=e.previousCanvasSide=e.nextCanvasSide=e.CanvasSide=void 0;const r=i(8333),n=i(6815),o=i(2616),s=i(4342),a=i(4442),l=i(541),c=2*Math.PI;var h;function u(t){return(t+1)%4}!function(t){t[t.Bottom=0]="Bottom",t[t.Right=1]="Right",t[t.Top=2]="Top",t[t.Left=3]="Left"}(h=e.CanvasSide||(e.CanvasSide={})),e.nextCanvasSide=u,e.previousCanvasSide=function(t){return(t+3)%4},e.SphereHorizon=class{constructor(t,e){this.m_camera=t,this.m_cornerIntersects=e,this.m_intersections=[],this.m_isFullyVisible=!0;const i=o.EarthConstants.EQUATORIAL_RADIUS*o.EarthConstants.EQUATORIAL_RADIUS,s=(new n.Vector3).setFromMatrixColumn(t.matrixWorld,0).normalize(),a=t.position.clone().normalize(),c=(new n.Vector3).crossVectors(a,s),h=t.position.length();this.m_normalToTangentAngle=Math.asin(o.EarthConstants.EQUATORIAL_RADIUS/h);const u=Math.sqrt(h*h-i);this.m_distanceToHorizonCenter=u*Math.cos(this.m_normalToTangentAngle);const p=h-this.m_distanceToHorizonCenter;this.m_radius=Math.sqrt(i-p*p),this.m_cameraPitch=l.MapViewUtils.extractAttitude({projection:o.sphereProjection},this.m_camera).pitch;const d=(new n.Vector3).copy(a).setLength(p);this.m_matrix=(new r.Matrix4).makeBasis(s,c,a).setPosition(d),this.computeIntersections()}getPoint(t,e=0,i=1,r=new n.Vector3){const o=e*c,s=o+t*((i>=e?i*c:(i+1)*c)-o);return r.set(this.m_radius*Math.cos(s),this.m_radius*Math.sin(s),0),r.applyMatrix4(this.m_matrix),r}getDivisionPoints(t,e=0,i=1,r=10){const n=Math.max(Math.ceil(((i<e?1+i:i)-e)*r),1);for(let r=0;r<n;r++)t(this.getPoint(r/n,e,i))}get isFullyVisible(){return this.m_isFullyVisible}getSideIntersections(t){return this.m_intersections[t]}isTangentVisible(t){switch(t){case h.Top:{const t=this.m_normalToTangentAngle-this.m_cameraPitch;return a.CameraUtils.getTopFov(this.m_camera)>=Math.abs(t)}case h.Bottom:{const t=this.m_normalToTangentAngle+this.m_cameraPitch;return a.CameraUtils.getBottomFov(this.m_camera)>=Math.abs(t)}case h.Left:{const t=this.m_normalToTangentAngle;return a.CameraUtils.getLeftFov(this.m_camera)>=Math.abs(t)&&this.m_cameraPitch<=a.CameraUtils.getBottomFov(this.m_camera)}case h.Right:{const t=this.m_normalToTangentAngle;return a.CameraUtils.getRightFov(this.m_camera)>=Math.abs(t)&&this.m_cameraPitch<=a.CameraUtils.getBottomFov(this.m_camera)}}}getTangentOnSide(t){switch(t){case h.Bottom:return.75;case h.Right:return 0;case h.Top:return.25;case h.Left:return.5}}computeIntersections(){const t=this.m_distanceToHorizonCenter*Math.tan(this.m_cameraPitch-a.CameraUtils.getBottomFov(this.m_camera));let e,i;for(let r=h.Bottom;r<4;r++){if(this.isTangentVisible(r)){this.m_intersections.push([this.getTangentOnSide(r)]);continue}const n=new Array;switch(this.m_isFullyVisible=!1,r){case h.Bottom:n.push(...this.computeTBIntersections(t));break;case h.Right:{const r=a.CameraUtils.getRightFov(this.m_camera),o=this.computeLRIntersections(t,r);o&&([e,i]=o,n.push(void 0!==i?1+i:void 0,e));break}case h.Top:{const t=this.m_distanceToHorizonCenter*Math.tan(this.m_cameraPitch+a.CameraUtils.getTopFov(this.m_camera));n.push(...this.computeTBIntersections(t).reverse());break}case h.Left:{const r=a.CameraUtils.getLeftFov(this.m_camera);if(r===a.CameraUtils.getRightFov(this.m_camera))n.push(void 0!==e?.5-e:void 0,void 0!==i?.5-i:void 0);else{const e=this.computeLRIntersections(t,r);e&&n.push(.5-e[0],void 0!==e[1]?.5-e[1]:void 0)}break}}const o=[this.m_cornerIntersects[r],this.m_cornerIntersects[u(r)]];this.m_intersections.push(n.filter((t,e)=>void 0!==t&&!o[e]))}}computeTBIntersections(t){const e=this.m_radius*this.m_radius,i=Math.sqrt(e-t*t),r=Math.atan2(t,i)/c;return[.5-r,r>0?r:1+r]}computeLRIntersections(t,e){const i=this.m_distanceToHorizonCenter/Math.cos(this.m_cameraPitch),r=this.m_distanceToHorizonCenter*Math.tan(this.m_cameraPitch),n=i*Math.tan(e),o=a.
2CameraUtils.getBottomFov(this.m_camera),l=n*(this.m_distanceToHorizonCenter*Math.cos(o)/Math.cos(this.m_cameraPitch-o))/i,h=s.Math2D.intersectLineAndCircle(l,t,n,r,this.m_radius);if(!h)return;const u=h.y1;return[Math.atan2(u,h.x1)/c,-u>=t&&void 0!==h.x2?Math.atan2(h.y2,h.x2)/c:void 0]}}},7284:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SphereViewBounds=e.computeEdgeDivisions=void 0;const r=i(5448),n=i(6815),o=i(2616),s=i(4342),a=i(3228),l=i(541);function c(t,e){const i=Math.abs(e.latitude-t.latitude),r=t.minLongitudeSpanTo(e);return Math.ceil(Math.max(i/20,r/5))}e.computeEdgeDivisions=c;const h=[{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}];e.SphereViewBounds=class{constructor(t,e){this.camera=t,this.projection=e,(0,s.assert)(e.type===o.ProjectionType.Spherical)}generate(){const t=this.findBoundsIntersections();return this.wrapAroundPoles(t),t.length>2?new o.GeoPolygon(t,!1,!0):void 0}addSideSegmentSubdivisions(t,e,i,n,o){t.push(n);const s=c(n,o);if(s<=1)return;const a=new r.Vector2(i.x-e.x,i.y-e.y).multiplyScalar(1/s),h=new r.Vector2(e.x,e.y);for(let e=0;e<s-1;e++){h.add(a);const e=l.MapViewUtils.rayCastWorldCoordinates({camera:this.camera,projection:this.projection},h.x,h.y);e&&t.push(this.projection.unprojectPoint(e))}}addSideIntersections(t,e,i,r,n){const o=h[e],l=h[(0,a.nextCanvasSide)(e)];if(i&&r)return void this.addSideSegmentSubdivisions(t,o,l,i,r);if(!n)return;const c=n.getSideIntersections(e);if(0!==c.length){if(i){const e=n.getPoint(c[c.length-1]),r=this.projection.unprojectPoint(e);this.addSideSegmentSubdivisions(t,o,e.project(this.camera),i,r)}else{const i=(0,a.previousCanvasSide)(e);let r=n.getSideIntersections(i);0===r.length&&(r=n.getSideIntersections((0,a.previousCanvasSide)(i))),(0,s.assert)(r.length>0),n.getDivisionPoints(e=>{t.push(this.projection.unprojectPoint(e))},r[r.length-1],c[0])}if(c.length>1){const e=n.getPoint(c[0]),i=n.getPoint(c[1]),r=this.projection.unprojectPoint(e),o=this.projection.unprojectPoint(i);this.addSideSegmentSubdivisions(t,e.project(this.camera),i.project(this.camera),r,o)}if(r){const e=n.getPoint(c[0]),i=this.projection.unprojectPoint(e);this.addSideSegmentSubdivisions(t,e.project(this.camera),l,i,r)}}}findBoundsIntersections(){const t=[],[e,i]=this.addCanvasCornerIntersection(),r=i<4?new a.SphereHorizon(this.camera,e.map(t=>void 0!==t)):void 0;if(0===i&&r.isFullyVisible)return r.getDivisionPoints(e=>{t.push(this.projection.unprojectPoint(e))}),t;for(let i=a.CanvasSide.Bottom;i<4;i++){const n=e[i],o=e[(0,a.nextCanvasSide)(i)];this.addSideIntersections(t,i,n,o,r)}return t}wrapAroundPoles(t){const e=new n.Vector3(0,0,o.EarthConstants.EQUATORIAL_RADIUS),i=new n.Vector3(0,0,-o.EarthConstants.EQUATORIAL_RADIUS),r=l.MapViewUtils.closeToFrustum(e,this.camera),s=l.MapViewUtils.closeToFrustum(i,this.camera);if(!r&&!s)return;const a=this.projection.unprojectPoint(this.camera.position).lng,c=r?90:-90,h=r?a+180:a-180,u=new o.GeoCoordinates(c,h),p=u.normalized(),d=p.lng;let m=t[t.length-1].lng,f=!1;const g=t.findIndex(t=>{const e=(0,o.isAntimeridianCrossing)(m,t.lng);return Math.sign(d-t.lng)===Math.sign(d-m)===e?(f=e,!0):(m=t.lng,!1)});if(g<0)return;const y=r?90:-90,v=r?1e-5:-1e-5,_=new o.GeoCoordinates(c,a+y).normalized(),b=new o.GeoCoordinates(c,a).normalized(),x=new o.GeoCoordinates(c,a-y).normalized(),w=new o.GeoCoordinates(c,h+v).normalized(),S=t[(g+t.length-1)%t.length],T=t[g];let E=o.GeoCoordinates.lerp(S,T,.01,f);f&&r?E.longitude-=360:E=E.normalized(),t.splice(g,0,h<-180?u:p,_,b,x,w,E)}addCanvasCornerIntersection(){const t=new Array;let e=0;return h.forEach(i=>{const r=l.MapViewUtils.rayCastWorldCoordinates({camera:this.camera,projection:this.projection},i.x,i.y);r?(t.push(this.projection.unprojectPoint(r)),++e):t.push(void 0)}),[t,e]}}},8015:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PerformanceStatistics=e.FrameStatsArray=e.FrameStats=e.Statistics=e.MultiStageTimer=e.computeArrayAverage=e.computeArrayStats=e.SampledTimer=e.SimpleTimer=e.RingBuffer=void 0;const r=i(4342),n=r.LoggerManager.instance.create("Statistics");class o{constructor(t){this.capacity=t,this.buffer=new Array(t),this.capacity=t,this.head=this.tail=this.size=0}clear(){this.head=this.tail=this.size=0}enqOne(t){let e=this.head+1;e>=this.capacity&&(e=0),this.size<this.capacity&&this.size++,this.buffer[this.head]=t,this.head=e,this.size===this.capacity&&(this.tail=this.head)}enq(...t){for(const e of t)this.enqOne(e)}deq(){if(0===this.size)throw new Error("Ringbuffer underrun");const t=this.buffer[this.tail];let e=this.tail+1;return e>=this.capacity&&(e=0),this.size>0&&this.size--,this.tail=e,t}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 t=this.head-1;return t<0&&(t=this.capacity-1),this.buffer[t]}iterator(){return new o.Iterator(this)}asArray(){const t=new Array;for(let e=0;e<this.size;e++)t.push(this.buffer[(this.tail+e)%this.capacity]);return t}}e.RingBuffer=o,function(t){t.Iterator=class{constructor(t,e=0){this.m_buffer=t,this.m_index=e}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}}}(o=e.RingBuffer||(e.RingBuffer={}));class s{constructor(t,e){this.statistics=t,this.name=e,this.running=!1}get value(){return this.m_currentValue}setValue(t){this.m_currentValue=t}reset(){this.m_currentValue=void 0}
2start(){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=r.PerformanceTimer.now()}stop(){var t;if(!this.statistics.enabled)return-1;if(this.running){const e=r.PerformanceTimer.now()-(null!==(t=this.m_currentValue)&&void 0!==t?t:0);return this.m_currentValue=e,this.setValue(e),this.running=!1,e}throw new Error("Timer '"+this.name+"' has not been started")}now(){var t;if(!this.statistics.enabled)return-1;if(this.running)return r.PerformanceTimer.now()-(null!==(t=this.m_currentValue)&&void 0!==t?t:0);throw new Error("Timer '"+this.name+"' has not been started")}}e.SimpleTimer=s;class a extends s{constructor(t,e){super(t,e),this.statistics=t,this.name=e,this.numResets=0,this.maxNumSamples=1e3,this.samples=new o(this.maxNumSamples)}reset(){super.reset(),this.getStats(),this.samples.clear(),this.numResets++}setValue(t){super.setValue(t),void 0!==t&&this.samples.enqOne(t)}getStats(){return l(this.samples.asArray())}}function l(t){if(0===t.length)return;t.sort((t,e)=>t-e);const e=t[0],i=t[t.length-1];let r,n,o,s,a,l,c;if(1===t.length)n=o=s=a=l=c=r=t[0];else if(2===t.length)r=.5*t[0]+.5*t[1],n=o=s=a=l=c=t[1];else{const e=Math.floor(t.length/2);r=t.length%2==0?.5*t[e-1]+.5*t[e]:t[e],n=t[Math.round(.75*t.length)-1],o=t[Math.round(.9*t.length)-1],s=t[Math.round(.95*t.length)-1],a=t[Math.round(.97*t.length)-1],l=t[Math.round(.99*t.length)-1],c=t[Math.round(.999*t.length)-1]}let h=0;for(let e=0,i=t.length;e<i;e++)h+=t[e];return{min:e,max:i,avg:h/t.length,median:r,median75:n,median90:o,median95:s,median97:a,median99:l,median999:c,numSamples:t.length}}e.SampledTimer=a,e.computeArrayStats=l,e.computeArrayAverage=function(t){if(0===t.length)return;let e=0;for(let i=0,r=t.length;i<r;i++)e+=t[i];return e/t.length},e.MultiStageTimer=class{constructor(t,e,i){if(this.statistics=t,this.name=e,this.stages=i,i.length<1)throw new Error("MultiStageTimer needs stages");i.forEach(e=>{if(!t.hasTimer(e))throw new Error("Unknown timer: "+e)})}get value(){return this.statistics.getTimer(this.stages[this.stages.length-1]).value}
2reset(){this.statistics.enabled&&this.stages.forEach(t=>{this.statistics.getTimer(t).reset()})}start(){var t;return this.stage=this.stages[0],null!==(t=this.statistics.getTimer(this.stages[0]).value)&&void 0!==t?t:-1}stop(){return this.stage=void 0,void 0!==this.value?this.value:-1}get stage(){return this.currentStage}set stage(t){this.currentStage!==t&&(this.statistics.enabled&&void 0!==this.currentStage&&this.statistics.getTimer(this.currentStage).stop(),this.currentStage=t,this.statistics.enabled&&void 0!==this.currentStage&&this.statistics.getTimer(this.currentStage).start())}},e.Statistics=class{constructor(t,e=!1){this.name=t,this.enabled=e,this.timers=new Map,this.nullTimer=new s(this,"<null>")}createTimer(t,e=!0){const i=e?new a(this,t):new s(this,t);return this.addTimer(i)}addTimer(t){if(void 0!==this.timers.get(t.name))throw new Error("Duplicate timer name: '"+t.name+"'");return this.timers.set(t.name,t),t}getTimer(t){if(!this.enabled)return this.nullTimer;const e=this.timers.get(t);return void 0===e?this.nullTimer:e}hasTimer(t){return void 0!==this.timers.get(t)}reset(){this.timers.forEach(t=>{t.reset()})}log(t,e){void 0===t&&void 0===this.name||n.log(void 0!==t?t:this.name);let i=0;this.timers.forEach(t=>{i=Math.max(i,t.name.length)});const r=t=>void 0!==t?t.toFixed(5):"?";this.timers.forEach(t=>{let e=t.name+": "+" ".repeat(i-t.name.length);if(e+=r(t.value),t instanceof a){const i=t.getStats();void 0!==i&&(e+=` [ min=${r(i.min)}, max=${r(i.max)}, avg=${r(i.avg)}, med=${r(i.median)}, med95=${r(i.median95)}, med99=${r(i.median99)}, N=${r(i.numSamples)} ]`)}n.log(e)}),void 0!==e&&n.log(e)}};class c{constructor(){this.entries=new Map,this.messages=void 0}getValue(t){return this.entries.get(t)}setValue(t,e){this.entries.set(t,e)}addValue(t,e){const i=this.entries.get(t);this.entries.set(t,e+(void 0===i?0:i))}addMessage(t){void 0===this.messages&&(this.messages=[]),this.messages.push(t)}reset(){this.entries.forEach((t,e)=>{this.entries.set(e,0)}),this.messages=void 0}}e.FrameStats=c;class h{constructor(t=0){this.capacity=t,this.frameEntries=new Map,this.messages=new o(t)}get length(){return this.messages.size}reset(){this.frameEntries.forEach((t,e)=>{t.clear()}),this.messages.clear()}addFrame(t){const e=this.length,i=this.frameEntries;t.entries.forEach((t,r)=>{let n=i.get(r);if(void 0===n){n=new o(this.capacity);for(let t=0;t<e;t++)n.enqOne(0);this.frameEntries.set(r,n)}n.enqOne(t)}),this.messages.enq(t.messages)}log(){let t=0;this.frameEntries.forEach((e,i)=>{t=Math.max(t,i.length)});const e=t=>void 0!==t?t.toFixed(5):"?";this.frameEntries.forEach((i,r)=>{let o=r+": "+" ".repeat(t-r.length);const s=l(i.asArray());void 0!==s&&(o+=` [ min=${e(s.min)}, max=${e(s.max)}, avg=${e(s.avg)}, med=${e(s.median)}, med95=${e(s.median95)}, med99=${e(s.median99)}, N=${e(s.numSamples)} ]`),n.log(o)})}}e.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(t=!0,e=1e3){this.enabled=t,this.maxNumFrames=e,this.currentFrame=new c,this.appResults=new Map,this.configs=new Map,u.m_instance=this,this.m_frameEvents=new h(e)}clear(){this.clearFrames(),this.configs.clear(),this.appResults.clear()}clearFrames(){this.m_frameEvents.reset(),this.currentFrame.reset()}addWebGLInfo(t){void 0!==t.render&&(this.currentFrame.setValue("gl.numCalls",null===t.render.calls?0:t.render.calls),this.currentFrame.setValue("gl.numPoints",null===t.render.points?0:t.render.points),this.currentFrame.setValue("gl.numLines",null===t.render.lines?0:t.render.lines),this.currentFrame.setValue("gl.numTriangles",null===t.render.triangles?0:t.render.triangles)),void 0!==t.memory&&(this.currentFrame.setValue("gl.numGeometries",null===t.memory.geometries?0:t.memory.geometries),this.currentFrame.setValue("gl.numTextures",null===t.memory.textures?0:t.memory.textures)),void 0!==t.programs&&this.currentFrame.setValue("gl.numPrograms",null===t.programs?0:t.programs.length)}addMemoryInfo(){if(void 0!==window&&void 0!==window.performance){const t=window.performance.memory;void 0!==t&&(this.currentFrame.setValue("memory.totalJSHeapSize",t.totalJSHeapSize),this.currentFrame.setValue("memory.usedJSHeapSize",t.usedJSHeapSize),this.currentFrame.setValue("memory.jsHeapSizeLimit",t.jsHeapSizeLimit))}}storeAndClearFrameInfo(){return!(this.m_frameEvents.length>=this.maxNumFrames||(this.m_frameEvents.addFrame(this.currentFrame),this.currentFrame.reset(),0))}log(t,e){n.log(void 0!==t?t:"PerformanceStatistics"),this.appResults.forEac
2h((t,e)=>{n.log(e,t)}),this.configs.forEach((t,e)=>{n.log(e,t)}),this.m_frameEvents.log(),void 0!==e&&n.log(e)}getAsPlainObject(t=!1){const e={},i={},r={},n={configs:i,appResults:e,frames:r};if(this.appResults.forEach((t,i)=>{e[i]=t}),this.configs.forEach((t,e)=>{i[e]=t}),t)for(const[t,e]of this.m_frameEvents.frameEntries)r[t]=e.bottom;else for(const[t,e]of this.m_frameEvents.frameEntries)r[t]=e.asArray();return n.messages=this.m_frameEvents.messages.asArray(),n}getLastFrameStatistics(){return this.getAsPlainObject(!0)}getAsSimpleFrameStatistics(t=!1){const e=new Map,i=new Map,r=new Map,n={configs:e,appResults:i,frames:r,messages:this.m_frameEvents.messages.asArray()};if(this.appResults.forEach((t,e)=>{i.set(e,t)}),this.configs.forEach((t,i)=>{e.set(i,t)}),t)for(const[t,e]of this.m_frameEvents.frameEntries)r.set(t,e.bottom);else for(const[t,e]of this.m_frameEvents.frameEntries)r.set(t,e.asArray());return n}}e.PerformanceStatistics=u,u.m_instance=void 0},1797:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextureLoader=void 0;const r=i(6271),n=i(642);e.TextureLoader=class{constructor(){this.m_textureLoader=new n.TextureLoader}async load(t,e,i,n=!0){if(void 0===e)return await this.loadWithThreeLoader(t);const o=await fetch(t,{headers:e,signal:i,mode:n?"cors":"no-cors"}),s=await o.blob(),a=await this.loadWithThreeLoader(URL.createObjectURL(s));return a.format=r.RGBAFormat,a}loadWithThreeLoader(t){return new Promise((e,i)=>{this.m_textureLoader.setCrossOrigin(""),this.m_textureLoader.load(t,t=>e(t),void 0,()=>i(new Error("failed to load texture")))})}}}
2,5640:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createLight=e.toTextureFilter=e.toWrappingMode=e.toTextureDataType=e.toPixelFormat=void 0;const r=i(6271),n=i(9191),o=i(4307),s=i(3334),a=i(2616);e.toPixelFormat=function(t){switch(t){case"Alpha":return r.AlphaFormat;case"RGBA":return r.RGBAFormat;case"Luminance":return r.LuminanceFormat;case"LuminanceAlpha":return r.LuminanceAlphaFormat;case"Depth":return r.DepthFormat;case"DepthStencil":return r.DepthStencilFormat;case"Red":return r.RedFormat;default:throw new Error(`invalid pixel format: ${t}`)}},e.toTextureDataType=function(t){switch(t){case"UnsignedByte":return r.UnsignedByteType;case"Byte":return r.ByteType;case"Short":return r.ShortType;case"UnsignedShort":return r.UnsignedShortType;case"Int":return r.IntType;case"UnsignedInt":return r.UnsignedIntType;case"Float":return r.FloatType;case"HalfFloat":return r.HalfFloatType;default:throw new Error(`invalid texture data type: ${t}`)}},e.toWrappingMode=function(t){switch(t){case"clamp":return r.ClampToEdgeWrapping;case"repeat":return r.RepeatWrapping;case"mirror":return r.MirroredRepeatWrapping;default:throw new Error(`invalid wrapping mode: ${t}`)}},e.toTextureFilter=function(t){switch(t){case"nearest":return r.NearestFilter;case"nearestMipMapNearest":return r.NearestMipMapNearestFilter;case"nearestMipMapLinear":return r.NearestMipMapLinearFilter;case"linear":return r.LinearFilter;case"linearMipMapNearest":return r.LinearMipMapNearestFilter;case"linearMipMapLinear":return r.LinearMipMapLinearFilter;default:throw new Error(`invalid texture filter: ${t}`)}},e.createLight=function(t){switch(t.type){case"ambient":{const e=new n.AmbientLight(t.color,t.intensity);return e.name=t.name,e}case"directional":{const e=new o.DirectionalLight(t.color,t.intensity);return e.name=t.name,void 0!==t.castShadow&&(e.castShadow=t.castShadow),e.castShadow&&(e.shadow.bias=1e-5,e.shadow.mapSize.width=1024,e.shadow.mapSize.height=1024),function(t,e){if((0,a.isVector3Like)(e.direction)){const{x:i,y:r,z:n}=e.direction;t.position.set(i,r,n)}else{const[i,r]=e.direction.map(t=>(0,s.degToRad)(t)),n=Math.cos(r);t.position.set(Math.sin(i)*n,Math.cos(i)*n,Math.sin(r))}t.position.normalize()}(e,t),e}}}},6586:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isThemeLoaded=e.load=e.DEFAULT_MAX_THEME_INHERITANCE_DEPTH=void 0,i(6892);const r=i(8775),n=i(2616),o=i(1984),s=i(4342),a=i(3307);function l(t){if(t instanceof Object)if(t instanceof Array)if("literal"===t[0])t[2]=o.ObjectLiteralExpr.nextID;else{let e=t.length;for(;e--;)l(t[e])}else for(const e in t)l(t[e])}e.DEFAULT_MAX_THEME_INHERITANCE_DEPTH=4,e.load=async function(t,e){var i;const r=new s.ContextLogger(null!==(i=null==e?void 0:e.logger)&&void 0!==i?i:console,`when processing Theme ${"string"==typeof t?t:t.url}:`),n=await u(t,r,Object.assign(Object.assign({},e),{resolveLightDefinitions:!0}));return function(t,e){const i=new Map,r=new Map;t.forEach((t,e)=>{const r=t.id;r&&i.set(r,e)});const n=new Set,o=new Set;t.forEach((s,a)=>{try{b(s,a,t,i,r,o,e)}catch(t){o.forEach(n.add,n)}finally{o.clear()}});let s=t.length;for(;s--;){const e=t[s].id;(t[s].when===x||e&&n.has(e))&&t.splice(s,1)}}((0,o.getStyles)(n.styles),r),l(n),n};const c=/^((?!PaxHeader).)*\/(?!\._)[^/]+.json$/,h=/^((?!PaxHeader).)*\/(?!\._)[^/]+.svg$/;async function u(t,i,n){var a,l,m;if(n=null!=n?n:{},"string"==typeof t){const e=null!==(l=null===(a=n.uriResolver)||void 0===a?void 0:a.resolveUri(t))&&void 0!==l?l:t,o=await fetch(e,{signal:n.signal});if(!o.ok)throw new Error(`ThemeLoader#load: cannot load theme: ${o.statusText}`);if(e.endsWith("json"))t=await o.json();else{if(!e.endsWith("tar.gz"))throw new Error(`ThemeLoader#load: cannot load theme: from ${e}. Format unsupported`);{const s=await r.parseTar(await o.arrayBuffer()),a=null===(m=s.find(t=>c.test(t.name)))||void 0===m?void 0:m.text;if(!a)throw new Error(`ThemeLoader#load: cannot load theme: from ${e}`);t=await u(JSON.parse(a),i,n),s.length>0&&t.assets&&s.forEach(e=>{h.test(e.name)&&(t.assets[e.name.replace(/^.*\//,"")]={url:`data:image/svg+xml;base64,${btoa(e.text)}`,preload:!1})})}}t.url=e,t=p(t,n)}else void 0===t.url&&(t.url=(0,s.getAppBaseUrl)(),t=p(t,n));if(t.styles=(0,o.getStyles)(t.styles),null==t)throw new Error("ThemeLoader#load: loaded resource is not val
2id JSON");return t=await async function(t,i,r){if(r=null!=r?r:{},void 0===i.extends)return i;const n=(0,s.getOptionValue)(r.maxInheritanceDepth,e.DEFAULT_MAX_THEME_INHERITANCE_DEPTH);if(n<=0)throw new Error("maxInheritanceDepth reached when attempting to load base theme");const a=Array.isArray(i.extends)?i.extends:[i.extends];delete i.extends;let l={};for(const e of a){let i,s;(0,o.isConditionalExtendsEntry)(e)?(i=e.value,s=e.when):i=e,l=E(await u(i,t,Object.assign(Object.assign({},r),{resolveLightDefinitions:!1,maxInheritanceDepth:n-1})),l,s)}const c=E(i,l);return c.features=function(t){var e;const i={};if(t)for(const r in t){const n=t[r];if(null!==n){const o={},s=null===(e=t[r])||void 0===e?void 0:e.modes;for(const t in s)null!==s[t]&&(o[t]=s[t]);i[r]={defaultMode:n.defaultMode,modes:o}}}return i}(c.features),c}(i,t,n),(0,s.getOptionValue)(n.resolveLightDefinitions,!0)&&void 0!==t.lights&&(i.pushAttr("lights"),t.lights=function(t,e,i){const r=[];for(let n=0;n<t.length;++n){i.pushIndex(n);const o=d(t[n],e,i);void 0!==o?r.push(o):i.warn("invalid light, ignored"),i.pop()}return r}(t.lights,t.definitions,i),i.pop()),t}function p(t,e){if(void 0===t.url)return t;if(t.base){const i=`${t.base.style}/${t.base.scheme}.json`,r=null==e?void 0:e.baseUrl;t.extends=void 0!==r?(0,s.resolveReferenceUri)(r,i):i}const i={resolveUri(i){var r,n;const o=null!==(n=null===(r=null==e?void 0:e.uriResolver)||void 0===r?void 0:r.resolveUri(i))&&void 0!==n?n:i;return o!==i?o:(0,s.resolveReferenceUri)(t.url,i)}};return t.extends&&(t.extends=(Array.isArray(t.extends)?t.extends:[t.extends]).map(r=>{let n;if("string"==typeof r)n=i.resolveUri(r);else if((0,o.isConditionalExtendsEntry)(r)){n=r;let o=r.value;"string"==typeof o?o=i.resolveUri(o):void 0===o.url&&(o.url=t.url,o=p(o,e)),n.value=o}else void 0!==r.url?n=r:(r.url=t.url,n=p(r,e));return n})),!1!==(null==e?void 0:e.resolveResourceUris)&&function(t,e){if(t.sky&&"cubemap"===t.sky.type)for(let i=0;i<a.SKY_CUBEMAP_FACE_COUNT;++i){const r=t.sky[a.SkyCubemapFaceId[i]];void 0!==r&&(t.sky[a.SkyCubemapFaceId[i]]=e.resolveUri(r))}if(t.assets)for(const i of Object.values(t.assets))i.url=e.resolveUri(i.url),void 0!==i.atlas&&(i.atlas=e.resolveUri(i.atlas));if(t.fontCatalogs)for(const i of t.fontCatalogs)i.url=e.resolveUri(i.url);if(void 0!==t.styles)for(const i of(0,o.getStyles)(t.styles))i.attr&&["map","normalMap","displacementMap","roughnessMap"].forEach(t=>{const r=i.attr[t];r&&"string"==typeof r&&(i.attr[t]=e.resolveUri(r))})}(t,i),t}function d(t,e,i){const r=m(t.color,e,i);if(void 0===r)return;t.color=r;const s=m(t.intensity,e,i);if(void 0!==s){if(t.intensity=s,(0,o.isDirectionalLight)(t)&&!(0,n.isVector3Like)(t.direction)){const r=t.direction.map(t=>m(t,e,i));if(r.some(t=>void 0===t))return;t.direction=r}return t}}function m(t,e,i){let r=!1;const n=function t(n){if((0,o.isJsonExprReference)(n)){const t=n[1],s=e&&e[t];return void 0===s?(i.warn(`invalid reference '${t}' - not found`),void(r=!0)):(0,o.isJsonExpr)(s)?s:(0,o.getDefinitionValue)(s)}if(Array.isArray(n)){const e=[...n];for(let i=1;i<e.length;++i)e[i]=t(e[i]);return e}return n}(t);if(!r)return n}function f(t,e,i){let r;if(void 0!==i&&void 0!==t){r=Object.assign({},e);for(const e of Object.keys(t)){const n=r[e],s=t[e];let a;(0,o.isJsonExpr)(n)&&"case"===n[0]?(a=n.slice(),a.splice(1,0,i,s)):a=["case",i,s,void 0===n?null:n],r[e]=a}}else r=Object.assign(Object.assign({},e),t);return r}function g(t,e){var i,r,n;let o;if(void 0!==t){o=Object.assign({},e);for(const e in t){const a=o[e],l=t[e];if((s=a)&&s.modes&&s.defaultMode)if(null===l)o[e]=null;else{a.defaultMode=l.defaultMode||"none";for(const t in l.modes){let e=null===(i=a.modes)||void 0===i?void 0:i[t];const o=null===(r=l.modes)||void 0===r?void 0:r[t];null===o&&"none"!==t?void 0!==e&&(a.modes[t]=null):(e=(n=a.modes)[t]||(n[t]={}),(null==o?void 0:o.disabledLayers)&&(e.disabledLayers=null==o?void 0:o.disabledLayers),(null==o?void 0:o.disabledStyleRules)&&(e.disabledStyleRules=null==o?void 0:o.disabledStyleRules),(null==o?void 0:o.extendedDefinitions)&&(e.extendedDefinitions=Object.assign(Object.assign({},e.extendedDefinitions),null==o?void 0:o.extendedDefinitions)))}}else o[e]=l}}else o=Object.assign(Object.assign({},e),t||{});var s;return o}function y(t,e,i){t&&t.forEach(t=>{var r;const n=t.id;if(n){if((null!==(r=i.get(n))&&void 0!==r?r:-1)>=0)return;i.set(n,e.length)}
2e.push(t)})}function v(t,e,i){var r;if((0,o.isJsonExpr)(t)){if(1===t.length&&"base-attribute-value"===t[0])return null!==(r=null==i?void 0:i[e])&&void 0!==r?r:null;let n=t.length;for(;n--;)t[n]=v(t[n],e,i)}return t}function _(t,e,i){if(t){i=null!=i?i:t;for(const r in t)i[r]=v(t[r],r,e)}}function b(t,e,i,r,n,o,s){var a;const l=t.extends;if(!l)return void _(t.attr,void 0);const c=t.id;c&&o.add(c);const h=null!==(a=r.get(l))&&void 0!==a?a:-1,u=i[h],p=t.technique,d=o.has(l),m=d?`circular dependency detected during the theme loading ${[...o].concat([l]).join(" â ")}`:h<0?`id "${l}" not found.`:p&&p!==u.technique?`extending style rule "${null!=c?c:""}" has a different technique from the base rule "${l}".`:"";if(m){const e=`Invalid style "extends": ${m}`;if(s.warn(e),delete t.extends,d)throw new Error(e);return void _(t.attr,void 0)}b(u,h,i,r,n,o,s);const f=Object.assign(Object.assign({},u),t),g=u.attr,y=t.attr;g&&y&&(f.attr=Object.assign(Object.assign({},g),y)),y&&_(y,g,f.attr),t.id||delete f.id,t.when||delete f.when;const v=function(t,e,i,r){let n,o=t.when;if(o===x)n=r.get(i);else{if(n=S(o,i,r),e){const t=["!",w(e)?[...e]:e];o?w(o)?o.push(t):o=["all",o,t]:o=t}else o=x;t.when=o}return n}(u,t.when,l,n);!function(t,e,i,r){const n=T(t,e);n&&S(n,i,r,!0)}(f,v,c,n),delete f.extends,i.splice(e,1,f)}e.isThemeLoaded=function(t){return void 0===t.extends&&!(0,o.isStylesDictionary)(t.styles)};const x=["!",!0];function w(t){return(0,o.isJsonExpr)(t)&&"all"===t[0]}function S(t,e,i,r=!1){let n;return e&&(n=i.get(e),!t||!r&&i.has(e)||(n=[...t],i.set(e,n))),n}function T(t,e){let i=t.when;if(i){if(e){const t=w(e),r=w(i);t&&r?i.splice(1,0,...e.slice(1)):t?i=[...e,i]:r?i.splice(1,0,e):i=["all",e,i]}}else e&&(i=[...e]);return i&&(t.when=i),i}function E(t,e,i){const r=(0,o.getStyles)(e.styles),n=(0,o.getStyles)(t.styles),s=[],a=new Map;return y(r,s,a),y(n,s,a),i&&n.forEach(t=>{T(t,i)}),Object.assign(Object.assign(Object.assign({},e),t),{assets:Object.assign(Object.assign({},e.assets),t.assets),definitions:f(t.definitions,e.definitions,i),features:g(t.features,e.features),styles:s})}},1447:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Tile=e.getFeatureDataSize=void 0;const r=i(6815),n=i(394),o=i(2616),s=i(5562),a=i(4342),l=i(6473),c=i(7987),h=i(1335),u=i(7013),p=i(3922),d=i(1406),m=i(3977),f=i(8015),g=a.LoggerManager.instance.create("Tile");e.getFeatureDataSize=function(t){let e=100;return void 0!==t.starts&&(e+=8*t.starts.length),void 0!==t.objInfos&&(e+=16*t.objInfos.length),e},e.Tile=class{constructor(t,e,i=0,n){this.dataSource=t,this.tileKey=e,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 o.OrientedBox3,this.m_disposed=!1,this.m_forceHasGeometry=void 0,this.m_iconTextGroups=new u.IconTextGroupPriorityList,this.m_pathBlockingElements=[],this.m_worldCenter=new r.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!=n&&n,this.m_textStyleCache=new p.TileTextStyleCache(this),this.m_offset=i,this.m_uniqueKey=o.TileKeyUtils.getKeyForTileKeyAndOffset(this.tileKey,this.offset),t.useGeometryLoader&&(this.m_tileGeometryLoader=new h.TileGeometryLoader(this),this.attachGeometryLoadedCallback())}get isVisible(){try{return this.frameNumLastRequested>=this.dataSource.mapView.frameNumber-1}catch(t){return g.debug(t),!1}}set isVisible(t){this.frameNumLastRequested=t?this.dataSource.mapView.frameNumber:-1,t||!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(t){this.m_offset!==t&&(this.m_uniqueKey=o.TileKeyUtils.getKeyForTileKeyAndOffset(this.tileKey,t)),this.m_offset=t}getResourceInfo(){return void 0===this.m_resourceInfo&&this.computeResourceInfo(),this.m_resourceInfo}invalidateResourceInfo(){this.m_resourceInfo=void 0}
2addIconText(t){this.iconTextGroups.add(t),this.iconTextsChanged=!0}addBlockingElement(t){this.m_pathBlockingElements.push(t)}get iconTextGroups(){return this.m_iconTextGroups}get iconTextsChanged(){var t;return null!==(t=this.m_iconTextsChanged)&&void 0!==t&&t}set iconTextsChanged(t){this.m_iconTextsChanged=t}hasIconTexts(){return this.m_iconTextGroups.count()>0}get blockingElements(){return this.m_pathBlockingElements}willRender(t){return!this.skipRendering&&!this.delayRendering}didRender(){}get visibleArea(){return this.m_visibleArea}set visibleArea(t){this.m_visibleArea=t,void 0!==this.tileLoader&&(this.tileLoader.priority=t)}get elevationRange(){return this.m_elevationRange}set elevationRange(t){var e;t.minElevation===this.m_elevationRange.minElevation&&t.maxElevation===this.m_elevationRange.maxElevation&&t.calculationStatus===this.m_elevationRange.calculationStatus||(this.m_elevationRange.minElevation=t.minElevation,this.m_elevationRange.maxElevation=t.maxElevation,this.m_elevationRange.calculationStatus=t.calculationStatus,this.elevateGeoBox(),void 0===this.m_maxGeometryHeight&&void 0===this.m_minGeometryHeight||((0,a.assert)(void 0===(null===(e=this.decodedTile)||void 0===e?void 0:e.boundingBox)),this.updateBoundingBox()))}get decodedTile(){return this.m_decodedTile}set decodedTile(t){var e,i;if(this.m_decodedTile=t,this.invalidateResourceInfo(),void 0===t)return;0===t.geometries.length&&this.forceHasGeometry(!0),this.m_maxGeometryHeight=t.boundingBox?void 0:null!==(e=t.maxGeometryHeight)&&void 0!==e?e:0,this.m_minGeometryHeight=t.boundingBox?void 0:null!==(i=t.minGeometryHeight)&&void 0!==i?i:0,this.elevateGeoBox(),this.updateBoundingBox(t.boundingBox);const r=f.PerformanceStatistics.instance;r.enabled&&void 0!==t.decodeTime&&(r.currentFrame.addValue("decode.decodingTime",t.decodeTime),r.currentFrame.addValue("decode.decodedTiles",1)),void 0!==t.copyrightHolderIds&&(this.copyrightInfo=t.copyrightHolderIds.map(t=>({id:t}))),this.dataSource.requestUpdate()}get disposed(){return this.m_disposed}get allGeometryLoaded(){var t,e;return null!==(e=null===(t=this.m_tileGeometryLoader)||void 0===t?void 0:t.isFinished)&&void 0!==e?e:this.hasGeometry}get hasGeometry(){return void 0===this.m_forceHasGeometry?0!==this.objects.length:this.m_forceHasGeometry}forceHasGeometry(t){this.m_forceHasGeometry=t}resetVisibilityCounter(){this.visibilityCounter=-1}get tileLoader(){return this.m_tileLoader}set tileLoader(t){this.m_tileLoader=t}async load(t){const e=this.tileLoader;if(void 0===e)return await Promise.resolve();if(this.m_tileGeometryLoader){const t=this.m_tileGeometryLoader.isSettled;this.m_tileGeometryLoader.reset(),t&&this.attachGeometryLoadedCallback()}return!0===t&&e.cancel(),await e.loadAndDecode().then(t=>{var i;(0,a.assert)(t===d.TileLoaderState.Ready);const r=e.decodedTile;this.decodedTile=r,null===(i=null==r?void 0:r.dependencies)||void 0===i||i.forEach(t=>{this.dependencies.push(o.TileKey.fromMortonCode(t))})}).catch(t=>{t===d.TileLoaderState.Failed?this.dispose():t!==d.TileLoaderState.Canceled&&g.error("Unknown error"+t)})}get textStyleCache(){return this.m_textStyleCache}clear(){const t=t=>{var e;Object.getOwnPropertyNames(t).forEach(e=>{const i=t[e];i instanceof n.Texture&&i.dispose()}),(0,s.needsCanvasSize)(t)&&(null===(e=t.onResizeTarget)||void 0===e||e.removeEventListener(m.MapViewEventNames.Resize,t.onResizeListener),delete t.onResizeListener,delete t.onResizeTarget),t.dispose()},e=e=>{var i,r;null===(i=e.geometry)||void 0===i||i.dispose();for(const t of null!==(r=e.geometries)&&void 0!==r?r:[])t.dispose();e.material instanceof Array?e.material.forEach(e=>{void 0!==e&&t(e)}):e.material&&t(e.material)};this.objects.forEach(t=>{t.traverse(t=>{e(t)}),e(t)}),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(t=>{t.dispose()}),this.iconTextGroups.clear())}addDisposeCallback(t){this.m_disposeCallback=(0,a.chainCallbacks)(this.m_disposeCallback,t)}dispose(){var t;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===(t=this.m_tileGeometryLoader)||void 0===t||t.dis
2pose(),this.m_disposeCallback&&this.m_disposeCallback(this))}computeWorldOffsetX(){return this.projection.worldExtent(0,0).max.x*this.offset}update(t){for(const e of this.objects)e instanceof l.LodMesh&&e.setLevelOfDetail(t-this.tileKey.level)}get boundingBox(){return this.m_boundingBox}updateGeometry(t){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!==t&&(this.m_tileGeometryLoader.priority=t),this.m_tileGeometryLoader.update(),!0}loadingFinished(){}attachGeometryLoadedCallback(){(0,a.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(t){t?(this.m_boundingBox.copy(t),this.m_worldCenter.copy(this.boundingBox.position)):this.projection.projectBox(this.geoBox,this.boundingBox)}elevateGeoBox(){var t,e;this.geoBox.southWest.altitude=this.m_elevationRange.minElevation+(null!==(t=this.m_minGeometryHeight)&&void 0!==t?t:0),this.geoBox.northEast.altitude=this.m_elevationRange.maxElevation+(null!==(e=this.m_maxGeometryHeight)&&void 0!==e?e:0)}computeResourceInfo(){let t=0,e=0;const i={heapSize:0,gpuSize:0},r=new Map;for(const t of this.objects)t.visible&&e++,c.Object3DUtils.estimateSize(t,i,r);const n=this.iconTextGroups.count();t+=312*n,void 0!==this.m_decodedTile&&void 0!==this.m_decodedTile.tileInfo&&(i.heapSize+=this.m_decodedTile.tileInfo.numBytes),this.m_resourceInfo={heapSize:i.heapSize+t,gpuSize:i.gpuSize,num3dObjects:e,numIconTexts:n,numUserIconTexts:0}}}},9780:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TileObjectRenderer=void 0;const r=i(8152),n=i(1984),o=i(8023),s=i(5863),a=i(8673),l=i(4572);e.TileObjectRenderer=class{constructor(t,e){this.m_env=t,this.m_renderer=e,this.m_renderOrderStencilValues=new Map,this.m_stencilValue=1}render(t,e,i,r,n){const o=t.computeWorldOffsetX();if(t.willRender(e)){for(const e of t.objects){const s=l.MapObjectAdapter.get(e);this.processTileObject(t,i,e,s)&&(this.updateStencilRef(e),e.position.copy(t.center),void 0!==e.displacement&&e.position.add(e.displacement),e.position.x+=o,e.position.sub(r),t.localTangentSpace&&e.setRotationFromMatrix(t.boundingBox.getRotationMatrix()),e.frustumCulled=!1,n.add(e))}t.didRender()}}prepareRender(){this.m_stencilValue=1,this.m_renderOrderStencilValues.clear()}setupRenderer(){const t=(t,e)=>{const i=l.MapObjectAdapter.get(t.object),r=l.MapObjectAdapter.get(e.object);return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:(null==i?void 0:i.tileKey)&&(null==r?void 0:r.tileKey)&&i.tileKey.mortonCode()!==r.tileKey.mortonCode()?i.tileKey.mortonCode()-r.tileKey.mortonCode():t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id};this.m_renderer.setOpaqueSort((e,i)=>{var r,o,a,c;const h=l.MapObjectAdapter.get(e.object),u=l.MapObjectAdapter.get(i.object),p=null===(r=null==h?void 0:h.dataSource)||void 0===r?void 0:r.dataSourceOrder,d=null===(o=null==u?void 0:u.dataSource)||void 0===o?void 0:o.dataSourceOrder;if(void 0!==p&&void 0!==d&&p!==d)return p-d;if(e.renderOrder===s.BackgroundDataSource.GROUND_RENDER_ORDER||i.renderOrder===s.BackgroundDataSource.GROUND_RENDER_ORDER)return t(e,i);if(h&&u){const r=null===(a=h.tileKey)||void 0===a?void 0:a.level,o=null===(c=u.tileKey)||void 0===c?void 0:c.level;if(void 0!==r&&void 0!==o){const s=void 0!==h.technique&&(0,n.isExtrudedPolygonTechnique)(h.technique)||void 0!==u.technique&&(0,n.isExtrudedPolygonTechnique)(u.technique);return r===o||s?t(e,i):r-o}}return t(e,i)})}updateStencilRef(t){if(void 0!==t.renderOrder&&t instanceof a.SolidLineMesh){const e=t.material;
2Array.isArray(e)?e.forEach(e=>e.stencilRef=this.getStencilValue(t.renderOrder)):e.stencilRef=this.getStencilValue(t.renderOrder)}}allocateStencilValue(t){const e=this.m_stencilValue++;return this.m_renderOrderStencilValues.set(t,e),e}getStencilValue(t){var e;return null!==(e=this.m_renderOrderStencilValues.get(t))&&void 0!==e?e:this.allocateStencilValue(t)}processTileObject(t,e,i,r){return!(!i.visible||!this.processTileObjectFeatures(t,e,i)||r&&(r.update(t.mapView),!r.isVisible()&&r.pickability!==n.Pickability.all))}processTileObjectFeatures(t,e,i){var s,a;const c=i.userData,h=l.MapObjectAdapter.get(i);if(!h)return!1;const u=h.technique,p=(0,r.getPropertyValue)(null==u?void 0:u.minZoomLevel,this.m_env),d=(0,r.getPropertyValue)(null==u?void 0:u.maxZoomLevel,this.m_env);if("number"==typeof p&&e<p)return!1;if("number"==typeof d&&e>=d)return!1;if(void 0===(null==u?void 0:u.visible))return!0;const m=c.feature;if(!m||!o.Expr.isExpr(u.visible))return Boolean((0,r.getPropertyValue)(u.visible,this.m_env));const{starts:f,objInfos:g}=m;if(!Array.isArray(g)||!Array.isArray(f))return!0;const y=i.geometry;if(!y||!y.isBufferGeometry)return!0;const v=null!==(a=null===(s=y.getIndex())||void 0===s?void 0:s.count)&&void 0!==a?a:y.attributes.position.count;let _;return y.clearGroups(),g.forEach((e,i)=>{var s,a;const l=(0,r.getFeatureId)(e);let c=!0;if(o.Expr.isExpr(u.visible)){const i=t.dataSource.getFeatureState(l),o=i?new n.MapEnv(i):null,s="object"==typeof e?new n.MapEnv(e,this.m_env):this.m_env,a=new n.MapEnv({$state:o},s);c=Boolean((0,r.getPropertyValue)(u.visible,a))}if(!c)return;const h=null!==(s=f[i])&&void 0!==s?s:0,p=(null!==(a=f[i+1])&&void 0!==a?a:v)-h;h===_?y.groups[y.groups.length-1].count+=p:y.addGroup(h,p),_=h+p}),y.groups.length>0}}},541:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TileOffsetUtils=e.MapViewUtils=void 0;const r=i(2479),n=i(3216),o=i(2754),s=i(3334),a=i(8333),l=i(3850),c=i(9747),h=i(5381),u=i(5448),p=i(6815),d=i(2616),m=i(5610),f=i(4342),g=i(4442),y=i(7987),v=f.LoggerManager.instance.create("MapViewUtils"),_=new p.Vector3(0,0,1),b=new l.Plane(_.clone()),x=new h.Sphere(void 0,m.EarthConstants.EQUATORIAL_RADIUS),w=new n.Raycaster,S={x:new p.Vector3,y:new p.Vector3,z:new p.Vector3},T={x:new p.Vector3,y:new p.Vector3,z:new p.Vector3},E={box3:[new o.Box3],obox3:[new d.OrientedBox3],quaternions:[new c.Quaternion,new c.Quaternion],vector2:[new u.Vector2,new u.Vector2],vector3:[new p.Vector3,new p.Vector3,new p.Vector3,new p.Vector3],matrix4:[new a.Matrix4,new a.Matrix4],transforms:[{xAxis:new p.Vector3,yAxis:new p.Vector3,zAxis:new p.Vector3,position:new p.Vector3}]},M=new r.PerspectiveCamera;var A;!function(t){function e(e,i,r,n,o,a){var l,c,h;const u=g.CameraUtils.getPrincipalPoint(e.camera,E.vector2[0]),m=t.rayCastWorldCoordinates(e,u.x,u.y);if(null===m)return;let f;if("number"==typeof i)f=E.vector2[1].set(i,r);else{const t=i;f=null!==(l=t.center)&&void 0!==l?l:u,n=null!==(c=t.deltaAzimuth)&&void 0!==c?c:0,o=null!==(h=t.deltaTilt)&&void 0!==h?h:0,a=t.maxTiltAngle}const y=f.x===u.x&&f.y===u.y?m:t.rayCastWorldCoordinates(e,f.x,f.y);if(null===y)return;!function(t,e,i){const r=t.camera,n=t.projection.surfaceNormal(e,E.vector3[0]),o=E.quaternions[0].setFromAxisAngle(n,i);r.quaternion.premultiply(o),r.position.sub(e),r.position.applyQuaternion(o),r.position.add(e)}(e,y,-n);const _=new p.Vector3(1,0,0).applyQuaternion(e.camera.quaternion),b=function(t,e,i,r,n,o,a){const l=t.camera,c=t.projection,h=C(c,l,n,a);if(h+i<0)return-h;if(i<=0)return i;if(n.equals(o)||e<0)return(0,s.clamp)(i+h,0,r)-h;const u=C(c,l,o,a),p=(0,s.degToRad)(89);if(u>p)return 0;let m=0;if(c===d.sphereProjection){const t=c.surfaceNormal(o,E.vector3[0]).projectOnPlane(a).normalize(),e=c.surfaceNormal(n,E.vector3[1]);m=t.angleTo(e)}const f=(0,s.degToRad)(90),g=f+m-(2*f-(2*f-(f+m-u+(f+h)))-f-r);return(0,s.clamp)(i+u,0,Math.min(g,p))-u}(e,f.y-u.y,o,a,m,y,_);!function(e,i,r,n){const o=e.camera,s=o.position.clone(),a=o.quaternion.clone(),l=E.quaternions[0].setFromAxisAngle(n,r);o.quaternion.premultiply(l),o.position.sub(i),o.position.applyQuaternion(l),o.position.add(i),null===t.rayCastWorldCoordinates(e,0,0)&&(v.warn("Target got invalidated during rotation."),o.position.copy(s),o.quaternion.copy(a))}(e,y,b,_)}function i(t,e,i){const r=E.vector3[0].copy(t.position),n=t.getWorldDirection(E.vector3[1]);w.set(r,n),void 0!==i&&(b.constant-=i,x.radius+=i);const o=new p.Vector3,s=e.type===d.ProjectionType.Planar?w.ray.intersectPlane(b,o):w.ray.intersectSphere(x,o);return void 0!==i&&(b.constant=0,x.radius=m.EarthConstants.EQUATORIAL_RADIUS),s}function r(e,i,r){const n={target:e,distance:i},o=r.worldMaxBounds,s=r.camera,a=r.projection;if(!o)return n;const l=o.getSize(E.vector3[1]),c=r.renderer.getSize(E.vector2[0]),h=g.CameraUtils.convertScreenToWorldSize(r.focalLength,n.distance,c.height),u=h*s.aspect,m=Math.max(u/l.x,h/l.y),f=new p.Vector3(u/2,h/2,0),y={target:n.target.clone(),distance:n.distance};if(a.type===d.ProjectionType.Planar){if(m>1)y.distance/=m,s.getWorldDirection(s.position).multiplyScalar(-y.distance).add(o.getCenter(y.target));else{if(E.box3[0].copy(o).expandByVector(f.multiplyScalar(-1)).clampPoint(n.target,y.target).setZ(n.target.z),y.target.equals(n.target))return n;s.position.x+=y.target.x-n.target.x,s.position.y+=y.target.y-n.target.y}return y}if(m>1)o.getCenter(y.target),y.target.setLength(n.target.length()),y.distance/=m;else{const t=E.obox3[0];t.copy(o),t.position.setLength(n.target.length()),t.extents.sub(f);const e=t.getRotationMatrix(E.matrix4[0]),i=E.vector3[1].copy(y.target).sub(t.position).applyMatrix4(E.matrix4[1].copy(e).transpose()).setZ(0),r=E.vector3[2].copy(i).clamp(E.vector3[3].copy(t.extents).multiplyScalar(-1),t.extents);if(r.equals(i))return n;y.target.copy(r).applyMatrix4(e).add(t.position);const s=t.position.lengthSq(),a=y.target.distanceToSquared(t.position),l=Math.sqrt(s)-Math.sqrt(s-a);y.target.addScaledVector(t.zAxis,-l),y.target.setLength(n.target.length())}return t.panCameraAroundGlobe(r,E.vector3[1].copy(y.target),E.vector3[2].copy(n.target)),s.getWorldDirection(s.position).multiplyScalar(-y.distance).add(y.target),y}function n(t,e,i,r,n,o=new p.Vector3){const a=(0,s.degToRad)(r),l=Math.cos(a)*e,c=(0,s.degToRad)(i);n.projectPoint(t,o);const h=e*Math.sin(a);if(n.type===d.ProjectionType.Planar)o.x=o.x+Math.sin(c)*h,o.y=o.y-Math.cos(c)*h,o.z=o.z+l;else if(n.type===d.ProjectionType.Spherical){T.z.copy(o).normalize(),T.y.set(0,0,1).projectOnPlane(T.z).normalize(),E.quaternions[0].setFromAxisAngle(T.z,c-Math.PI),T.y.applyQuaternion(E.quaternions[0]),T.y.set
2Length(h);const t=e*Math.cos(a);o.add(T.y).add(T.z.setLength(t));const i=m.EarthConstants.EQUATORIAL_RADIUS+l,r=Math.sin(a)*e,n=Math.sqrt(i*i+r*r);o.setLength(n)}return o}function o(t,e,i,r){const n=E.vector3[0].set(e,i,0);t.camera.updateMatrixWorld();const o=E.vector3[1].copy(t.camera.position);E.matrix4[0].extractRotation(t.camera.matrixWorld),E.matrix4[1].multiplyMatrices(E.matrix4[0],E.matrix4[1].copy(t.camera.projectionMatrix).invert());const s=n.applyMatrix4(E.matrix4[1]);w.set(o,s.normalize()),void 0!==r&&(b.constant-=r,x.radius+=r);const a=new p.Vector3,l=t.projection.type===d.ProjectionType.Planar?w.ray.intersectPlane(b,a):w.ray.intersectSphere(x,a);return void 0!==r&&(b.constant=0,x.radius=m.EarthConstants.EQUATORIAL_RADIUS),l}function a(t,e,i){t.camera.position.x+=e,t.camera.position.y+=i}function l(t,e,i){E.quaternions[0].setFromUnitVectors(e.normalize(),i.normalize()).invert(),E.matrix4[0].makeRotationFromQuaternion(E.quaternions[0]),t.camera.applyMatrix4(E.matrix4[0]),t.camera.updateMatrixWorld()}function h(t,e,i,r,n=new c.Quaternion){const o=E.transforms[0];return t.localTangentSpace(e,o),E.matrix4[0].makeBasis(o.xAxis,o.yAxis,o.zAxis),n.setFromRotationMatrix(E.matrix4[0]),E.quaternions[0].setFromAxisAngle(E.vector3[1].set(0,0,1),(0,s.degToRad)(i)),E.quaternions[1].setFromAxisAngle(E.vector3[1].set(1,0,0),(0,s.degToRad)(r)),n.multiply(E.quaternions[0]),n.multiply(E.quaternions[1]),n}function _(e,i){if(i.type===d.ProjectionType.Planar){const t=e.getWorldDirection(E.vector3[0]).normalize(),r=i.surfaceNormal(e.position,E.vector3[1]).negate(),n=t.dot(r);return Math.acos((0,s.clamp)(n,-1,1))}{(0,f.assert)(i.type===d.ProjectionType.Spherical);const r=t.getGeoTargetFromCamera(e,i);return null!==r?t.extractTiltAngleFromLocation(i,e,r):(v.warn("MapView camera is pointing in the void, using maxTilt: ",t.MAX_TILT_RAD),t.MAX_TILT_RAD)}}function A(t,e){E.vector3[1].setFromMatrixPosition(e.matrixWorld),t.projection.localTangentSpace(E.vector3[1],{xAxis:T.x,yAxis:T.y,zAxis:T.z,position:E.vector3[0]}),E.matrix4[1].makeBasis(T.x,T.y,T.z),E.matrix4[0].copy(E.matrix4[1]).invert().multiply(e.matrixWorld),S.x.setFromMatrixColumn(E.matrix4[0],0),S.y.setFromMatrixColumn(E.matrix4[0],1),S.z.setFromMatrixColumn(E.matrix4[0],2);let i=0,r=0,n=0;const o=S.z.dot(E.vector3[1].set(0,0,1));return o<1-Number.EPSILON?o>-1+Number.EPSILON?(i=Math.atan2(S.z.x,-S.z.y),r=Math.acos(S.z.z),n=Math.atan2(S.x.z,S.y.z)):(i=-Math.atan2(-S.y.x,S.x.x),r=180,n=0):(i=Math.atan2(-S.y.x,S.x.x),r=0,n=0),{yaw:i,pitch:r,roll:n}}function C(t,e,i,r){t.localTangentSpace(i,{xAxis:T.x,yAxis:T.y,zAxis:T.z,position:E.vector3[0]});const n=E.vector3[2].copy(e.position).sub(E.vector3[0]);r&&(n.projectOnPlane(r),T.z.projectOnPlane(r).normalize());const o=n.length();if(o<1e-5)return v.error("Can not calculate tilt for the zero length vector!"),0;n.divideScalar(o);const a=n.dot(T.z);return a>=1-Number.EPSILON?0:Math.acos((0,s.clamp)(a,-1,1))}function P(t,e){const i=m.EarthConstants.EQUATORIAL_CIRCUMFERENCE/Math.pow(2,e);return t.focalLength*i/256}t.MAX_TILT_DEG=89,t.MAX_TILT_RAD=t.MAX_TILT_DEG*s.DEG2RAD,t.zoomOnTargetPosition=function(i,n,s,c,h=t.MAX_TILT_RAD){const{elevationProvider:u,camera:p,projection:m}=i,f=u?u.getHeight(m.unprojectPoint(p.position),4):void 0,g=o(i,n,s,f),y=t.getTargetAndDistance(m,p,u).target,v=P(i,c);if(i.geoMaxBounds&&r(y,v,i).distance!==v)return c>=i.zoomLevel;if(p.getWorldDirection(p.position).multiplyScalar(-v).add(y),m.type===d.ProjectionType.Spherical){const t=_(p,m)-h;t>0&&e(i,{deltaTilt:t,maxTiltAngle:h})}const b=o(i,n,s,f);return!g||!b||(m.type===d.ProjectionType.Planar?(g.sub(b),a(i,g.x,g.y)):m.type===d.ProjectionType.Spherical&&l(i,g,b),!0)},t.orbitAroundScreenPoint=e,t.getGeoTargetFromCamera=function(t,e,r){const n=i(t,e,r);return null!==n?e.unprojectPoint(n):null},t.getWorldTargetFromCamera=i,t.constrainTargetAndDistanceToViewBounds=r,t.getTargetAndDistance=function(e,r,n){const o=A({projection:e},r).pitch,s=n?n.getHeight(e.unprojectPoint(r.position),4):void 0,a=!n||void 0!==s,l=o<t.MAX_TILT_RAD?i(r,e,s):null;if(null!==l)return{target:l,distance:r.position.distanceTo(l),final:a};{const i=e.groundDistance(r.position),n=Math.max(i-(null!=s?s:0),0),l=e.type===d.ProjectionType.Planar?n/Math.cos(Math.min(o,t.MAX_TILT_RAD)):Math.sqrt(Math.pow(n+m.E
2arthConstants.EQUATORIAL_RADIUS,2)-Math.pow(m.EarthConstants.EQUATORIAL_RADIUS,2)),c=r.getWorldDirection(E.vector3[0]);c.multiplyScalar(l);const h=E.vector3[1];return h.copy(r.position).add(c),{target:h,distance:l,final:a}}},t.getCameraPositionFromTarget=n,t.wrapGeoPointsToScreen=function(t,e){let i=0;void 0===e&&(e=d.GeoCoordinates.fromObject(t[0]),i=1);let r=e.latitude,n=e.latitude,o=d.MathUtils.normalizeLongitudeDeg(e.longitude),s=0,a=e.longitude,l=e.longitude;const c=[];c.push(new d.GeoCoordinates(r,o));for(let e=i;e<t.length;e++){const i=d.GeoCoordinates.fromObject(t[e]);i.latitude>r?r=i.latitude:i.latitude<n&&(n=i.latitude);let h=d.MathUtils.normalizeLongitudeDeg(i.longitude);const u=d.MathUtils.angleDistanceDeg(o,h);h=o-u,u<0&&-u>s/2?(a=Math.max(a,o-u),s=a-l,o=(a+l)/2):u>0&&u>s/2&&(l=Math.min(l,h),s=a-l,o=(a+l)/2),c.push(new d.GeoCoordinates(i.latitude,h))}return c},t.wrapWorldPointsToView=function(t,e){const i=e.clone().normalize();for(const r of t)if(r.angleTo(e)>Math.PI/2){const t=r.length();r.projectOnPlane(i).setLength(t)}},t.geoBoxToGeoPoints=function(t){const e=t.center;return[new d.GeoCoordinates(t.north,t.west),new d.GeoCoordinates(t.north,t.east),new d.GeoCoordinates(e.latitude,t.west),new d.GeoCoordinates(e.latitude,t.east),new d.GeoCoordinates(t.south,t.west),new d.GeoCoordinates(t.south,t.east),new d.GeoCoordinates(t.north,e.longitude),new d.GeoCoordinates(t.south,e.longitude)]},t.getCameraCoordinatesFromTargetCoordinates=function(t,e,i,r,o){return o.projection.unprojectPoint(n(t,e,i,r,o.projection,E.vector3[1]))},t.rayCastWorldCoordinates=o,t.panCameraAboveFlatMap=a,t.panCameraAroundGlobe=l,t.rotate=function(e,i,r=0,n=Math.PI/4){if(e.camera.rotateOnWorldAxis(e.projection.type===d.ProjectionType.Spherical?E.vector3[0].copy(e.camera.position).normalize():E.vector3[0].set(0,0,1),(0,s.degToRad)(-i)),e.camera.updateMatrixWorld(),0===r)return;const o=t.extractAttitude(e,e.camera).pitch;let a=(0,s.clamp)(o+(0,s.degToRad)(r),0,n);if(e.projection.type===d.ProjectionType.Spherical){const t=Math.asin(m.EarthConstants.EQUATORIAL_RADIUS*Math.sin(Math.PI-n)/e.camera.position.length());a=Math.min(a,t)}e.camera.rotateX(a-o)},t.getCameraRotationAtTarget=h,t.setRotation=function(t,e,i){h(t.projection,t.geoCenter,e,i,t.camera.quaternion)},t.extractCameraTilt=_,t.extractAttitude=A,t.extractSphericalCoordinatesFromLocation=function(t,e,i){t.projection.localTangentSpace(i,{xAxis:T.x,yAxis:T.y,zAxis:T.z,position:E.vector3[0]});let r=0,n=0;return E.vector3[1].copy(e.position).sub(E.vector3[0]).normalize(),E.vector3[1].dot(T.z)>1-Number.EPSILON?(n=Math.PI-A(t,e).yaw,n=Math.atan2(Math.sin(n),Math.cos(n)),r=0,{tilt:r,azimuth:n}):(r=E.vector3[1].angleTo(T.z),E.vector3[1].copy(e.position).sub(E.vector3[0]).projectOnPlane(T.z).normalize(),n=E.vector3[1].angleTo(T.y),E.vector3[1].cross(T.y).dot(T.z)<0&&(n=-n),{tilt:r,azimuth:n})},t.extractTiltAngleFromLocation=C,t.getCameraFrustumPlanes=function(t){const e=t.near,i=t.far;let r=e*Math.tan((0,s.degToRad)(.5*t.fov))/t.zoom,n=2*r,o=t.aspect*n,a=-.5*o;const l=t.view;if(null!==l&&l.enabled){const t=l.fullWidth,e=l.fullHeight;a+=l.offsetX*o/t,r-=l.offsetY*n/e,o*=l.width/t,n*=l.height/e}return a+=0!==t.filmOffset?e*t.filmOffset/t.getFilmWidth():0,{left:a,right:a+o,top:r,bottom:r-n,near:e,far:i}},t.rayCastGeoCoordinates=function(t,e,i){const r=o(t,e,i);return r?t.projection.unprojectPoint(r):null},t.calculateDistanceToGroundFromZoomLevel=function(t,e){const i=A(t,t.camera).pitch,r=m.EarthConstants.EQUATORIAL_CIRCUMFERENCE/Math.pow(2,e);return t.focalLength*r/256*Math.cos(i)},t.calculateDistanceFromZoomLevel=P,t.calculateZoomLevelFromDistance=function(t,e){const i=256*e/t.focalLength;return function(t){const e=Math.ceil(t);return e-t<1e-6?e:t}((0,s.clamp)(Math.log2(m.EarthConstants.EQUATORIAL_CIRCUMFERENCE/i),t.minZoomLevel,t.maxZoomLevel))},t.calculateDepthFromClipDistance=function(t,e){const i=e,r=i.far-i.near,n=t*i.far;return(1-i.near/n)*(i.far/r)},t.cameraToWorldDistance=function(t,e){return t*e.far},t.calculateVerticalFovByHorizontalFov=function(t,e){return 2*Math.atan(Math.tan(t/2)/e)},t.calculateHorizontalFovByVerticalFov=function(t,e){return M.fov=(0,s.radToDeg)(t),M.aspect=e,g.CameraUtils.getHorizontalFov(M)},t.calculateFocalLengthByVerticalFov=function(t,e){return g.CameraUtils.setPrincipalPoint(M,new u.Vector2),g.CameraUtils.setVerticalFov(M,t,e),g.CameraUtils.getFocalLength(M)},t.calculateFovByFocalLength=function(t,e){return g.CameraUtils.setPrincipalPoint(M,new u.Vector2),g.CameraUtils.setFocalLength(M,t,e),M.fov},t.calculateScreenSizeByFocalLength=g.CameraUtils.convertWorldToScreenSize,t.calculateWorldSizeByFocalLength=g.CameraUtils.convertScreenToWorldSize,t.estimateObject3dSize=y.Object3DUtils.estimateSize,t.mapViewIsLoading=function(t){let e=0;for(const i of t.visibleTileSet.dataSourceTileList){e+=i.numTilesLoading;
2for(const t of i.visibleTiles)t.allGeometryLoaded||e++}let i=e>0;return void 0!==t.iconTextRenderer&&(i=i||t.iconTextRenderer.loading),i=i||!t.visibleTileSet.allVisibleTilesLoaded,i},t.closeToFrustum=function(t,e,i=1e-13){const r=(new p.Vector3).copy(t).project(e);return Math.abs(r.x)-i<1&&Math.abs(r.y)-i<1&&Math.abs(r.z)-i<1},t.getBrowserLanguages=f.DOMUtils.getBrowserLanguages}(e.MapViewUtils||(e.MapViewUtils={})),(A=e.TileOffsetUtils||(e.TileOffsetUtils={})).getKeyForTileKeyAndOffset=d.TileKeyUtils.getKeyForTileKeyAndOffset,A.extractOffsetAndMortonKeyFromKey=d.TileKeyUtils.extractOffsetAndMortonKeyFromKey,A.getParentKeyFromKey=d.TileKeyUtils.getParentKeyFromKey},5008:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VisibleTileSet=e.ResourceComputationType=void 0;const r=i(2479),n=i(2616),o=i(8263),s=i(4342),a=i(5863),l=i(8502);var c,h;!function(t){t[t.EstimationInMb=0]="EstimationInMb",t[t.NumberOfTiles=1]="NumberOfTiles"}(c=e.ResourceComputationType||(e.ResourceComputationType={})),function(t){t[t.NONE=0]="NONE",t[t.UP=1]="UP",t[t.DOWN=2]="DOWN",t[t.BOTH=3]="BOTH"}(h||(h={}));const u=1/1048576;class p{static getKey(t,e,i){return`${i.name}_${t}_${e}`}static getKeyForTile(t){return p.getKey(t.tileKey.mortonCode(),t.offset,t.dataSource)}constructor(t,e=c.EstimationInMb){this.m_disposedTiles=[],this.m_resourceComputationType=e,this.m_tileCache=new o.LRUCache(t,t=>this.m_resourceComputationType===c.EstimationInMb?t.memoryUsage*u:1),this.m_tileCache.evictionCallback=(t,e)=>{void 0!==e.tileLoader&&e.tileLoader.cancel(),this.m_disposedTiles.push(e)},this.m_tileCache.canEvict=(t,e)=>!e.isVisible}get resourceComputationType(){return this.m_resourceComputationType}get capacity(){return this.m_tileCache.capacity}get size(){return this.m_tileCache.size}setCapacity(t,e){this.m_resourceComputationType=e,this.m_tileCache.setCapacityAndMeasure(t,t=>this.m_resourceComputationType===c.EstimationInMb?t.memoryUsage*u:1)}get(t,e,i){return this.m_tileCache.get(p.getKey(t,e,i))}set(t,e,i,r){this.m_tileCache.set(p.getKey(t,e,i),r)}delete(t){const e=p.getKeyForTile(t);this.deleteByKey(e)}deleteByKey(t){this.m_tileCache.delete(t)}disposeTiles(){this.m_disposedTiles.forEach(t=>{t.dispose()}),this.m_disposedTiles.length=0}shrinkToCapacity(){this.m_tileCache.shrinkToCapacity()}evictAll(){this.m_tileCache.evictAll()}evictSelected(t){this.m_tileCache.evictSelected(t)}forEach(t,e){this.m_tileCache.forEach((i,r)=>{void 0!==e&&i.dataSource!==e||t(i,r)})}}const d=(t,e)=>{const i=t.distance-e.distance,r=1e-6*(t.distance+e.distance);return Math.abs(i)<r?t.tileKey.mortonCode()-e.tileKey.mortonCode():i};e.VisibleTileSet=class{constructor(t,e,i){var n;this.m_frustumIntersection=t,this.m_tileGeometryManager=e,this.options=i,this.dataSourceTileList=[],this.allVisibleTilesLoaded=!1,this.m_cameraOverride=new r.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!==(n=this.options.maxTilesPerFrame)&&void 0!==n?n:0),this.m_resourceComputationType=void 0===i.resourceComputationType?c.EstimationInMb:i.resourceComputationType,this.m_dataSourceCache=new p(this.options.tileCacheSize,this.m_resourceComputationType)}getDataSourceCacheSize(){return this.options.tileCacheSize}setDataSourceCacheSize(t,e=c.EstimationInMb){this.options.tileCacheSize=t,this.resourceComputationType=e}getNumberOfVisibleTiles(){return this.options.maxVisibleDataSourceTiles}setNumberOfVisibleTiles(t){this.options.maxVisibleDataSourceTiles=t}get maxTilesPerFrame(){return this.options.maxTilesPerFrame}set maxTilesPerFrame(t){if(t<0)throw new Error("Invalid value, this will result in no tiles ever showing");this.options.maxTilesPerFrame=Math.floor(t)}get resourceComputationType(){return this.m_resourceComputationType}set resourceComputationType(t){this.m_resourceComputationType=t,this.m_dataSourceCache.setCapacity(this.options.tileCacheSize,t)}updateClipPlanes(t,e){void 0!==t&&(this.options.clipPlanesEvaluator.maxElevation=t),void 0!==e&&(this.options.clipPlanesEvaluator.minElevation=e);const{camera:i,projection:r,elevationProvider:n}=this.m_frustumIntersection.mapView;return this.m_viewRange=this.options.clipPlanesEvaluator.evaluateClipPlanes(i,r,n),this.m_viewRange}updateRenderList(t,e,i,r,n){let o=!0;const a=this.getVisibleTileKeysForDataSources(e,i,n);this.dataSourceTileList=[],this.m_coveringMap.clear();for(const{dataSource:i,visibleTileKeys:n}of a.tileKeys){n.sort(d);const s=i.getDataZoomLevel(e),a=this.processVisibleTiles(n,i,r,{newTilesPerFrame:0},!0),l=this.processVisibleTiles(a.dependentTiles,i,r,{newTilesPerFrame:0},!1);this.m_tileGeometryManager.updateTiles(a.visibleTiles),this.m_tileGeometryManager.updateTiles(l.visibleTiles),this.dataSourceTileList.push({dataSource:i,storageLevel:t,zoomLevel:s,allVisibleTileLoaded:a.allDataSourceTilesLoaded&&l.allDataSourceTilesLoaded,numTilesLoading:a.numTilesLoading+l.numTilesLoading,visibleTiles:[...a.visibleTiles,...l.visibleTiles],renderedTiles:new Map}),o=o&&a.allDataSourceTilesLoaded}let l,c;this.allVisibleTilesLoaded=o&&a.allBoundingBoxesFinal,this.populateRenderedTiles(),this.forEachCachedTile(t=>{t.isVisible||t.allGeometryLoaded||this.disposeTile(t)}),this.m_dataSourceCache.shrinkToCapacity(),this.dataSourceTileList.forEach(t=>
2{t.renderedTiles.forEach(e=>{e.update(t.zoomLevel),l=s.MathUtils.min2(l,e.geoBox.minAltitude),c=s.MathUtils.max2(c,e.geoBox.maxAltitude)})}),void 0===l&&(l=0),void 0===c&&(c=0);let h=!1;const u=this.m_viewRange,p=this.updateClipPlanes(c,l);var m,f;return h=0==(f=u,(m=p).far===f.far&&m.maximum===f.maximum&&m.minimum===f.minimum&&m.near===f.near),{viewRanges:p,viewRangesChanged:h}}getTile(t,e,i,r){return this.getTileImpl(t,e,i,!1,r)}getCachedTile(t,e,i,r){return(0,s.assert)(t.cacheable),this.getTileImpl(t,e,i,!0,r)}getRenderedTile(t,e,i=0){const r=this.dataSourceTileList.find(e=>e.dataSource===t);if(void 0!==r)return r.renderedTiles.get(n.TileKeyUtils.getKeyForTileKeyAndOffset(e,i))}getRenderedTileAtLocation(t,e,i=0){const r=this.dataSourceTileList.find(e=>e.dataSource===t);if(void 0===r)return;const o=t.getTilingScheme(),s=r.zoomLevel,a=o.getTileKey(e,s);if(!a)return;let l=r.renderedTiles.get(n.TileKeyUtils.getKeyForTileKeyAndOffset(a,i));if(void 0!==l)return l;const{searchLevelsUp:c,searchLevelsDown:h}=this.getSearchDirection(t,s);let u=a;for(let t=1;t<=c;++t)if(u=u.parent(),l=r.renderedTiles.get(n.TileKeyUtils.getKeyForTileKeyAndOffset(u,i)),void 0!==l)return l;const p=o.projection.projectPoint(e);for(let t=1;t<=h;++t){const e=s+t,a=n.TileKeyUtils.worldCoordinatesToTileKey(o,p,e);if(a&&(l=r.renderedTiles.get(n.TileKeyUtils.getKeyForTileKeyAndOffset(a,i)),void 0!==l))return l}}removeDataSource(t){this.clearTileCache(t),this.dataSourceTileList=this.dataSourceTileList.filter(e=>e.dataSource!==t)}clearTileCache(t,e){void 0!==t?this.m_dataSourceCache.evictSelected((i,r)=>i.dataSource===t&&(void 0===e||e(i))):void 0!==e?this.m_dataSourceCache.evictSelected(e):this.m_dataSourceCache.evictAll()}markTilesDirty(t,e){if(void 0===t)this.dataSourceTileList.forEach(t=>{this.markDataSourceTilesDirty(t,e)});else{const i=this.dataSourceTileList.find(e=>e.dataSource===t);if(void 0===i)return;this.markDataSourceTilesDirty(i,e)}}disposePendingTiles(){this.m_dataSourceCache.disposeTiles()}forEachVisibleTile(t){for(const e of this.dataSourceTileList)e.renderedTiles.forEach(t)}forEachCachedTile(t,e){this.m_dataSourceCache.forEach((e,i)=>t(e),e)}disposeTile(t){this.m_dataSourceCache.delete(t),t.dispose()}processVisibleTiles(t,e,i,r,n){var o;let s=!0,a=0;const c=[],h=[];for(let u=0;u<t.length&&c.length<this.options.maxVisibleDataSourceTiles;u++){const p=t[u],d=this.getTile(e,p.tileKey,p.offset,i);if(void 0!==d&&(c.push(d),s=s&&d.allGeometryLoaded,d.allGeometryLoaded?(this.skipOverlappedTiles(e,d),this.processDelayTileRendering(d,r.newTilesPerFrame,i)&&r.newTilesPerFrame++):a++,d.visibleArea=p.area,d.elevationRange=null!==(o=p.elevationRange)&&void 0!==o?o:{minElevation:0,maxElevation:0},n))for(const e of d.dependencies)void 0===t.find(t=>t.tileKey.mortonCode()===e.mortonCode())&&void 0===h.find(t=>t.tileKey.mortonCode()===e.mortonCode())&&h.push(new l.TileKeyEntry(e,0))}return{allDataSourceTilesLoaded:s,numTilesLoading:a,visibleTiles:c,dependentTiles:h}}processDelayTileRendering(t,e,i){let r=!1;return 0!==this.options.maxTilesPerFrame&&e>this.options.maxTilesPerFrame&&t.frameNumLastVisible!==i-1?(t.delayRendering=!0,t.mapView.update()):(t.frameNumVisible<0&&(t.frameNumVisible=i,r=!0),t.numFramesVisible++,t.delayRendering=!1),r}skipOverlappedTiles(t,e){if(this.options.projection.type!==n.ProjectionType.Spherical&&t.isFullyCovering()){const i=e.uniqueKey,r=this.m_coveringMap.get(i);void 0===r?(e.skipRendering=!1,this.m_coveringMap.set(i,e)):r.dataSource instanceof a.BackgroundDataSource?r.skipRendering=!0:t instanceof a.BackgroundDataSource&&(e.skipRendering=!0)}}getSearchDirection(t,e){const i=Math.min(this.options.quadTreeSearchDistanceUp,Math.max(0,e-t.minDataLevel)),r=Math.min(this.options.quadTreeSearchDistanceDown,Math.max(0,t.maxDataLevel-e));return{searchDirection:r>0&&i>0?h.BOTH:r>0?h.DOWN:i>0?h.UP:h.NONE,searchLevelsUp:i,searchLevelsDown:r}}populateRenderedTiles(){this.dataSourceTileList.forEach(t=>{const e=t.renderedTiles,i=[];t.visibleTiles.forEach(t=>{t.levelOffset=0,t.hasGeometry&&!t.delayRendering?e.set(t.uniqueKey,t):i.push(t.uniqueKey)});const r=t.dataSource;if(0===i.length||!1===r.allowOverlappingTiles)return;const n=t.zoomLevel,{searchDirection:o}=this.getSearchDirection(r,n),s=new Map;for(const t of i)(o!==h.BOTH&&o!==h.UP||!this.findUp(t,n,e,s,r))&&(o!==h.BOTH&&o!==h.DOWN||this.findDown(t,n,e,r))})}findDown(t,e,i,r){const{offset:o,mortonCode:s}=n.TileKeyUtils.extractOffsetAndMortonKeyFromKey(t),a=n.TileKey.fromMortonCode(s),l=r.getTilingScheme();for(const t of l.getSubTileKeys(a)){const s=n.TileKeyUtils.getKeyForTileKeyAndOffset(t,o),a=this.m_dataSourceCache.get(t.mortonCode(),o,r),l=Math.abs(t.level-e);void 0===a||!a.hasGeometry||a.delayRendering?l<this.options.quadTreeSearchDistanceDown&&this.findDown(s,e,i,r):(i.set(s,a),a.levelOffset=l)}}findUp(t,e,i,r,o){const s=n.TileKeyUtils.getParentKeyFromKey(t);if(void 0!==i.get(s))return!0;const a=r.get(s);if(void 0!==a)return a;const{offset:l,mortonCode:c}=n.TileKeyUtils.extractOffsetAndMortonKeyFromKey(s),h=this.m_dataSourceCache.get(c,l,o),u=h?h.tileKey:n.TileKey.fromMortonCode(c),p=Math.abs(e-u.level);if(void 0!==h&&h.hasGeometry&&!h.delayRendering)return r.set(s,!0),i.set(s,h),h.levelOffset=-p,!0;if(r.set(s,!1),p<this.options.quadTreeSearchDistanceUp&&0!==u.level){const t=this.findUp(s,e,i,r,o);if(r.set(s,t),t)return!0}return!1}getTileImpl(t,e,i,r,n){function o(t){t.frameNumLastRequested=n}if(!t.cacheable&&!r){const i=t.getTile(e,!0);return void 0!==i&&(i.load(),o(i)),i}const s=this.m_dataSourceCache;let a=s.get(e.mortonCode(),i,t);return void 0!==a&&a.offset===i?(o(a),a):r?void 0:(a=t.getTile(e,!0),void 0!==a&&(a.load(),a.offset=i,o(a),s.set(e.mortonCode(),i,t,a)),a)}markDataSourceTilesDirty(t,e){const i=this.m_dataSourceCache,r=new Set,n=t=>{const e=p.getKeyForTile(t);r.has(e)||(r.add(e),t.load(!0))};
2t.visibleTiles.forEach(t=>{(void 0===e||e(t))&&n(t)}),t.renderedTiles.forEach(t=>{(void 0===e||e(t))&&n(t)}),i.forEach((t,n)=>{void 0!==e&&!e(t)||r.has(n)||(i.deleteByKey(n),t.dispose())},t.dataSource)}getVisibleTileKeysForDataSources(t,e,i){const r=Array();let n=!0;if(0===e.length)return{tileKeys:r,allBoundingBoxesFinal:n};const o=new Map;e.forEach(t=>{const e=t.getTilingScheme(),i=o.get(e);void 0===i?o.set(e,[t]):i.push(t)}),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[e,s]of o){const o=s.map(e=>e.getDataZoomLevel(t)),a=this.m_frustumIntersection.compute(e,i,o,s);n=n&&a.calculationFinal;for(const e of s){const i=[],n=e.getDataZoomLevel(t);for(const t of a.tileKeyEntries.get(n).values())e.canGetTile(n,t.tileKey)&&i.push(t);r.push({dataSource:e,visibleTileKeys:i})}}return{tileKeys:r,allBoundingBoxesFinal:n}}}},9931:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerBasedDecoder=void 0;const r=i(8152);let n=0;e.WorkerBasedDecoder=class{constructor(t,e){this.workerSet=t,this.decoderServiceType=e,this.m_serviceCreated=!1,this.workerSet.addReference(),this.serviceId=`${this.decoderServiceType}-${n++}`}dispose(){this.m_serviceCreated&&this.workerSet.broadcastRequest(r.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID,{type:r.WorkerServiceProtocol.Requests.DestroyService,targetServiceId:this.serviceId}).catch(()=>{}),this.workerSet.removeReference()}async connect(){await this.workerSet.connect(r.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID),this.m_serviceCreated||(await this.workerSet.broadcastRequest(r.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID,{type:r.WorkerServiceProtocol.Requests.CreateService,targetServiceType:this.decoderServiceType,targetServiceId:this.serviceId}),this.m_serviceCreated=!0)}decodeTile(t,e,i,n){const o=e.mortonCode(),s={type:r.WorkerDecoderProtocol.Requests.DecodeTileRequest,tileKey:o,data:t,projection:(0,r.getProjectionName)(i)},a=t instanceof ArrayBuffer?[t]:void 0;
2return this.workerSet.invokeRequest(this.serviceId,s,a,n)}getTileInfo(t,e,i,n){const o=e.mortonCode(),s={type:r.WorkerDecoderProtocol.Requests.TileInfoRequest,tileKey:o,data:t,projection:(0,r.getProjectionName)(i)},a=t instanceof ArrayBuffer?[t]:void 0;return this.workerSet.invokeRequest(this.serviceId,s,a,n)}configure(t,e){const i=Object.assign(Object.assign({service:this.serviceId,type:r.WorkerDecoderProtocol.DecoderMessageName.Configuration},t),{options:e});this.workerSet.broadcastMessage(i)}get workerCount(){return this.workerSet.workerCount}}},3373:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerBasedTiler=void 0;const r=i(8152);let n=0;e.WorkerBasedTiler=class{constructor(t,e){this.workerSet=t,this.tilerServiceType=e,this.m_serviceCreated=!1,this.workerSet.addReference(),this.serviceId=`${this.tilerServiceType}-${n++}`}dispose(){this.m_serviceCreated&&this.workerSet.broadcastRequest(r.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID,{type:r.WorkerServiceProtocol.Requests.DestroyService,targetServiceId:this.serviceId}).catch(()=>{}),this.workerSet.removeReference()}async connect(){await this.workerSet.connect(r.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID),this.m_serviceCreated||(await this.workerSet.broadcastRequest(r.WorkerServiceProtocol.WORKER_SERVICE_MANAGER_SERVICE_ID,{type:r.WorkerServiceProtocol.Requests.CreateService,targetServiceType:this.tilerServiceType,targetServiceId:this.serviceId}),this.m_serviceCreated=!0)}registerIndex(t,e){const i={type:r.WorkerTilerProtocol.Requests.RegisterIndex,id:t,input:e instanceof URL?e.href:e};
2return this.workerSet.invokeRequest(this.serviceId,i)}updateIndex(t,e){const i={type:r.WorkerTilerProtocol.Requests.UpdateIndex,id:t,input:e instanceof URL?e.href:e};return this.workerSet.invokeRequest(this.serviceId,i)}getTile(t,e){const i=e.mortonCode(),n={type:r.WorkerTilerProtocol.Requests.TileRequest,index:t,tileKey:i};return this.workerSet.invokeRequest(this.serviceId,n)}}},2453:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LowResRenderPass=void 0;const r=i(9896),n=i(6271),o=i(8817),s=i(5269),a=i(5117),l=i(5808),c=i(4250),h=i(2331);class u extends h.Pass{constructor(t){super(),this.lowResPixelRatio=t,this.m_renderTarget=null,this.m_localCamera=new r.OrthographicCamera(-1,1,1,-1,0,1),this.m_quadScene=new l.Scene,this.m_quadUniforms=c.CopyShader.uniforms,this.m_quadMaterial=new c.CopyMaterial(this.m_quadUniforms),this.m_quad=new s.Mesh(new o.PlaneGeometry(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=t}dispose(){this.m_quadMaterial.dispose(),this.m_quad.geometry.dispose(),null!==this.m_renderTarget&&(this.m_renderTarget.dispose(),this.m_renderTarget=null)}set pixelRatio(t){this.m_pixelRatio=t,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(t,e,i,r,o){if(!this.enabled||void 0===this.pixelRatio)return;null===this.m_renderTarget&&(this.m_savedWidth=o.width,this.m_savedHeight=o.height,this.m_renderTarget=new a.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 s=t.getRenderTarget();t.setRenderTarget(this.m_renderTarget),t.clear(),t.render(e,i),t.setRenderTarget(this.renderToScreen?null:r),t.clear(),t.render(this.m_quadScene,this.m_localCamera),t.setRenderTarget(s)}setSize(t,e){this.m_savedWidth=t,this.m_savedHeight=e,this.m_renderTarget&&void 0!==this.pixelRatio&&this.m_renderTarget.setSize(Math.floor(t*this.pixelRatio),Math.floor(e*this.pixelRatio))}}e.LowResRenderPass=u},818:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MSAARenderPass=e.MSAASampling=void 0;const r=i(9896),n=i(6271),o=i(8817),s=i(5269),a=i(5117),l=i(5808),c=i(5971),h=i(4250),u=i(2331);var p;!function(t){t[t.Level_0=0]="Level_0",t[t.Level_1=1]="Level_1",t[t.Level_2=2]="Level_2",t[t.Level_3=3]="Level_3",t[t.Level_4=4]="Level_4",t[t.Level_5=5]="Level_5"}(p=e.MSAASampling||(e.MSAASampling={}));class d extends u.Pass{constructor(){super(),this.samplingLevel=p.Level_1,this.m_renderTarget=null,this.m_localCamera=new r.OrthographicCamera(-1,1,1,-1,0,1),this.m_quadScene=new l.Scene,this.m_quadUniforms=h.CopyShader.uniforms,this.m_quadMaterial=new h.MSAAMaterial(this.m_quadUniforms),this.m_quad=new s.Mesh(new o.PlaneGeometry(2,2),this.m_quadMaterial),this.m_tmpColor=new c.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(t,e,i,r,o){if(!this.enabled)return;null===this.m_renderTarget&&(this.m_renderTarget=new a.WebGLRenderTarget(o.width,o.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 s=d.OffsetVectors[this.samplingLevel],l=t.getClearColor(this.m_tmpColor),c=void 0!==l?l.getHex():0,h={enabled:null!==i.view&&i.view.enabled,fullWidth:o.width,fullHeight:o.height,x:0,y:0,width:o.width,height:o.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=t.getRenderTarget();for(let n=0;n<s.length;n++){const o=s[n];
2i.setViewOffset(h.fullWidth,h.fullHeight,h.x+o[0]/16,h.y+o[1]/16,h.width,h.height);const a=(n+.5)/s.length-.5,u=1/s.length+a/32;this.m_quadUniforms.opacity.value=u,t.setRenderTarget(this.m_renderTarget),t.clear(),t.render(e,i),t.setRenderTarget(this.renderToScreen?null:r),0===n&&(t.setClearColor(0),t.clear()),t.render(this.m_quadScene,this.m_localCamera),0===n&&void 0!==l&&t.setClearColor(c)}t.setRenderTarget(u),null!==i.view&&(i.view.enabled=h.enabled,i.view.offsetX=h.x,i.view.offsetY=h.y)}setSize(t,e){this.m_renderTarget&&this.m_renderTarget.setSize(t,e)}}e.MSAARenderPass=d,d.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:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MapRenderingManager=void 0;const r=i(5448),n=i(5117),o=i(4250),s=i(2453),a=i(818),l=i(8794),c=i(2331),h=i(6721),u=a.MSAASampling.Level_1,p=a.MSAASampling.Level_4;e.MapRenderingManager=class{constructor(t,e,i,r={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 c.RenderPass,this.m_target1=new n.WebGLRenderTarget(1,1),this.m_target2=new n.WebGLRenderTarget(1,1),this.m_sepiaPass=new c.ShaderPass(o.SepiaShader),this.m_vignettePass=new c.ShaderPass(o.VignetteShader),this.m_readBuffer=new n.WebGLRenderTarget(t,e),this.m_msaaPass=new a.MSAARenderPass,this.m_msaaPass.enabled=void 0!==r&&!0===r.msaaEnabled,this.m_dynamicMsaaSamplingLevel=void 0===r.dynamicMsaaSamplingLevel?u:r.dynamicMsaaSamplingLevel,this.m_staticMsaaSamplingLevel=void 0===r.staticMsaaSamplingLevel?p:r.staticMsaaSamplingLevel,this.m_lowResPass=new s.LowResRenderPass(i),this.m_lowResPass.enabled=void 0!==i}updateOutline(t){this.outline.color=t.color,this.outline.thickness=t.thickness,this.outline.ghostExtrudedPolygons=t.ghostExtrudedPolygons,this.outline.needsUpdate=!0}render(t,e,i,n){if(!n&&void 0!==this.m_lowResPass.pixelRatio)return this.m_lowResPass.renderToScreen=!0,void this.m_lowResPass.render(t,e,i,null,this.m_readBuffer);const o=this.bloom.enabled||this.outline.enabled||this.vignette.enabled||this.sepia.enabled;let s=null;if((this.bloom.enabled||this.vignette.enabled||this.sepia.enabled)&&(t.setRenderTarget(this.m_target1),t.clearDepth()),this.m_msaaPass.enabled?(this.m_msaaPass.samplingLevel=n?this.m_staticMsaaSamplingLevel:this.m_dynamicMsaaSamplingLevel,this.m_msaaPass.renderToScreen=!o,this.m_msaaPass.render(t,e,i,null,this.m_readBuffer)):this.bloom.enabled||this.vignette.enabled||this.sepia.enabled?(s=this.m_target1,this.m_renderPass.render(t,e,i,this.m_target1,null)):(!this.outline.enabled||this.outline.enabled&&!this.bloom.enabled)&&t.render(e,i),this.outline.enabled){void 0===this.m_outlineEffect&&(this.m_outlineEffect=new l.OutlineEffect(t)),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 r=this.bloom.enabled||this.vignette.enabled||this.sepia.enabled;r&&(s=this.m_target1),t.setRenderTarget(r?s:null),this.m_outlineEffect.render(e,i)}if(this.bloom.enabled){void 0===this.m_bloomPass&&(this.m_bloomPass=new h.BloomPass(new r.Vector2(this.m_width,this.m_height),this.bloom.strength,this.bloom.radius,this.bloom.threshold));const n=this.vignette.enabled||this.sepia.enabled;this.m_bloomPass.renderToScreen=!n,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(t,e,i,null,s)}else void 0!==this.m_bloomPass&&(this.m_bloomPass.dispose(),this.m_bloomPass=void 0);if(this.vignette.enabled){const r=s,n=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=!n,n&&(s=s===this.m_target1?this.m_target2:this.m_target1),this.m_vignettePass.render(t,e,i,s,r)}this.sepia.enabled&&(this.m_sepiaPass.renderToScreen=!0,this.m_sepiaPass.uniforms.amount.value=this.sepia.amount,this.m_sepiaPass.render(t,e,i,null,s))}setSize(t,e){this.m_readBuffer.setSize(t,e),this.m_msaaPass.setSize(t,e),void 0!==this.m_bloomPass&&this.m_bloomPass.setSize(t,e),this.m_lowResPass.setSize(t,e),this.m_target1.setSize(t,e),this.m_target2.setSize(t,e),this.m_width=t,this.m_height=e}get lowResPixelRatio(){return this.m_lowResPass.pixelRatio}set lowResPixelRatio(t){this.m_lowResPass.pixelRatio=t,this.m_lowResPass.enabled=void 0!==t}set dynamicMsaaSamplingLevel(t){this.m_dynamicMsaaSamplingLevel=t}get dynamicMsaaSamplingLevel(){return this.m_dynamicMsaaSamplingLevel}set msaaEnabled(t){this.m_msaaPass.enabled=t}get msaaEnabled(){return this.m_msaaPass.enabled}set staticMsaaSamplingLevel(t){this.m_staticMsaaSamplingLevel=t}get staticMsaaSamplingLevel(){return this.m_staticMsaaSamplingLevel}}},8794:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.OutlineEffect=void 0;const r=i(6271),n=i(1498),o=i(5971),s=i(9984),a=i(4250),l=i(4342);e.OutlineEffect=class{constructor(t){this.m_renderer=t,this.enabled=!0,this.m_defaultThickness=.02,this.m_defaultColor=new o.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=t.autoClear,this.domElement=t.domElement,this.shadowMap=t.shadowMap}set thickness(t){this.m_defaultThickness=t,this.m_uniformsChunk.outlineThickness.value=t,this.m_cache={}}set color(t){this.m_defaultColor.set(t),this.m_cache={}}set ghostExtrudedPolygons(t){this.m_ghostExtrudedPolygons=t}clear(t,e,i){this.m_renderer.clear(t,e,i)}getPixelRatio(){return this.m_renderer.getPixelRatio()}setPixelRatio(t){this.m_renderer.setPixelRatio(t)}getSize(t){return this.m_renderer.getSize(t)}setSize(t,e,i){this.m_renderer.setSize(t,e,i)}setViewport(t,e,i,r){this.m_renderer.setViewport(t,e,i,r)}setScissor(t,e,i,r){this.m_renderer.setScissor(t,e,i,r)}setScissorTest(t){this.m_renderer.setScissorTest(t)}setRenderTarget(t){this.m_renderer.setRenderTarget(t)}render(t,e){if(this.m_ghostExtrudedPolygons){if(!this.enabled)return void this.m_renderer.render(t,e);const i=this.m_renderer.autoClear;this.m_renderer.autoClear=this.autoClear,this.m_renderer.render(t,e),this.m_renderer.autoClear=i}this.renderOutline(t,e)}renderOutline(t,e){const i=this.m_renderer.autoClear,r=t.matrixWorldAutoUpdate,n=t.background,o=this.m_renderer.shadowMap.enabled;t.matrixWorldAutoUpdate=!1,t.background=null,this.m_renderer.autoClear=!1,this.m_renderer.shadowMap.enabled=!1,t.traverse(this.setOutlineMaterial.bind(this)),this.m_renderer.render(t,e),t.traverse(this.restoreOriginalMaterial.bind(this)),this.cleanupCache(),t.matrixWorldAutoUpdate=r,t.background=n,this.m_renderer.autoClear=i,this.m_renderer.shadowMap.enabled=o}createInvisibleMaterial(){return new n.ShaderMaterial({name:"invisible",visible:!1})}createMaterial(t){if(t instanceof a.EdgeMaterial||!0===t.isDepthPrepassMaterial)return this.createInvisibleMaterial();const e=this.m_shaderIDs[t.type];let i,o=void 0!==t.shaderUniforms?t.shaderUniforms:t.uniforms;if(void 0!==e){const t=s.ShaderLib[e];o=t.uniforms,i=t.vertexShader}else if(!0===t.isRawShaderMaterial){if(i=t.vertexShader,!/attribute\s+vec3\s+position\s*;/.test(i)||!/attribute\s+vec3\s+normal\s*;/.test(i))return this.createInvisibleMaterial()}else{if(!0!==t.isShaderMaterial)return this.createInvisibleMaterial();i=t.vertexShader}const l=void 0!==t.shaderUniforms&&void 0!==t.shaderUniforms.extrusionRatio,c=a.FadingFeature.isDefined(t),h=Object.assign(Object.assign({},o),this.m_uniformsChunk),u=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,""),p={};return/vec3\s+transformed\s*=/.test(i)||/#include\s+<begin_vertex>/.test(i)||(p.DECLARE_TRANSFORMED=!0),l&&(h.extrusionRatio={value:a.ExtrusionFeatureDefs.DEFAULT_RATIO_MIN},p.USE_EXTRUSION=1),c&&(h.fadeNear={value:void 0!==o.fadeNear?o.fadeNear.value:a.FadingFeature.DEFAULT_FADE_NEAR},h.fadeFar={value:void 0!==o.fadeFar?o.fadeFar.value:a.FadingFeature.DEFAULT_FADE_FAR},p.USE_FADING=1),new n.ShaderMaterial({defines:p,uniforms:h,vertexShader:u,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:r.BackSide,blending:r.CustomBlending,blendSrc:r.SrcAlphaFactor,blendDst:r.OneMinusSrcAlphaFactor,blendSrcAlpha:r.OneFactor,blendDstAlpha:r.OneMinusSrcAlphaFactor,transparent:!0,polygonOffset:!0,polygonOffsetFactor:10,polygonOffsetUnits:30})}getOutlineMaterialFromCache(t){let e=this.m_cache[t.uuid];return void 0===e&&(e={material:this.createMaterial(t),used:!0,keepAlive:this.m_defaultKeepAlive,count:0},this.m_cache[t.uuid]=e),e.used=!0,e.material}getOutlineMaterial(t){const e=this.getOutlineMaterialFromCache(t);return this.m_originalMaterials[e.uuid]=t,this.updateOutlineMaterial(e,t),e}setOutlineMaterial(t){if(void 0!==t.material){if(Array.isArray(t.material))for(let e=0,i=t.material.length;e<i;e++)t.material[e]=this.getOutlineMaterial(t.material[e]);else t.material=this.getOutlineMaterial(t.material);this.m_originalOnBeforeRenders[t.uuid]=t.onBeforeRender,t.onBeforeRender=(0,l.chainCallbacks)(t.onBeforeRender,this.onBeforeRender.bind(this))}}restoreOriginalMaterial(t){if(void 0!==t.material){if(Array.isArray(t.material))for(let e=0,i=t.material.length;e<i;e++)t.material[e]=this.m_originalMaterials[t.material[e].uuid];else t.material=this.m_originalMaterials[t.material.uuid];t.onBeforeRender=this.m_originalOnBeforeRenders[t.uuid]}}onBeforeRender(t,e,i,r,n,o){const s=this.m_originalMaterials[n.uuid];void 0!==s&&this.updateUniforms(n,s)}updateUniforms(t,e){var i;const r=e.userData.outlineParameters,n=t.uniforms;n.outlineAlpha.value=e.opacity;const o=void 0!==e.shaderUniforms?e.shaderUniforms:e.uniforms;if(void 0!==r&&(void 0!==r.thickness&&(n.outlineThickness.value=r.thickness),void 0!==r.color&&n.outlineColor.value.fromArray(r.color),void 0!==r.alpha&&(n.outlineAlpha.value=r.alpha)),void 0!==o&&void 0!==o.extrusionRatio){const i=e.shaderUniforms.extrusionRatio.value;t.extrusionRatio=i,t.uniforms.extrusionRatio.value=void 0!==i?i:a.ExtrusionFeatureDefs.DEFAULT_RATIO_MIN}void 0!==(null===(i=t.defines)||void 0===i?void 0:i.USE_FADING)&&void 0!==o.fadeNear&&void 0!==o.fadeFar&&o.fadeFar.value>=0&&(n.fadeNear.value=o.fadeNear.value,n.fadeFar.value=o.fadeFar.value)}updateOutlineMaterial(t,e){if("invisible"===t.name)return;const i=e.userData.outlineParameters;t.skinning=e.skinning,t.fog=e.fog,void 0!==i?(t.visible=!1!==e.visible&&(void 0===i.visible||i.visible),void 0!==i.keepAlive&&(this.m_cache[e.uuid].keepAlive=i.keepAlive)):t.visible=e.visible,!0!==e.wireframe&&!1!==e.depthTest||(t.visible=!1)}cleanupCache(){let t;t=Object.keys(this.m_originalMaterials);for(let e=0,i=t.length;e<i;e++)this.m_originalMaterials[t[e]]=void 0;t=Object.keys(this.m_originalOnBeforeRenders);for(let e=0,i=t.length;e<i;e++)this.m_originalOnBeforeRenders[t[e]]=void 0;t=Object.keys(this.m_cache);for(const e of t)!1===this.m_cache[e].used?(this.m_cache[e].count++,!1===this.m_cache[e].keepAlive&&this.m_cache[e].count>this.m_removeThresholdCount&&delete this.m_cache[e]):(this.m_cache[e].used=!1,this.m_cache[e].count=0)}}}
2,2331:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShaderPass=e.RenderPass=e.Pass=void 0;const r=i(9896),n=i(8817),o=i(1498),s=i(5269),a=i(5143);class l{constructor(){this.enabled=!1,this.renderToScreen=!1}setSize(t,e){}render(t,e,i,r,n,o){}}e.Pass=l,e.RenderPass=class extends l{constructor(){super()}render(t,e,i,r,n){t.setRenderTarget(this.renderToScreen?null:r),t.render(e,i)}},e.ShaderPass=class extends l{constructor(t,e="tDiffuse"){super(),this.textureID=e,t instanceof o.ShaderMaterial?(this.uniforms=t.uniforms,this.material=t):(this.uniforms=a.UniformsUtils.clone(t.uniforms),this.material=new o.ShaderMaterial({defines:Object.assign({},t.defines),uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader})),this.fsQuad=new c(this.material)}render(t,e,i,r,n,o){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,t.setRenderTarget(this.renderToScreen?null:r),this.fsQuad.render(t)}};class c{constructor(t){this.m_camera=new r.OrthographicCamera(-1,1,1,-1,0,1);const e=new n.PlaneGeometry(2,2);this.m_mesh=new s.Mesh(e,t)}get material(){return this.m_mesh.material}set material(t){this.m_mesh.material=t}render(t){t.render(this.m_mesh,this.m_camera)}}},6721:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BloomPass=void 0;const r=i(9896),n=i(6271),o=i(8817),s=i(977),a=i(1498),l=i(5448),c=i(6815),h=i(5269),u=i(5143),p=i(5117),d=i(5808),m=i(4250),f=i(2331),g=new l.Vector2(1,0),y=new l.Vector2(0,1);class v extends f.Pass{constructor(t,e,i,f){super(),this.resolution=new l.Vector2(256,256),this.m_renderTargetsHorizontal=[],this.m_renderTargetsVertical=[],this.m_nMips=5,this.m_separableBlurMaterials=[],this.m_camera=new r.OrthographicCamera(-1,1,1,-1,0,1),this.m_scene=new d.Scene,this.m_basic=new s.MeshBasicMaterial,this.m_quad=new h.Mesh(new o.PlaneGeometry(2,2)),this.m_bloomTintColors=[new c.Vector3(1,1,1),new c.Vector3(1,1,1),new c.Vector3(1,1,1),new c.Vector3(1,1,1),new c.Vector3(1,1,1)],this.strength=e,this.radius=i,this.threshold=f,this.resolution=t,this.m_quad.frustumCulled=!1,this.m_scene.add(this.m_quad);const g={minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:n.RGBAFormat};let y=Math.round(this.resolution.x/2),v=Math.round(this.resolution.y/2);this.m_renderTargetBright=new p.WebGLRenderTarget(y,v,g),this.m_renderTargetBright.texture.name="UnrealBloomPass.bright",this.m_renderTargetBright.texture.generateMipmaps=!1;for(let t=0;t<this.m_nMips;t++){const e=new p.WebGLRenderTarget(y,v,g);e.texture.name="UnrealBloomPass.h"+t,e.texture.generateMipmaps=!1,this.m_renderTargetsHorizontal.push(e);const i=new p.WebGLRenderTarget(y,v,g);i.texture.name="UnrealBloomPass.v"+t,i.texture.generateMipmaps=!1,this.m_renderTargetsVertical.push(i),y=Math.round(y/2),v=Math.round(v/2)}this.m_highPassUniforms=u.UniformsUtils.clone(m.LuminosityHighPassShader.uniforms),this.m_highPassUniforms.luminosityThreshold.value=f,this.m_highPassUniforms.smoothWidth.value=.01,this.m_materialHighPassFilter=new a.ShaderMaterial({uniforms:this.m_highPassUniforms,vertexShader:m.LuminosityHighPassShader.vertexShader,fragmentShader:m.LuminosityHighPassShader.fragmentShader,defines:{}});const _=[3,5,7,9,11];y=Math.round(this.resolution.x/2),v=Math.round(this.resolution.y/2);for(let t=0;t<this.m_nMips;t++)this.m_separableBlurMaterials.push(this.getSeperableBlurMaterial(_[t])),this.m_separableBlurMaterials[t].uniforms.texSize.value=new l.Vector2(y,v),y=Math.round(y/2),v=Math.round(v/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=e,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=u.UniformsUtils.clone(m.CopyShader.uniforms),this.m_copyUniforms.opacity.value=1,this.m_materialCopy=new a.ShaderMaterial({uniforms:this.m_copyUniforms,vertexShader:m.CopyShader.vertexShader,fragmentShader:m.CopyShader.fragmentShader,blending:n.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0})}dispose(){for(const t of this.m_renderTargetsHorizontal)t.dispose();for(const t of this.m_renderTargetsVertical)t.dispose();this.m_renderTargetBright.dispose()}setSize(t,e){let i=Math.round(t/2),r=Math.round(e/2);this.m_renderTargetBright.setSize(i,r);for(let t=0;t<this.m_nMips;t++)this.m_renderTargetsHorizontal[t].setSize(i,r),this.m_renderTargetsVertical[t].setSize(i,r),this.m_separableBlurMaterials[t].uniforms.texSize.value=new l.Vector2(i,r),i=Math.round(i/2),r=Math.round(r/2)}render(t,e,i,r,n){this.renderToScreen&&(this.m_quad.material=this.m_basic,this.m_basic.map=n.texture,t.setRenderTarget(null),t.clear(),t.render(this.m_scene,this.m_camera)),this.m_highPassUniforms.tDiffuse.value=n.texture,this.m_highPassUniforms.luminosityThreshold.value=this.threshold,this.m_quad.material=this.m_materialHighPassFilter,t.setRenderTarget(this.m_renderTargetBright),t.clear(),t.render(this.m_scene,this.m_camera);let o=this.m_renderTargetBright;for(let e=0;e<this.m_nMips;e++)this.m_quad.material=this.m_separableBlurMaterials[e],this.m_separableBlurMaterials[e].uniforms.colorTexture.value=o.texture,this.m_separableBlurMaterials[e].uniforms.direction.value=g,t.setRenderTarget(this.m_renderTargetsHorizontal[e]),t.clear(),t.render(this.m_scene,this.m_camera),this.m_separableBlurMaterials[e].uniforms.colorTexture.value=this.m_renderTargetsHorizontal[e].texture,this.m_separableBlurMaterials[e].uniforms.direction.value=y,t.setRenderTarget(this.m_renderTargetsVertical[e]),t.clear(),t.render(this.m_scene,this.m_camera),o=this.m_renderTargetsVertical[e];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,t.setRenderTarget(this.m_renderTargetsHorizontal[0]),t.clear(),t.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?(t.setRenderTarget(null),t.render(this.m_scene,this.m_camera)):(t.setRenderTarget(n),t.render(this.m_scene,this.m_camera))}getSeperableBlurMaterial(t){return new a.ShaderMaterial({defines:{KERNEL_RADIUS:t,SIGMA:t},uniforms:{colorTexture:{value:null},texSize:{value:new l.Vector2(.5,.5)},direction:{value:new l.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(t){return new a.ShaderMaterial({defines:{NUM_MIPS:t},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
2) * texture2D(blurTexture5, vUv) );\n }"})}}e.BloomPass=v},5307:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MSAASampling=e.MSAARenderPass=e.Pass=e.MapRenderingManager=void 0;var r=i(9886);Object.defineProperty(e,"MapRenderingManager",{enumerable:!0,get:function(){return r.MapRenderingManager}});var n=i(2331);Object.defineProperty(e,"Pass",{enumerable:!0,get:function(){return n.Pass}});var o=i(818);Object.defineProperty(e,"MSAARenderPass",{enumerable:!0,get:function(){return o.MSAARenderPass}}),Object.defineProperty(e,"MSAASampling",{enumerable:!0,get:function(){return o.MSAASampling}})},9993:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CopyrightCoverageProvider=void 0;const r=i(4342),n=i(1102);e.CopyrightCoverageProvider=class{constructor(){this.logger=r.LoggerManager.instance.create("CopyrightCoverageProvider")}getTree(){return void 0!==this.m_cachedTreePromise||(this.m_cachedTreePromise=this.getCopyrightCoverageData().then(t=>this.initRBush(t)).catch(t=>(this.logger.error(t),new n))),this.m_cachedTreePromise}async getCopyrights(t,e){const i=[],n=(await this.getTree()).search({minX:t.west,minY:t.south,maxX:t.east,maxY:t.north});for(const t of n){const n=(0,r.getOptionValue)(t.minLevel,0),o=(0,r.getOptionValue)(t.maxLevel,1/0);e>=n&&e<=o&&void 0===i.find(e=>e.id===t.label)&&i.push({id:t.label})}return i}initRBush(t){const e=new n;if(!t)return this.logger.warn("No copyright coverage data provided"),e;for(const i of t){const{minLevel:t,maxLevel:r,label:n,alt:o}=i;if(i.boxes)for(const s of i.boxes){const[i,a,l,c]=s;e.insert({minX:a,minY:i,maxX:c,maxY:l,minLevel:t,maxLevel:r,label:n,alt:o})}else e.insert({minX:-180,minY:-90,maxX:180,maxY:180,minLevel:t,maxLevel:r,label:n,alt:o})}return e}}},4549:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CopyrightElementHandler=void 0;const r=i(4342),n=i(3977),o=i(8380);class s{static install(t,e){return new s(t,e)}constructor(t,e){if(this.m_defaults=new Map,this.m_mapViews=[],this.update=()=>{var t;const e=this.m_mapViews.map(t=>t.copyrightInfo).reduce(o.CopyrightInfo.mergeArrays,null!==(t=this.staticInfo)&&void 0!==t?t:[]);if(0===e.length)return void(this.m_element.style.display="none");if(this.m_element.style.display="block",0!==this.m_defaults.size)for(const t of e){const e=this.m_defaults.get(t.id);void 0!==e&&(t.year=(0,r.getOptionValue)(t.year,e.year),t.label=(0,r.getOptionValue)(t.label,e.label),t.link=(0,r.getOptionValue)(t.link,e.link))}const i=o.CopyrightInfo.mergeArrays(e);this.m_element.innerHTML=o.CopyrightInfo.formatAsHtml(i)},"string"==typeof t){const e=document.getElementById(t);if(!e)throw new Error(`CopyrightElementHandler: unable to find DOM element #${t}`);this.m_element=e}else this.m_element=t;void 0!==e&&this.attach(e)}destroy(){for(const t of this.m_mapViews)t.removeEventListener(n.MapViewEventNames.CopyrightChanged,this.update)}attach(t){return this.m_mapViews.push(t),t.addEventListener(n.MapViewEventNames.CopyrightChanged,this.update),this.update(),this}detach(t){return t.removeEventListener(n.MapViewEventNames.CopyrightChanged,this.update),this.m_mapViews=this.m_mapViews.filter(e=>e!==t),this.update(),this}setDefaults(t){if(this.m_defaults.clear(),void 0!==t)for(const e of t)this.m_defaults.set(e.id,e);return this}setStaticCopyightInfo(t){return this.staticInfo=t,this}}e.CopyrightElementHandler=s},8380:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CopyrightInfo=void 0;const r=i(4342);var n;(n=e.CopyrightInfo||(e.CopyrightInfo={})).mergeArrays=function(t,e){const i=[];for(const n of[t,e])if(void 0!==n)for(const t of n){const e=i.find(e=>e.id===t.id||void 0!==e.label&&e.label===t.label);void 0===e?i.push(Object.assign({},t)):(e.year=r.MathUtils.max2(t.year,e.year),e.label=(0,r.getOptionValue)(t.label,e.label),e.link=(0,r.getOptionValue)(t.link,e.link))}return i},n.formatAsHtml=function(t){if(0===t.length)return"";const e=t.filter(t=>""!==t.label);return 0===e.length?"":"© "+e.map(t=>{var e;const i=null!==(e=t.label)&&void 0!==e?e:t.id,r=void 0!==t.year?`${t.year} ${i}`:i,n=t.link;return n?`<a href="${n}" target="_blank" rel="noreferrer noopener">${r}</a>`:`${r}`}).join(", ")}},9348:(t,e)=>
2{Object.defineProperty(e,"__esModule",{value:!0})},4757:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.UrlCopyrightProvider=void 0;const r=i(3209),n=i(9993);class o extends n.CopyrightCoverageProvider{constructor(t,e,i,n=r.TransferManager.instance()){super(),this.m_fetchURL=t,this.m_baseScheme=e,this.m_requestHeaders=i,this.m_transferManager=n}setRequestHeaders(t){this.m_requestHeaders=t}getCopyrightCoverageData(t){return void 0!==this.m_cachedCopyrightResponse||(this.m_cachedCopyrightResponse=this.m_transferManager.downloadJson(this.m_fetchURL,{headers:this.m_requestHeaders,signal:t}).then(t=>t[this.m_baseScheme]).catch(t=>(this.logger.error(t),[]))),this.m_cachedCopyrightResponse}}e.UrlCopyrightProvider=o},1350:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fitLookAtBounds=e.getFitLookAtBoundsDistance=e.getFitBoundsParams=void 0;const r=i(2479),n=i(2754),o=i(6815),s=i(2616),a=i(4442),l=i(541),c=new o.Vector3,h=new r.PerspectiveCamera;function u(t,e,i,r,a){let c,h;if(t instanceof s.GeoBox)h=null!=a?a:t.center,c=l.MapViewUtils.geoBoxToGeoPoints(t);else if(t instanceof s.GeoPolygon)h=t.getCentroid(),c=t.coordinates;else if((0,s.isGeoBoxExtentLike)(t)){h=null!=a?a:r;const e=s.GeoBox.fromCenterAndExtents(h,t);c=l.MapViewUtils.geoBoxToGeoPoints(e)}else{if(!Array.isArray(t))throw Error("#lookAt: Invalid 'bounds' value");c=t,h=a}t instanceof s.GeoBox||t instanceof s.GeoPolygon||!i||e.type!==s.ProjectionType.Planar||(c=l.MapViewUtils.wrapGeoPointsToScreen(c,h));const u=c.map(t=>e.projectPoint(s.GeoCoordinates.fromObject(t),new o.Vector3)),p=new o.Vector3;return void 0===h?((new n.Box3).setFromPoints(u).getCenter(p),e.scalePointToSurface(p),h=e.unprojectPoint(p)):e.projectPoint(h,p),{target:h,worldTarget:p,worldPoints:u}}function p(t,e){const{projection:i,viewportSize:r,cameraSettings:n,maxZoomLevel:o}=t,{yaw:p,tilt:d,padding:m}=e,{target:f,worldTarget:g,worldPoints:y}=u(e.bounds,i,t.tileWrapping,t.target,e.target);let v,_=e.distance;if(void 0===_){h.copy(t.camera),l.MapViewUtils.getCameraRotationAtTarget(i,f,p,d,h.quaternion),v=h.quaternion;const e=l.MapViewUtils.calculateDistanceFromZoomLevel(n,o);l.MapViewUtils.getCameraPositionFromTarget(f,e,p,d,i,h.position),h.updateMatrixWorld(!0),i.type===s.ProjectionType.Spherical&&l.MapViewUtils.wrapWorldPointsToView(y,h.position),_=function(t,e,i,r,n={top:0,right:0,bottom:0,left:0}){const o={top:2*n.top/r.height,right:2*n.right/r.width,bottom:2*n.bottom/r.height,left:2*n.left/r.width},s=c.copy(e).sub(i.position).length(),l=a.CameraUtils.getPrincipalPoint(i);let h=s;const u=(t,e,i,r)=>{const n=-1===Math.sign(t)?-1:1,o=n>0?r:i;return Math.abs(t)>1?Math.abs((t-e)/(n*(.99-o)-e)):1};for(const e of t){const t=-c.copy(e).applyMatrix4(i.matrixWorldInverse).z,r=c.applyMatrix4(i.projectionMatrix),n=Math.max(u(r.x,l.x,o.left,o.right),u(r.y,l.y,o.bottom,o.top));if(n>1){const e=s-t,i=Math.abs(t)*n+e;h=Math.max(h,i)}}return h}(y,g,h,r,m)}return{target:f,distance:_,quaternion:v}}e.getFitBoundsParams=u,e.getFitLookAtBoundsDistance=p,e.fitLookAtBounds=function(t,e){const{projection:i,camera:r}=t,{yaw:n,tilt:o}=e,{target:s,distance:a,quaternion:c}=p(t,e);c?r.quaternion.copy(c):l.MapViewUtils.getCameraRotationAtTarget(i,s,n,o,r.quaternion),l.MapViewUtils.getCameraPositionFromTarget(s,a,n,o,i,r.position),r.updateMatrixWorld(!0)}},8024:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.addGroundPlane=void 0;const r=i(9365),n=i(3148),o=i(3334),s=i(6815),a=i(5269),l=i(6525),c=i(6189),h=i(2616),u=i(1984),p=i(5863),d=i(8427),m=i(6473),f=i(21),g=i(4772),y=new s.Vector3;function v(t,e,i){const r=t.getAttribute("position"),n=r.array,o=new Float32Array(n.length);for(let t=0;t<r.array.length;t+=1)y.fromBufferAttribute(r,t),i.projection.reprojectPoint(e,y,y).sub(i.center),y.toArray(o,3*t);r.array=o,r.needsUpdate=!0}e.addGroundPlane=function(t,e,i=p.BackgroundDataSource.DEFAULT_COLOR,y=1,_=!1){const b=function(t,e,i,u){const{dataSource:p,projection:g}=t,y=p.getTilingScheme().projection,_=g.type===h.ProjectionType.Spherical,b=!_,x=t.mapView,w=x.shadowsEnabled,S={name:"polygon",color:i,opacity:u},T=(0,d.createMaterial)(S,t.mapView,{fog:null!==x.scene.fog,shadowsEnabled:w}),E=null==T?void 0:T.material;E&&(E.depthWrite=_);
2const M=function(t,e,i,o){const{dataSource:a,projection:l}=t,c=a.getTilingScheme().projection,h=new s.Vector3,u=new n.BufferGeometry,p=(0,f.projectTilePlaneCorners)(t,c),d=[p.sw,p.se,p.nw,p.ne];if(e)for(const e of d)l.reprojectPoint(c,e,e).sub(t.center);const m=e?new Float32Array(12):new Float64Array(12),g=new r.BufferAttribute(m,3).copyArray([...d[0].toArray(),...d[1].toArray(),...d[2].toArray(),...d[3].toArray()]);if(u.setAttribute("position",g),o){c.surfaceNormal(p.sw,h).negate();const t=new r.BufferAttribute(new Float32Array(12),3).copyArray([...h.toArray(),...h.toArray(),...h.toArray(),...h.toArray()]);u.setAttribute("normal",t)}if(u.setIndex(new r.BufferAttribute(new Uint16Array([0,1,2,2,1,3]),1)),i){const t=new r.BufferAttribute(new Float32Array([0,0,1,0,0,1,1,1]),2);u.setAttribute("uv",t)}return u}(t,b,e,w);if(!_)return new a.Mesh(M,E);const A=[],C=new c.SphericalGeometrySubdivisionModifier((0,o.degToRad)(10),y);if(!1===t.mapView.enableMixedLod)return C.modify(M),v(M,y,t),new a.Mesh(M,E);for(let e=0;e<4;++e){const i=Math.pow(2,e),r=M.clone();i>1&&new l.EdgeLengthGeometrySubdivisionModifier(i,t.geoBox,l.SubdivisionMode.All,y).modify(r),C.modify(r),v(r,y,t),A.push(r)}return new m.LodMesh(A,E)}(t,_,i,y);return b.receiveShadow=t.mapView.shadowsEnabled,b.renderOrder=e,(0,g.registerTileObject)(t,b,{pickability:u.Pickability.transient}),t.objects.push(b),b}},544:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DisplacedBufferAttribute=void 0;const r=i(9365),n=i(3334),o=i(6815),s=i(4342),a=i(8813);class l extends r.BufferAttribute{constructor(t,e,i,r){super(t.array,t.itemSize,t.normalized),this.originalAttribute=t,this.m_normals=e,this.m_uvs=i,this.m_textureWidth=0,this.m_textureHeight=0,this.m_cache=new a.VertexCache(l.MAX_CACHE_SIZE),this.m_lastPos=new o.Vector3,this.m_tmpNormal=new o.Vector3,this.resetTexture(r)}reset(t,e,i,r){this.array=t.array,this.itemSize=t.itemSize,this.count=this.array.length/this.itemSize,this.normalized=t.normalized,this.originalAttribute=t,this.m_normals=e,this.m_uvs=i,this.m_cache.clear(),this.m_lastBufferIndex=void 0,this.resetTexture(r)}getX(t){return this.getDisplacedCoordinate(t).x}getY(t){return this.getDisplacedCoordinate(t).y}getZ(t){return this.getDisplacedCoordinate(t).z}resetTexture(t){this.m_texture=new Float32Array(t.image.data.buffer),this.m_textureWidth=t.image.width,this.m_textureHeight=t.image.height}getDisplacedCoordinate(t){return t===this.m_lastBufferIndex||(this.m_lastBufferIndex=t,this.m_cache.get(t,this.m_lastPos)||(this.displacePosition(t),this.m_cache.set(t,this.m_lastPos))),this.m_lastPos}displacePosition(t){this.m_lastPos.fromBufferAttribute(this.originalAttribute,t);const e=this.m_normals;this.m_tmpNormal.fromBufferAttribute(e,t);const i=this.m_uvs,r=(0,n.clamp)(i.getX(t),0,1),o=(0,n.clamp)(i.getY(t),0,1),a=(0,s.sampleBilinear)(this.m_texture,this.m_textureWidth,this.m_textureHeight,r,o);this.m_lastPos.add(this.m_tmpNormal.multiplyScalar(a))}}e.DisplacedBufferAttribute=l,l.MAX_CACHE_SIZE=6},8246:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DisplacedBufferGeometry=e.displaceBox=void 0;const r=i(3148),n=i(2754),o=i(5381),s=i(6815),a=i(544),l=new s.Vector3,c=new s.Vector3,h=new n.Box3;function u(t,e,i){h.copy(t);const r=l.copy(i),n=c.copy(r);return t.translate(r.multiplyScalar(e.min)).union(h.translate(n.multiplyScalar(e.max))),t}e.displaceBox=u;class p extends r.BufferGeometry{constructor(t,e,i,r){super(),this.originalGeometry=t,this.displacementRange=i,this.m_originalBoundingBox=new n.Box3,this.m_displacedPositions=r||new a.DisplacedBufferAttribute(t.attributes.position,t.attributes.normal,t.attributes.uv,e),this.resetAttributes()}reset(t,e,i){this.originalGeometry=t;const r=t.attributes.position,n=t.attributes.normal,o=t.attributes.uv;this.m_displacedPositions.reset(r,n,o,e);const s=this.displacementRange.min!==i.min||this.displacementRange.max!==i.max;this.displacementRange=i,this.resetAttributes(),this.resetBoundingVolumes(s)}computeBoundingBox(){null===this.originalGeometry.boundingBox&&this.originalGeometry.computeBoundingBox();const t=this.m_originalBoundingBox.copy(this.originalGeometry.boundingBox);null===this.boundingBox?this.boundingBox=t.clone():this.boundingBox.copy(t),u(this.boundingBox,this.displacementRange,l.fromBufferAttribute(this.attributes.normal,0))}computeBoundingSphere(){null===this.boundingBox&&this.computeBoundingBox(),null===this.boundingSphere&&(this.boundingSphere=new o.Sphere),this.boundingBox.getBoundingSphere(this.boundingSphere)}
2needsBoundingBoxUpdate(t){return t||null!==this.boundingBox&&(!this.originalGeometry.boundingBox||!this.m_originalBoundingBox.equals(this.originalGeometry.boundingBox))}resetBoundingVolumes(t){this.needsBoundingBoxUpdate(t)&&(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}}e.DisplacedBufferGeometry=p},946:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DisplacedMesh=void 0;const r=i(3148),n=i(5269),o=i(7941),s=i(4250),a=i(4342),l=i(544),c=i(8246);class h extends n.Mesh{static getDisplacedPositionAttribute(t,e){return h.displacedPositions?h.displacedPositions.reset(t.attributes.position,t.attributes.normal,t.attributes.uv,e):h.displacedPositions=new l.DisplacedBufferAttribute(t.attributes.position,t.attributes.normal,t.attributes.uv,e),h.displacedPositions}constructor(t,e,i,r){super(t,e),this.m_getDisplacementRange=i,this.m_raycastStrategy=r}raycast(t,e){const i=this.firstMaterial;if(!function(t){const e=(0,s.hasDisplacementFeature)(t);return(0,a.assert)(e,"Material does not support displacement maps."),e}(i)||!function(t){if(!t)return!1;const e=t instanceof o.DataTexture;return(0,a.assert)(e,"Material does not support displacement maps."),e}(i.displacementMap))return void super.raycast(t,e);const n=i.displacementMap,l=Object.assign({},this.m_getDisplacementRange());(0,a.assert)(this.geometry instanceof r.BufferGeometry,"Unsupported geometry type.");const u=this.geometry;this.displacedGeometry?this.displacedGeometry.reset(u,n,l):this.displacedGeometry=new c.DisplacedBufferGeometry(u,n,l,h.getDisplacedPositionAttribute(u,n)),this.geometry=this.displacedGeometry,this.m_raycastStrategy?this.m_raycastStrategy(this,t,e):super.raycast(t,e),super.geometry=this.displacedGeometry.originalGeometry}get firstMaterial(){return Array.isArray(this.material)?this.material[0]:this.material}}e.DisplacedMesh=h},6473:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LodMesh=void 0;const r=i(3334),n=i(5269);class o extends n.Mesh{constructor(t,e){super(void 0,e),this.geometries=t}set geometries(t){this.m_geometries!==t&&this.disposeGeometries(),this.m_geometries=t,this.geometries&&this.m_geometries.length>0&&(this.geometry=this.m_geometries[0])}get geometries(){return this.m_geometries}setLevelOfDetail(t){this.m_geometries&&0!==this.m_geometries.length&&(t=(0,r.clamp)(t,0,this.m_geometries.length-1),this.geometry=this.m_geometries[t])}disposeGeometries(){if(this.m_geometries)for(const t of this.m_geometries)t.dispose();this.geometry.dispose()}}e.LodMesh=o},7987:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Object3DUtils=void 0;const r=i(9365),n=i(6280),o=i(6307),s=i(2578),a=i(977),l=i(3905),c=i(4085),h=i(1498),u=i(3334),p=i(5808),d=i(394),m=i(4250),f=i(4342),g=i(1447),y=f.LoggerManager.instance.create("Object3DUtils");!function(t){function e(t){if(!t.image)return 0;const e=t.image;return 4*e.width*e.height}function i(t,i,r){if(!t)return;if(void 0!==t.uuid&&!0===r.get(t.uuid))return;r.set(t.uuid,!0);const n=e(t);i.heapSize+=n,i.gpuSize+=n}function f(t,e,r){if(void 0===t.uuid||!0!==r.get(t.uuid))if(r.set(t.uuid,!0),t instanceof c.RawShaderMaterial||t instanceof h.ShaderMaterial){const n=t;for(const t in n.uniforms)if(void 0!==n.uniforms[t]){const o=n.uniforms[t];o instanceof d.Texture&&i(o,e,r)}}else if(t instanceof a.MeshBasicMaterial||t instanceof m.MapMeshBasicMaterial){const n=t;i(n.map,e,r),i(n.aoMap,e,r),i(n.specularMap,e,r),i(n.alphaMap,e,r),i(n.envMap,e,r)}else if(t instanceof m.MapMeshStandardMaterial){const n=t;i(n.map,e,r),i(n.lightMap,e,r),i(n.aoMap,e,r),i(n.emissiveMap,e,r),i(n.bumpMap,e,r),i(n.normalMap,e,r),i(n.displacementMap,e,r),i(n.roughnessMap,e,r),i(n.metalnessMap,e,r),i(n.alphaMap,e,r),i(n.envMap,e,r)}else if(t instanceof m.MapMeshPhongMaterial){const n=t;i(n.map,e,r),i(n.lightMap,e,r),i(n.aoMap,e,r),i(n.emissiveMap,e,r),i(n.bumpMap,e,r),i(n.normalMap,e,r),i(n.displacementMap,e,r),i(n.specularMap,e,r),i(n.alphaMap,e,r),i(n.envMap,e,r)}else t instanceof o.LineBasicMaterial||t instanceof s.LineDashedMaterial||t instanceof l.PointsMaterial||y.warn("estimateMeshSize: unidentified material: ",t)}function v(t,e,i,o){if(void 0===t.uuid&&(t.uuid=(0,u.generateUUID)()),!0===o.get(t.uuid))return;o.set(t.uuid,!0);let s=0,a=4;void 0!==t.array.BYTES_PER_ELEMENT&&(a=t.array.BYTES_PER_ELEMENT),t instanceof n.InterleavedBufferAttribute||t instanceof r.BufferAttribute?s=a*t.count*t.itemSize:y.warn("estimateMeshSize: unidentified attribute: ",e),i.heapSize+=s+56,i.gpuSize+=s}function _(t,e,i){if(void 0!==t.uuid&&!0===i.get(t.uuid))return;if(i.set(t.uuid,!0),void 0===t)return;const r=t.attributes;if(void 0!==r){for(const t in r)void 0!==r[t]&&v(r[t],t,e,i);null!==t.index&&v(t.index,"index",e,i)}else y.warn("estimateGeometrySize: unidentified geometry: ",t)}t.getTextureSize=e,t.estimateSize=function t(e,i,r){const n=void 0!==i?i:{heapSize:0,gpuSize:0};
2if(void 0===r&&(r=new Map),function(t,e,i){if(t.isObject3D&&!(t instanceof p.Scene)&&(void 0===t.uuid||!0!==i.get(t.uuid)))if(i.set(t.uuid,!0),t.isMesh||t.isLine||t.isPoints){let r=1e3;const n=0,o=t;if(void 0!==o.material)if(Array.isArray(o.material)){const t=o.material;for(const r of t)f(r,e,i)}else f(o.material,e,i);if(void 0!==o.geometries)for(const t of o.geometries)_(t,e,i);else void 0!==o.geometry&&_(o.geometry,e,i);const s=void 0!==t.userData?t.userData.feature:void 0;void 0!==s&&(r+=(0,g.getFeatureDataSize)(s)),e.heapSize+=r,e.gpuSize+=n}else y.warn("estimateMeshSize: unidentified object",t)}(e,n,r),e.children.length>0)for(const i of e.children)t(i,n,r);return n}}(e.Object3DUtils||(e.Object3DUtils={}))},21:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.projectTilePlaneCorners=void 0;const r=i(6815),n=i(2616);e.projectTilePlaneCorners=function(t,e){const{east:i,west:o,north:s,south:a}=t.geoBox;return{sw:e.projectPoint(new n.GeoCoordinates(a,o),new r.Vector3),se:e.projectPoint(new n.GeoCoordinates(a,i),new r.Vector3),nw:e.projectPoint(new n.GeoCoordinates(s,o),new r.Vector3),ne:e.projectPoint(new n.GeoCoordinates(s,i),new r.Vector3)}}},4772:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.registerTileObject=void 0;const r=i(4572);e.registerTileObject=function(t,e,i){r.MapObjectAdapter.create(e,Object.assign({dataSource:t.dataSource,tileKey:t.tileKey},i)),t.resetVisibilityCounter()}},8673:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SolidLineMesh=void 0;const r=i(3148),n=i(2754),o=i(414),s=i(3334),a=i(8333),l=i(3850),c=i(2309),h=i(5381),u=i(6815),p=i(5269),d=i(2616),m=i(4250),f=i(4342),g=i(8246),y=new h.Sphere,v=new a.Matrix4,_=new c.Ray,b=new o.Line3,x=new n.Box3,w=new d.OrientedBox3,S=new l.Plane,T=new u.Vector3,E=new u.Vector3,M=new u.Vector3,A=new u.Vector3,C=new u.Vector3,P=new u.Vector3(0,0,1);function L(t,e,i){let r;t instanceof g.DisplacedBufferGeometry&&(r=t.displacementRange,t=t.originalGeometry);const n=t.attributes.position,o=t.index.array,s=new h.Sphere,a=x.makeEmpty(),l=T;for(let t=e;t<i;t+=6)a.expandByPoint(l.fromBufferAttribute(n,o[t])),a.expandByPoint(l.fromBufferAttribute(n,o[t+2]));if(r){const e=E;return e.fromBufferAttribute(t.attributes.normal,0),(0,g.displaceBox)(a,r,e).getBoundingSphere(s)}return a.getBoundingSphere(s)}function R(t,e,i,r,n,o,s,a){if(s.equals(t.origin)&&0===t.direction.dot(o.normal)){const n=function(t,e,i,r,n){var o;const s=w;return e.getCenter(s.position),e.delta(s.xAxis).normalize(),s.yAxis.copy(i),s.zAxis.copy(r),s.extents.set(e.distance()/2,n,n),s.contains(t.origin)?0:null!==(o=s.intersectsRay(t))&&void 0!==o?o:1/0}(t,e,i,o.normal,r),s=function(t,e,i){const r=new h.Sphere(e.start,i),n=r.containsPoint(t.origin)?0:t.intersectSphere(r,A)?A.sub(t.origin).length():1/0;r.center.copy(e.end);const o=r.containsPoint(t.origin)?0:t.intersectSphere(r,A)?A.sub(t.origin).length():1/0;return Math.min(n,o)}(t,e,r),l=Math.min(n,s);return l!==1/0&&(t.at(l,a),!0)}return!(s.distanceToSquared(e.closestPointToPoint(s,!0,A))>n||(a.copy(s),0))}function I(t,e,i,r,n,o,a,l,c,h,u){const p=T,d=S,m=E,f=E,g=b,v=M,_=M,x=A,w=C,L=t.geometry,I=L.index.array,O=L.attributes,D=O.position,k=O.tangent,N=O.tangent2;if(y.copy(c),y.applyMatrix4(t.matrixWorld),y.radius+=r,e.ray.intersectsSphere(y))for(let r=a;r<l;r+=6){const a=I[r],l=I[r+2];if(g.start.fromBufferAttribute(D,a),g.end.fromBufferAttribute(D,l),w.set(k.getX(a),k.getY(a),k.getZ(a)).normalize(),p.copy(w).applyAxisAngle(P,.5*Math.PI).normalize().negate(),0!==h){x.copy(p).multiplyScalar(h),f.set(N.getX(a),N.getY(a),N.getZ(a)).normalize();const t=w.angleTo(f),e=t*s.RAD2DEG;if(e>0&&e<180){const e=h*Math.abs(Math.tan(.5*t));_.crossVectors(w,f).normalize(),x.add(w.multiplyScalar(e*_.z))}g.start.add(x),g.end.add(x)}if(d.setFromCoplanarPoints(g.start,v.copy(g.start).add(p),g.end),0===d.normal.manhattanLength())continue;if(!i.intersectPlane(d,m))continue;const c=M;if(!R(i,g,p,n,o,d,m,c))continue;const y=c.applyMatrix4(t.matrixWorld),b=e.ray.origin.distanceTo(y);b<e.near||b>e.far||u.push({distance:b,point:y.clone(),index:r,object:t})}}const O=[0],D=.01;function k(t,e,i,n,o,s,a){var l;const c=t.userData,h=c.feature.boundingVolumes;(0,f.assert)(t.geometry instanceof r.BufferGeometry,"Unsupported geometry type.");const u=t.geometry;(0,f.assert)(function(t){return Array.isArray(t)?t.every(t=>t instanceof m.SolidLineMaterial):t instanceof m.SolidLineMaterial}(e),"Unsupported material type");const p=e,d=p.width/2;(0,f.assert)(Math.abs(1-t.scale.x/t.scale.y)<D),(0,f.assert)(Math.abs(1-t.scale.x/t.scale.z)<D),(0,f.assert)(Math.abs(1-t.scale.y/t.scale.z)<D);const g=d/((t.scale.x+t.scale.y+t.scale.z)/3),y=g*g,v=null!==(l=c.feature.starts)&&void 0!==l?l:O;let _=o,b=v[_];const x=v.length-1;for(;b<s;){const e=_,r=_<x?v[++_]:s;e>=h.length&&h.push(L(u,b,r)),I(t,i,n,d,g,y,b,r,h[e],p.offset,a),b=r}return _}class N extends p.Mesh{static raycast(t,e,i){var n;(0,f.assert)(t.geometry instanceof r.BufferGeometry,"Unsupported geometry type");const o=t.geometry;(0,f.assert)(null!==o.index,"Geometry does not have indices");const s=t.matrixWorld;v.copy(s).invert();const a=_.copy(e.ray).applyMatrix4(v),l=t.userData,c=null!==(n=l.feature)&&void 0!==n?n:l.feature={};void 0===l.feature&&(l.feature={});const h=o.attributes.position,u=c.attributeInfo;(void 0===u||void 0===c.boundingVolumes||function(t,e){const i=t.isBufferAttribute,r=i?t:t.data;return void 0===e||e.data!==r||i&&e.version!==r.version}(h,u))&&(c.boundingVolumes=[],c.attributeInfo=function(t){const e=t.isBufferAttribute?t:t.data;return{data:e,version:e.version}}(h));const p=o.index.array;if(Array.isArray(t.material)){let r=0;for(const n of o.groups)r=k(t,t.material[n.materialIndex],e,a,r,n.start+n.count,i)}else k(t,t.material,e,a,0,p.length,i)}constructor(t,e){super(t,e)}raycast(t,e){N.raycast(this,t,e)}}e.SolidLineMesh=N},5571:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.TileDataAccessor=void 0;const r=i(8152),n=i(4342),o=i(4269),s=n.LoggerManager.instance.create("TileDataAccessor");e.TileDataAccessor=class{constructor(t,e,i){this.tile=t,this.visitor=e;const r=!0===i.wantsAll;this.m_wantsPoints=r||!(!1===i.wantsPoints),this.m_wantsLines=r||!(!1===i.wantsLines),this.m_wantsAreas=r||!(!1===i.wantsAreas),this.m_wantsObject3D=r||!(!1===i.wantsObject3D)}visitAll(){const t=this.tile.objects;for(const e of t)this.visitObject(e)}visitObject(t){const e=void 0!==t.userData?t.userData.feature:void 0;if(void 0===e||void 0!==e.objInfos&&1===e.objInfos.length&&!this.visitor.wantsFeature((0,r.getFeatureId)(e.objInfos[0])))return;const i=e.geometryType;if(void 0===i)return void s.warn("#visitObject: visiting object failed, no geometryType",t);switch((0,n.assert)(void 0!==e.objInfos,"featureData.ids missing"),(0,n.assert)(void 0!==e.starts,"featureData.starts missing"),(0,n.assert)(Array.isArray(e.starts),"featureData.starts is not an array"),void 0!==e.objInfos&&void 0!==e.starts&&(0,n.assert)(e.objInfos.length===e.starts.length,"featureData.ids and featureData.starts have unequal length"),i){case r.GeometryType.Point:case r.GeometryType.Text:if(!this.m_wantsPoints)return;break;case r.GeometryType.SolidLine:case r.GeometryType.ExtrudedLine:case r.GeometryType.TextPath:if(!this.m_wantsLines)return;break;case r.GeometryType.Polygon:case r.GeometryType.ExtrudedPolygon:if(!this.m_wantsAreas)return;break;case r.GeometryType.Object3D:if(!this.m_wantsObject3D)return;break;default:s.warn("#visitObject: invalid geometryType")}if("Mesh"!==t.type)return void s.warn("#visitObject: visiting object failed, not of type 'Mesh'",t);const o=t;this.visitMesh(o,e)}getBufferGeometry(t){const e=t.geometry;if("BufferGeometry"!==e.type)return void s.warn("#visitObject: object does not have BufferGeometry");const i=e;if(i.getAttribute("position"))return i;s.warn("#visitLines: BufferGeometry has no position attribute")}getGeometryAccessor(t,e,i){switch(t){case r.GeometryType.Point:case r.GeometryType.Text:return;case r.GeometryType.SolidLine:case r.GeometryType.ExtrudedLine:case r.GeometryType.TextPath:return new o.BufferedGeometryLineAccessor(e,t,i);case r.GeometryType.Polygon:case r.GeometryType.ExtrudedPolygon:return;case r.GeometryType.Object3D:return new o.BufferedGeometryObject3dAccessor(e,t,i);default:s.warn("#getGeometryAccessor: invalid geometryType")}}getIndexedGeometryAccessor(t,e,i){switch(t){case r.GeometryType.Point:case r.GeometryType.Text:return;case r.GeometryType.SolidLine:case r.GeometryType.ExtrudedLine:case r.GeometryType.TextPath:return new o.IndexedBufferedGeometryLineAccessor(e,t,i);case r.GeometryType.Polygon:case r.GeometryType.ExtrudedPolygon:case r.GeometryType.Object3D:return;default:s.warn("#getIndexedGeometryAccessor: invalid geometryType")}}visitMesh(t,e){const{objInfos:i,starts:a}=e,l=e.geometryType;if(void 0===i||void 0===a||void 0===l)return;let c;for(let e=0;e<i.length;e++){const h=(0,r.getFeatureId)(i[e]);if(!this.visitor.wantsFeature(h))continue;const u=a[e];let p=-1;if(void 0===c){const e=this.getBufferGeometry(t);if(void 0===e)continue;if(c=null!==e.index?this.getIndexedGeometryAccessor(l,t,e):this.getGeometryAccessor(l,t,e),void 0===c){s.warn("#visitObject: no accessor geometryType",l);continue}}switch(p=e<a.length-1?a[e+1]:c.getCount(),c.setRange(u,p),l){case r.GeometryType.Point:case r.GeometryType.Text:this.visitor.visitPoint(h);break;case r.GeometryType.SolidLine:case r.GeometryType.ExtrudedLine:case r.GeometryType.TextPath:(0,n.assert)((0,o.isLineAccessor)(c)),this.visitor.visitLine(h,c);break;case r.GeometryType.Polygon:case r.GeometryType.ExtrudedPolygon:this.visitor.visitArea(h);break;case r.GeometryType.Object3D:(0,n.assert)((0,o.isObject3dAccessor)(c)),this.visitor.visitObject3D(h,c);break;default:s.warn("#visitObject: invalid geometryType")}}}}},4269:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IndexedBufferedGeometryLineAccessor=e.IndexedBufferedGeometryAccessor=e.BufferedGeometryObject3dAccessor=e.BufferedGeometryLineAccessor=e.BufferedGeometryAccessor=e.BufferedGeometryAccessorBase=e.isObject3dAccessor=e.isLineA
2ccessor=void 0;const r=i(8152),n=i(3211),o=i(4342),s=o.LoggerManager.instance.create("TileGeometry");e.isLineAccessor=function(t){return"function"==typeof t.isLineAccessor&&!0===t.isLineAccessor()},e.isObject3dAccessor=function(t){return"function"==typeof t.isObject3dAccessor&&!0===t.isObject3dAccessor()};class a{constructor(t,e,i){this.object=t,this.geometryType=e,this.bufferGeometry=i,this.start=-1,this.end=-1,this.startCapSize=0,this.endCapSize=0,(0,o.assert)(!!t),"BufferGeometry"!==i.type&&s.error("IndexedBufferedGeometryAccessor#constructor: BufferGeometry has wrong type"),(0,o.assert)("BufferGeometry"===i.type,"IndexedBufferedGeometryAccessor#constructor: BufferGeometry has wrong type"),this.position=this.bufferGeometry.getAttribute("position"),this.itemSize=this.position.itemSize,this.position||s.warn("BufferedGeometryAccessor#constructor: BufferGeometry has no position attribute"),this.position.array.constructor!==Float32Array&&s.warn("BufferedGeometryAccessor#constructor: BufferGeometry.position: unsupported ArrayBuffer")}getCount(){return this.position.count}get renderOrder(){return this.object.renderOrder}setRange(t,e,i=0,r=0){(0,o.assert)(t>=0),(0,o.assert)(e>=0),(0,o.assert)(t<=e),this.start=t,this.end=e,this.startCapSize=i,this.endCapSize=r}get color(){const t=t=>{const e=t;if("MeshBasicMaterial"===e.type||"MeshStandardMaterial"===e.type)return e.color;if("RawShaderMaterial"===e.type){const e=t;if("SolidLineMaterial"===e.name)return e.uniforms.diffuseColor.value;s.warn("BufferedGeometryAccessor#color: unknown shader material name",e.name)}else s.warn("BufferedGeometryAccessor#color: unknown material type",e.type)};if(Array.isArray(this.object.material)){const e=new Array,i=this.object.material;for(const r of i)e.push(t(r));return e}return t(this.object.material)}}e.BufferedGeometryAccessorBase=a;class l extends a{constructor(t,e,i,r){super(t,e,i),this.object=t,this.geometryType=e,this.bufferGeometry=i,this.stride=r}clear(){(0,o.assert)(this.checkSetUp(),"BufferedGeometryAccessor not setup");const t=this.position.array,e=this.start*this.itemSize,i=this.end*this.itemSize;for(let r=e;r<i;r++)t[r]=0;this.position.needsUpdate=!0}getVertices(){(0,o.assert)(this.checkSetUp(),"BufferedGeometryAccessor not setup");const t=this.start,e=this.end;return this.position.array.subarray(t*this.itemSize,e*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}}e.BufferedGeometryAccessor=l,e.BufferedGeometryLineAccessor=class extends l{constructor(t,e,i){super(t,e,i,3),this.object=t,this.geometryType=e,this.bufferGeometry=i}isLineAccessor(){return!0}get width(){(0,o.assert)(this.checkSetUp(),"RoBufferedGeometryLineAccessor not setup")}},e.BufferedGeometryObject3dAccessor=class extends l{constructor(t,e,i){super(t,e,i,1),this.object=t,this.geometryType=e,this.bufferGeometry=i}isObject3dAccessor(){return!0}getVertices(){return super.getVertices()}};class c extends a{constructor(t,e,i,r,n){super(t,e,i),this.object=t,this.geometryType=e,this.bufferGeometry=i,this.indices=null!==this.bufferGeometry.index?this.bufferGeometry.index.array:void 0,this.indices?this.indices instanceof Uint32Array||(s.warn("IndexedBufferedGeometryAccessor#constructor: BufferGeometry index has wrong type"),(0,o.assert)(this.indices instanceof Uint32Array)):(s.warn("IndexedBufferedGeometryAccessor#constructor: BufferGeometry has no index"),(0,o.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}}e.IndexedBufferedGeometryAccessor=c,e.IndexedBufferedGeometryLineAccessor=class extends c{constructor(t,e,i){super(t,e,i,3),this.object=t,this.geometryType=e,this.bufferGeometry=i}isLineAccessor(){return!0}get width(){if((0,o.assert)(this.checkSetUp(),"RoIndexedBufferedGeometryLineAccessor not setup"),this.geometryType===r.GeometryType.ExtrudedLine){const t=this.start+this.startCapSize,e=this.position.array;return(0,n.reconstructLineWidth)(e,t)}}clear(){(0,o.assert)(this.checkSetUp(),"RoIndexedBufferedGeometryLineAccessor not setup");const t=this.start,e=this.end;for(let i=t;i<e;i++)this.indices[i]=0;null!==this.bufferGeometry.index&&(this.bufferGeometry.index.needsUpdate=!0)}getVertices(){(0,o.assert)(this.checkSetUp(),"RoIndexedBufferedGeometryLineAccessor not setup");const t=this.itemSize,e=this.start,i=this.end,r=new Float32Array((i-e)*t),n=this.position.array;if(2===t)for(let o=e,s=0;o<i;o++,s+=t){const e=this.indices[o];r[s+0]=n[e*t+0],r[s+1]=n[e*t+1]}if(3===t)for(let o=e,s=0;o<i;o++,s+=t){const e=this.indices[o];r[s+0]=n[e*t+0],r[s+1]=n[e*t+1],r[s+2]=n[e*t+2]}else for(let o=e,s=0;o<i;o++,s++){const e=this.indices[o];for(let i=0;i<t;i++)r[s*t+i]=n[e*t+i]}return r}}},5912:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.TileGeometryCreator=void 0;const r=i(6271),n=i(9365),o=i(3148),s=i(9044),a=i(6280),l=i(3334),c=i(5448),h=i(6815),u=i(4760),p=i(7941),d=i(8152),m=i(2616),f=i(4250),g=i(1984),y=i(8023),v=i(4342),_=i(5863),b=i(8427),x=i(2476),w=i(5316),S=i(176),T=i(9701),E=i(8024),M=i(4772),A=i(8673),C=v.LoggerManager.instance.create("TileGeometryCreator"),P=new h.Vector3,L=new c.Vector2;class R{constructor(){this.bufferAttributes=new Map,this.interleavedAttributes=new Map}}class I extends y.CallExpr{constructor(t){super("memo",[t]),this.m_cachedProperties=[],this.m_deps=Array.from(t.dependencies().properties),this.descriptor=this}call(t){let e=!1;return this.m_deps.forEach((i,r)=>{const n=t.env.lookup(i);e||n===this.m_cachedProperties[r]||(e=!0),e&&(this.m_cachedProperties[r]=n)}),(e||void 0===this.m_cachedValue)&&(this.m_cachedValue=t.evaluate(this.args[0])),this.m_cachedValue}}class O{constructor(t,e,i){this.geometry=t,this.info=e,this.cache=i}getBufferAttribute(t){if(this.cache.bufferAttributes.has(t))return this.cache.bufferAttributes.get(t);const e=(0,b.getBufferAttribute)(t);return this.cache.bufferAttributes.set(t,e),e}getInterleavedBufferAttributes(t){const e=this.cache.interleavedAttributes.get(t);if(e)return e;const i=new((0,d.getArrayConstructor)(t.type))(t.buffer),r=new s.InterleavedBuffer(i,t.stride),n=t.attributes.map(t=>{const e=new a.InterleavedBufferAttribute(r,t.itemSize,t.offset,!1);return{name:t.name,attribute:e}});return this.cache.interleavedAttributes.set(t,n),n}}function D(t,e){if(Array.isArray(t)){const i=t;e.push(...i)}else e.push(t)}class k{static get instance(){return this.m_instance||(this.m_instance=new k)}constructor(){}initDecodedTile(t){for(const e of t.geometries)for(const t of e.groups)t.createdOffsets=[]}createAllGeometries(t,e){const i=this.createObjects(t,e);if(this.addIconTexts(t,e),this.createIconTexts(t,e,t=>(0,g.isIconTextTechnique)(t)||(0,g.isLineMarkerTechnique)(t)||(0,g.isTextTechnique)(t)),this.createLabelRejectionElements(t,e),t.dataSource.addGroundPlane&&t.projection.type===m.ProjectionType.Planar){const e=t.mapView.getDataSourceByName(_.BackgroundDataSource.NAME);(0,E.addGroundPlane)(t,-1,null==e?void 0:e.backgroundColor)}return i}createLabelRejectionElements(t,e){if(void 0!==e.pathGeometries)for(const i of e.pathGeometries)t.addBlockingElement(new T.PathBlockingElement(i.path))}processTechniques(t,e=!1){var i,r;const n=t.decodedTile;if(void 0===n)return!1;const o=n.techniques.length;if(0===o)return!0;const s=null!==(i=n.nextChunkTechIdx)&&void 0!==i?i:0;let a=s,l=null!==(r=n.nextChunkPropIdx)&&void 0!==r?r:0,c=!1;0===a&&0===l&&this.initDecodedTile(n);const h=t.dataSource.exprPool,u=performance.now();t:for(;a<o;){a!==s&&(l=0);const i=n.techniques[a],r=Object.keys(i),p=r.length;for(;l<p;){const n=r[l++],s=i[n];if("kind"!==n&&(0,g.isJsonExpr)(s))try{let t=y.Expr.fromJSON(s);!0!==t.dependencies().volatile&&(t=new I(t)),i[n]=t.intern(h)}catch(t){C.error("Failed to compile expression:",t)}const d=l===p;if(d&&(c=++a===o),!1===e&&performance.now()-u>=3){d&&(l=0);break t}}}return c||(n.nextChunkTechIdx=a,n.nextChunkPropIdx=l),c}prepareTextPaths(t,e,i){const r=new Array,n=t.slice();for(;n.length>0;){const t=n.pop();if(void 0===t)break;const o=e.techniques[t.technique];(0,g.isTextTechnique)(o)&&(void 0===i||i(o))&&r.push(t)}return r}createIconTexts(t,e,i){var r;const o=t.mapView,s=t.computeWorldOffsetX(),a=Math.floor(o.zoomLevel),l=new g.MapEnv({$zoom:a},o.env),c=new w.IconTextBuilder(l,t.textStyleCache,t.dataSource.dataSourceOrder);if(void 0!==e.textPathGeometries){const r=this.prepareTextPaths(e.textPathGeometries,e,i);for(const n of r){const r=e.techniques[n.technique];if(!(0,g.isTextTechnique)(r)||void 0!==i&&!i(r)||!1===r.visible)continue;const o=[];for(let t=0;t<n.path.length;t+=3)o.push(new h.Vector3(n.path[t]+s,n.path[t+1],n.path[t+2]));const a=c.withTechnique(r).build(n.text,o,t.offset,t.dataSource.name,t.dataSource.dataSourceOrder,n.objInfos,n.pathLengthSqr);t.addIconText(a)}}if(void 0!==e.textGeometries)for(const o of e.textGeometries){if(void 0===o.technique||void 0===o.stringCatalog)continue;const a=e.techniques[o.technique];if(!(0,g.isTextTechnique)(a)||void 0!==i&&!i(a)||!1===a.visible)continue;const l=new n.BufferAttribute(new Float64Array(o.positions.buffer),o.positions.itemCount),u=l.count;if(!(u<1)){c.withTechnique(a);for(let e=0;e<u;++e){const i=l.getX(e)+s,n=l.getY(e),a=l.getZ(e),u=o.stringCatalog[o.texts[e]];if(void 0===u)continue;const p=null===(r=o.objInfos)||void 0===r?void 0:r[e],d=new h.Vector3(i,n,a),m=c.build(u,d,t.offset,t.dataSource.name,t.dataSource.dataSourceOrder,p);t.addIconText(m)}}}}createObjects(t,e,i){var s,a,c,p;const _=t.mapView,w=[],T=[],E=_.animatedExtrusionHandler,M=Math.floor(_.zoomLevel),C=new g.MapEnv({$zoom:M},_.env),R=t.objects,I=_.viewRanges,O=void 0!==_.elevationProvider,k=[];for(const M of this.getAttachments(e)){const N=M.geometry,F=M.info.groups,U=F.length;for(let z=0;z<U;){const j=F[z++],B=j.start,V=j.technique,G=e.techniques[V];if(void 0===j.createdOffsets&&(j.createdOffsets=[]),j.createdOffsets.includes(t.offset)||void 0!==i&&!i(G))continue;let H=j.count;for(j.createdOffsets.push(t.offset);z<U&&F[z].technique===V&&B+H===F[z].start;++z)H+=F[z].count,F[z].createdOffsets.push(t.offset);if(!(0,b.usesObject3D)(G))continue;const q=null!==(s=null==E?void 0:E.setAnimationProperties(G,C))&&void 0!==s&&s;let W=w[V];if(void 0===W){const t=(0,b.createMaterial)(G,_,{fog:null!==_.scene.fog,shadowsEnabled:_.shadowsEnabled});if(void 0===t)continue;W=t.material,k.push(t.texturesReady),q&&(0,f.hasExtrusionFeature)(W)&&D(W,T),w[V]=W}(0,g.isTerrainTechnique)(G)&&this.setupTerrainMaterial(G,W,t.mapView.clearColor);const X=new o.BufferGeometry;null===(a=N.vertexAttributes)||void 0===a||a.forEach(t=>{const e=M.getBufferAttribute(t);X.setAttribute(t.name,e)}),null===(c=N.interleavedVertexAttributes)||void 0===c||c.forEac
2h(t=>{M.getInterleavedBufferAttributes(t).forEach(({name:t,attribute:e})=>X.setAttribute(t,e))});const Y=null!==(p=M.info.index)&&void 0!==p?p:N.index;if(Y&&X.setIndex(M.getBufferAttribute(Y)),!X.getAttribute("normal")&&(0,g.needsVertexNormals)(G)&&X.computeVertexNormals(),X.addGroup(B,H),(0,g.isSolidLineTechnique)(G)){(0,v.assert)(!(0,f.isHighPrecisionLineMaterial)(W));const e=W;if(1===e.uniforms.wireframe.value){const t=[new h.Vector3(1,0,0),new h.Vector3(0,1,0),new h.Vector3(0,0,1)],e=X.attributes.position,i=new Float32Array(3*e.count);for(let r=0,n=e.count;r<n;r++)t[r%3].toArray(i,3*r);X.setAttribute("barycentric",new n.BufferAttribute(i,3))}!0===G.clipping&&t.projection.type===m.ProjectionType.Planar&&(t.boundingBox.getSize(P),L.set(P.x,P.y),e.clipTileSize=L),X.getAttribute("color")&&(0,f.setShaderMaterialDefine)(e,"USE_COLOR",!0)}const K=y.Expr.isExpr(G.visible)&&N.featureStarts&&N.featureStarts.length>0,Z=(0,b.buildObject)(G,X,K?[W]:W,t,O);if(Z.renderOrder=(0,d.getPropertyValue)(G.renderOrder,_.env),void 0!==M.info.uuid&&(Z.uuid=M.info.uuid,Z.userData.geometryId=M.info.uuid),((0,g.isCirclesTechnique)(G)||(0,g.isSquaresTechnique)(G))&&void 0!==G.enablePicking&&(Z.enableRayTesting=G.enablePicking),(0,g.isLineTechnique)(G)||(0,g.isSegmentsTechnique)(G)){const t=this.getFadingParams(C,G);f.FadingFeature.addRenderHelper(Z,I,t.fadeNear,t.fadeFar,!1)}if((0,g.isSolidLineTechnique)(G)){const t=this.getFadingParams(C,G);f.FadingFeature.addRenderHelper(Z,I,t.fadeNear,t.fadeFar,!1)}if((0,g.isExtrudedLineTechnique)(G)&&void 0!==G.fadeFar){const t=this.getFadingParams(_.env,G);f.FadingFeature.addRenderHelper(Z,I,t.fadeNear,t.fadeFar,!0)}if((0,g.isExtrudedPolygonTechnique)(G)?(Z.castShadow=_.shadowsEnabled,Z.receiveShadow=_.shadowsEnabled):((0,g.isStandardTechnique)(G)||(0,g.isPolygonTechnique)(G))&&(Z.receiveShadow=_.shadowsEnabled),((0,g.isExtrudedPolygonTechnique)(G)||(0,g.isStandardTechnique)(G)||(0,g.isPolygonTechnique)(G))&&void 0!==G.fadeFar){const t=this.getFadingParams(C,G);f.FadingFeature.addRenderHelper(Z,I,t.fadeNear,t.fadeFar,!0)}if((0,g.isExtrudedPolygonTechnique)(G)&&(0,x.isRenderDepthPrePassEnabled)(G,C)){const e=(0,x.createDepthPrePassMesh)(Z);this.addUserData(t,N,e,{technique:G,pickability:g.Pickability.transient}),R.push(e),q&&D(e.material,T),(0,x.setDepthPrePassStencil)(e,Z)}const $=(0,g.transientToPickability)((0,d.getPropertyValue)(G.transient,_.env));if(this.addUserData(t,N,Z,{technique:G,pickability:$}),R.push(Z),(0,g.isSolidLineTechnique)(G)){const e=W;if(e.opacity*e.color.a<1||e["dash-pattern"].x>0&&e.opacity*e["dash-gap-color"].a<1){const i=(0,b.createMaterial)(G,_,{fog:null!==_.scene.fog,shadowsEnabled:_.shadowsEnabled});if(void 0===i)continue;const r=i.material;e.antiAliasingPixelRange=0,r.color=e.color.clone(),r.antiAliasingPixelRange=1.2;const n=new A.SolidLineMesh(X,r);this.addUserData(t,N,n,{technique:G,pickability:g.Pickability.transient}),R.push(n),n.renderOrder=Z.renderOrder}}if((0,g.isExtrudedPolygonTechnique)(G)&&void 0!==M.info.edgeIndex){const e=y.Expr.isExpr(G.visible)&&N.edgeFeatureStarts&&N.edgeFeatureStarts.length>0,i=G,r=new o.BufferGeometry;r.setAttribute("position",X.getAttribute("position"));const n=X.getAttribute("color");void 0!==n&&r.setAttribute("color",n);const s=X.getAttribute("extrusionAxis");void 0!==s&&r.setAttribute("extrusionAxis",s);const a=X.getAttribute("normal");void 0!==a&&r.setAttribute("normal",a);const c=X.getAttribute("uv");void 0!==c&&r.setAttribute("uv",c),r.setIndex(M.getBufferAttribute(M.info.edgeIndex));const h=G,p=this.getPolygonFadingParams(C,h),m={color:p.color,colorMix:p.colorMix,fadeNear:p.lineFadeNear,fadeFar:p.lineFadeFar,extrusionRatio:q?0:void 0,vertexColors:!!X.getAttribute("color"),rendererCapabilities:_.renderer.capabilities},v=new f.EdgeMaterial(m),b=new u.LineSegments(r,e?[v]:v);b.renderOrder=Z.renderOrder+.1,f.FadingFeature.addRenderHelper(b,I,p.lineFadeNear,p.lineFadeFar,!1),q&&D(b.material,T),this.addUserData(t,N,b,{technique:G,pickability:g.Pickability.transient}),S.MapMaterialAdapter.create(v,{color:i.lineColor,objectColor:i.color,opacity:i.opacity,lineWidth:t=>{const e=(0,d.getPropertyValue)(i.lineWidth,t.env);return"number"==typeof e?(0,l.clamp)(e,0,1):0}}),R.push(b)}if((0,g.isExtrudedPolygonTechnique)(G)&&q&&(Z.customDepthMaterial=new f.MapMeshDepthMaterial({depthPacking:r.RGBADepthPacking}),D(Z.customDepthMaterial,T)),(0,g.isPolygonTechnique)(G)&&M.info.edgeIndex){const e=y.Expr.isExpr(G.visible)&&N.edgeFeatureStarts&&N.edgeFeatureStarts.length>0,i=new o.BufferGeometry;i.setAttribute("position",X.getAttribute("position")),i.setIndex(M.getBufferAttribute(M.info.edgeIndex));const r=G,n=this.getPolygonFadingParams(_.env,r),s={color:n.color,colorMix:n.colorMix,fadeNear:n.lineFadeNear,fadeFar:n.lineFadeFar,vertexColors:!!X.getAttribute("color"),rendererCapabilities:_.renderer.capabilities},a=new f.EdgeMaterial(s),l=new u.LineSegments(i,e?[a]:a);l.renderOrder=Z.renderOrder+.1,f.FadingFeature.addRenderHelper(l,I,n.lineFadeNear,n.lineFadeFar,!1),this.addUserData(t,N,l,{technique:G,pickability:$}),S.MapMaterialAdapter.create(a,{color:r.lineColor,objectColor:r.color,opacity:r.opacity}),R.push(l)}}}return T.length>0&&_.animatedExtrusionHandler.add(t,T),Promise.all(k).then()}addIconTexts(t,e){void 0!==e.iconTextGeometries&&t.mapView.imageRepo.iconTextManager.addIconTexts(t,e)}*getAttachments(t){const e=new R;for(const i of t.geometries){const t={index:i.index,edgeIndex:i.edgeIndex,uuid:i.uuid,groups:i.groups};if(yield new O(i,t,e),i.attachments)for(const t of i.attachments)yield new O(i,t,e)}}setupTerrainMaterial(t,e,i){if(!t.map||!t.displacementMap){const t=e;return t.color.set(i),void(0,f.setDisplacementMapToMaterial)(null,t)}e.onBeforeCompile=t=>{t.fragmentShader=t.fragmentShader.replace("#include <map_pars_fragment>","#include <map_pars_fragment>\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;"),t.fragmentShader=t.fragmentShader.replace("#include <map_fragment>",`#ifdef USE_MAP\n float minElevation = ${m.EarthConstants.MIN_ELEVATION.toFixed(1)};\n float maxElevation = ${m.EarthConstants.MAX_ELEVATION.toFixed(1)};\n float elevationRange = maxElevation - minElevation;\n\n float disp = texture2D( displacementMap, vUv ).x * displacementScale + dis
2placementBias;\n vec4 texelColor = texture2D( map, vec2((disp - minElevation) / elevationRange, 0.0) );\n texelColor = mapTexelToLinear( texelColor );\n diffuseColor *= texelColor;\n#endif`),t.vertexShader=t.vertexShader.replace("#include <displacementmap_vertex>","")},e.displacementMap.needsUpdate=!0}addUserData(t,e,i,n){const o=n.technique;if((0,g.isTerrainTechnique)(o)){(0,v.assert)(0===Object.keys(i.userData).length,"Unexpected user data in terrain object"),(0,v.assert)("object"==typeof e.objInfos[0],"Wrong attribute map type for terrain geometry");const n=e.objInfos[0],o={tileKey:t.tileKey,texture:new p.DataTexture(n.buffer,n.xCountVertices,n.yCountVertices,r.LuminanceFormat,r.FloatType),displacementMap:n,geoBox:t.geoBox};i.userData=o}else{const r="LineSegments"===i.type&&((0,g.isExtrudedPolygonTechnique)(o)||(0,g.isPolygonTechnique)(o)),s={geometryType:e.type,starts:r?e.edgeFeatureStarts:e.featureStarts,objInfos:e.objInfos};void 0===i.userData&&(i.userData={}),i.userData.feature=s,(0,M.registerTileObject)(t,i,Object.assign({tileKey:t.tileKey,dataSource:t.dataSource},n))}}getFadingParams(t,e){return{fadeNear:void 0!==e.fadeNear?(0,d.getPropertyValue)(e.fadeNear,t):f.FadingFeature.DEFAULT_FADE_NEAR,fadeFar:void 0!==e.fadeFar?(0,d.getPropertyValue)(e.fadeFar,t):f.FadingFeature.DEFAULT_FADE_FAR}}getPolygonFadingParams(t,e){let i,r=f.EdgeMaterial.DEFAULT_COLOR_MIX;if(void 0!==e.lineColor&&(i=(0,d.getPropertyValue)(e.lineColor,t),(0,g.isExtrudedPolygonTechnique)(e))){const t=e;r=void 0!==t.lineColorMix?t.lineColorMix:f.EdgeMaterial.DEFAULT_COLOR_MIX}const n=void 0!==e.fadeNear?(0,d.getPropertyValue)(e.fadeNear,t):f.FadingFeature.DEFAULT_FADE_NEAR,o=void 0!==e.fadeFar?(0,d.getPropertyValue)(e.fadeFar,t):f.FadingFeature.DEFAULT_FADE_FAR,s=void 0!==e.lineFadeNear?(0,d.getPropertyValue)(e.lineFadeNear,t):n,a=void 0!==e.lineFadeFar?(0,d.getPropertyValue)(e.lineFadeFar,t):o;return void 0===i&&(i=f.EdgeMaterial.DEFAULT_COLOR),{color:i,colorMix:r,fadeNear:n,fadeFar:o,lineFadeNear:s,lineFadeFar:a}}}e.TileGeometryCreator=k},1335:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TileGeometryLoader=e.TileGeometryLoaderState=void 0;const r=i(4342),n=i(3977),o=i(8015),s=i(5912);function a(t){const e=o.PerformanceStatistics.instance;if(e.enabled){const i=t.dataSource.name,r=t.tileKey.level,n=t.tileKey.column,o=t.tileKey.row,s=t.disposed?"disposed":"invisible";e.currentFrame.addMessage(`Decoded tile: ${i} # lvl=${r} col=${n} row=${o} DISCARDED - ${s}`)}}var l;!function(t){t[t.Initialized=0]="Initialized",t[t.Decoding=1]="Decoding",t[t.CreationQueued=2]="CreationQueued",t[t.CreatingGeometry=3]="CreatingGeometry",t[t.Finished=4]="Finished",t[t.Canceled=5]="Canceled",t[t.Disposed=6]="Disposed"}(l=e.TileGeometryLoaderState||(e.TileGeometryLoaderState={})),e.TileGeometryLoader=class{constructor(t){this.m_tile=t,this.m_priority=0,this.m_state=l.Initialized,this.m_finishedPromise=new Promise((t,e)=>{this.m_resolveFinishedPromise=t,this.m_rejectFinishedPromise=e})}set priority(t){this.m_priority=t}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(t){return this.m_decodedTile=t,this.m_decodedTile}update(){const t=this.tile;this.m_state!==l.Initialized&&this.m_state!==l.Canceled||void 0===t.decodedTile||this.m_state===l.Initialized&&this.queueDecoder()}cancel(){var t;a(this.tile),this.m_state=l.Canceled,null===(t=this.m_rejectFinishedPromise)||void 0===t||t.call(this)}dispose(){var t;a(this.tile),this.clear(),this.m_state=l.Disposed,null===(t=this.m_rejectFinishedPromise)||void 0===t||t.call(this)}reset(){this.clear(),this.isSettled&&(this.m_finishedPromise=new Promise((t,e)=>{this.m_resolveFinishedPromise=t,this.m_rejectFinishedPromise=e})),this.m_state=l.Initialized}finish(){var t;this.m_decodedTile=void 0,this.m_state=l.Finished,null===(t=this.m_resolveFinishedPromise)||void 0===t||t.call(this)}clear(){this.m_decodedTile=void 0}queueGeometryCreation(){this.m_state!==l.CreationQueued&&this.tile.dataSource.taskQueue&&(this.tile.dataSource.taskQueue.add({execute:this.createGeometry.bind(this),group:n.TileTaskGroups.CREATE,getPriority:this.getPri
2ority.bind(this),isExpired:()=>this.m_state!==l.CreationQueued,estimatedProcessTime:()=>{var t,e;return(null!==(e=null===(t=this.tile.decodedTile)||void 0===t?void 0:t.decodeTime)&&void 0!==e?e:30)/6}}),this.m_state=l.CreationQueued)}queueDecoder(){this.m_state=l.Decoding,this.tile.dataSource.taskQueue?this.tile.dataSource.taskQueue.add({execute:()=>{s.TileGeometryCreator.instance.processTechniques(this.tile)?(this.setDecodedTile(this.tile.decodedTile),this.queueGeometryCreation()):this.queueDecoder()},group:n.TileTaskGroups.CREATE,getPriority:this.getPriority.bind(this),isExpired:()=>this.m_state!==l.Decoding,estimatedProcessTime:()=>{var t,e;return(null!==(e=null===(t=this.tile.decodedTile)||void 0===t?void 0:t.decodeTime)&&void 0!==e?e:30)/6}}):(s.TileGeometryCreator.instance.processTechniques(this.tile,!0),this.setDecodedTile(this.tile.decodedTile),this.m_state=l.CreationQueued,this.createGeometry())}async createGeometry(){if(this.m_state===l.CreatingGeometry)return;this.m_state=l.CreatingGeometry;const t=this.tile,e=this.m_decodedTile;if(void 0===e)return void this.finish();const i=o.PerformanceStatistics.instance;let n=0;i.enabled&&(n=r.PerformanceTimer.now());const a=s.TileGeometryCreator.instance;t.clear(),a.initDecodedTile(e),await a.createAllGeometries(t,e),i.enabled&&this.addStats(i,n),this.finish(),t.dataSource.requestUpdate()}addStats(t,e){const i=this.tile,n=this.m_decodedTile;if(void 0===n)return;const o=r.PerformanceTimer.now()-e,s=t.currentFrame;s.addValue("render.fullFrameTime",o),s.addValue("render.geometryCreationTime",o),s.addValue("geometry.geometryCreationTime",o),s.addValue("geometryCount.numGeometries",n.geometries.length),s.addValue("geometryCount.numTechniques",n.techniques.length),s.addValue("geometryCount.numIconTextGeometries",void 0!==n.iconTextGeometries?n.iconTextGeometries.length:0),s.addValue("geometryCount.numTextGeometries",void 0!==n.textGeometries?n.textGeometries.length:0),s.addValue("geometryCount.numTextPathGeometries",void 0!==n.textPathGeometries?n.textPathGeometries.length:0),s.addValue("geometryCount.numPathGeometries",void 0!==n.pathGeometries?n.pathGeometries.length:0),s.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:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TileGeometryManager=void 0,e.TileGeometryManager=class{get visibilityCounter(){return this.m_visibilityCounter}constructor(t){this.mapView=t,this.m_visibilityCounter=1}updateTiles(t){let e=0;for(const i of t){const t=e++;
2i.updateGeometry(t)&&this.m_tileUpdateCallback&&this.m_tileUpdateCallback(i)}}clear(){}setTileUpdateCallback(t){this.m_tileUpdateCallback=t}incrementVisibilityCounter(){return++this.m_visibilityCounter}}},8813:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VertexCache=void 0;const r=i(4342);var n;!function(t){t[t.VertexId=0]="VertexId",t[t.OlderIdx=1]="OlderIdx",t[t.NewerIdx=2]="NewerIdx",t[t.X=3]="X",t[t.Y=4]="Y",t[t.Z=5]="Z",t[t.Count=6]="Count"}(n||(n={}));const o=-1;e.VertexCache=class{constructor(t){this.maxVertexCount=t,this.m_cache=[],this.m_vertexCount=0,this.m_oldestIdx=0,this.m_newestIdx=0,this.m_cache.length=this.maxVertexCount*n.Count,this.clear()}clear(){this.m_cache.fill(o),this.m_vertexCount=0}get(t,e){const i=this.find(t);return void 0!==i&&(this.promoteEntry(i),this.getVertex(i,e),!0)}set(t,e){let i=o;this.m_vertexCount<this.maxVertexCount?(i=this.m_vertexCount*n.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,t,e)}find(t){const e=this.m_cache.length;for(let i=0;i<e;i+=n.Count)if(this.m_cache[i]===t)return i}promoteEntry(t){if(t===this.m_newestIdx)return;const e=this.getNewerIdx(t),i=this.getOlderIdx(t);e!==o&&((0,r.assert)(this.getOlderIdx(e)===t),this.setOlderIdx(e,i)),i!==o&&((0,r.assert)(this.getNewerIdx(i)===t),this.setNewerIdx(i,e)),t===this.m_oldestIdx&&
2(this.m_oldestIdx=e),this.setNewerIdx(t,o),this.setOlderIdx(t,this.m_newestIdx),(0,r.assert)(this.m_newestIdx!==o),(0,r.assert)(this.getNewerIdx(this.m_newestIdx)===o),this.setNewerIdx(this.m_newestIdx,t),this.m_newestIdx=t}getOlderIdx(t){return this.m_cache[t+n.OlderIdx]}setOlderIdx(t,e){this.m_cache[t+n.OlderIdx]=e}getNewerIdx(t){return this.m_cache[t+n.NewerIdx]}setNewerIdx(t,e){this.m_cache[t+n.NewerIdx]=e}getVertex(t,e){e.x=this.m_cache[t+n.X],e.y=this.m_cache[t+n.Y],e.z=this.m_cache[t+n.Z]}setVertex(t,e,i){this.m_cache[t]=e,this.m_cache[t+n.X]=i.x,this.m_cache[t+n.Y]=i.y,this.m_cache[t+n.Z]=i.z}}},9587:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.overlayOnElevation=e.overlayIconText=void 0;const r=i(4250),n=i(1984),o=i(4342),s=i(4572);function a(t,e){if(!("material"in t))return;const i=r.setDisplacementMapToMaterial.bind(null,e),n=t.material;Array.isArray(n)?n.forEach(i):n&&i(n)}function l(t,e,i,r){const n=r.unprojectPoint(t);if(i.geoBox.contains(n))n.altitude=e.sampleHeight(n,i);else if(n.altitude=e.getHeight(n,i.tileKey.level),void 0===n.altitude)return!1;return r.projectPoint(n,t),!0}e.overlayIconText=function(t,e,i,r){(0,o.assert)(!t.elevated),i&&(t.elevated=t.path?function(t,e,i,r){for(const n of t)if(!l(n,e,i,r))return!1;return!0}(t.path,e,i,r):l(t.position,e,i,r))},e.overlayOnElevation=function(t){const e=t.mapView.elevationProvider;if(void 0===e||0===t.objects.length)return;const i=t.objects[0],r=s.MapObjectAdapter.get(i);if(!i.userData||!(null==r?void 0:r.technique)||(0,n.isTerrainTechnique)(null==r?void 0:r.technique))return;const o=e.getDisplacementMap(t.tileKey);if(void 0!==o)for(const e of t.objects)a(e,o.texture)}},2967:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IconText=e.IconCompositionType=e.LoadingState=void 0;const r=i(5823),n=i(2002);var o,s;(s=e.LoadingState||(e.LoadingState={}))[s.Requested=0]="Requested",s[s.Loaded=1]="Loaded",s[s.Initialized=2]="Initialized",(o=e.IconCompositionType||(e.IconCompositionType={}))[o.OVERLAID=0]="OVERLAID",o[o.NEXT_TO_EACH_OTHER=1]="NEXT_TO_EACH_OTHER";class a{constructor(t,e,i,n,o=0,s=0,a=0,l=0,c,h,u,p,d,m,f,g){this.text=t,this.points=e,this.renderParams=i,this.layoutParams=n,this.priority=o,this.zOrder=s,this.xOffset=a,this.yOffset=l,this.featureId=c,this.style=h,this.fadeNear=u,this.fadeFar=p,this.tileOffset=d,this.offsetDirection=m,this.dataSourceName=f,this.dataSourceOrder=g,this.visible=!0,this.distanceScale=.5,this.renderOrder=0,this.elevated=!1,i instanceof r.TextRenderStyle&&(this.renderStyle=i),n instanceof r.TextLayoutStyle&&(this.layoutStyle=n),this.setType()}setType(){this.type=void 0===this.path?n.IconTextType.PointIconText:this.m_iconsInfo?n.IconTextType.LineMarker:n.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(t){this.mayOverlap=t}get textReservesSpace(){return!1!==this.reserveSpace}set textReservesSpace(t){this.reserveSpace=t}get iconInfoList(){return this.m_iconsInfo}set iconInfoList(t){if(void 0!==t&&t.length>0){this.m_iconsInfo=t;const e=void 0!==this.renderOrder?this.renderOrder:0;t.forEach(t=>t.renderOrder=e)}else this.m_iconsInfo=void 0;this.setType()}get renderStyle(){return this.m_renderStyle}set renderStyle(t){this.m_renderStyle=t}get layoutStyle(){return this.m_layoutStyle}set layoutStyle(t){this.m_layoutStyle=t}hasFeatureId(){return!!this.featureId}dispose(){var t,e,i;null===(t=this.iconInfoList)||void 0===t||t.forEach(t=>{var e;return null===(e=t.buffer)||void 0===e?void 0:e.decreaseRefCount()}),null===(i=null===(e=this.textBackgroundInfo)||void 0===e?void 0:e.buffer)||void 0===i||i.decreaseRefCount()}}e.IconText=a,a.HIGHEST_PRIORITY=Number.MAX_SAFE_INTEGER,a.HIGHEST_Z_ORDER=Number.MAX_SAFE_INTEGER},5316:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IconTextBuilder=void 0;const r=i(8152),n=i(5823),o=i(1984),s=i(4342),a=i(2967),l=i(304),c=i(3174),h=s.LoggerManager.instance.create("IconTextBuilder");class u{static composeRenderOrder(t,e){return t*u.RENDER_ORDER_UP_BOUND+e}constructor(t,e,i){if(this.m_env=t,this.m_styleCache=e,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 t=Math.abs(i);this.renderOrderUpBound=(t-Math.floor(t))*u.RENDER_ORDER_UP_BOUND}this.isValidRenderOrder(i)||h.warn(`Large base render order (${i}) might cause precision issues.`)}withTechnique(t){var e,i,n,a,c;this.m_technique=t,this.m_priority=null!==(e=(0,r.getPropertyValue)(t.priority,this.m_env))&&void 0!==e?e:0,this.m_fadeNear=null!==(i=(0,r.getPropertyValue)(t.fadeNear,this.m_env))&&void 0!==i?i:void 0,this.m_fadeFar=null!==(n=(0,r.getPropertyValue)(t.fadeFar,this.m_env))&&void 0!==n?n:void 0,this.m_distanceScale=null!==(a=t.distanceScale)&&void 0!==a?a:l.DEFAULT_TEXT_DISTANCE_SCALE,this.m_renderStyle=this.m_styleCache.getRenderStyle(t),this.m_layoutStyle=this.m_styleCache.getLayoutStyle(t),this.m_xOffset=(0,r.getPropertyValue)(t.xOffset,this.m_env),this.m_yOffset=(0,r.getPropertyValue)(t.yOffset,this.m_env),this.m_zOrder=(0,r.getPropertyValue)(t.zOrder,this.m_env);const p=null!==(c=(0,r.getPropertyValue)(t.renderOrder,this.m_env))&&void 0!==c?c:0;if(!this.isValidRenderOrder(p)){const t=`Unsupported large render order (${p})`;h.error(t),(0,s.assert)(!1,t)}return this.m_renderOrder=u.composeRenderOrder(this.m_baseRenderOrder,p),(0,o.isTextTechnique)(t)?this.withTextTechnique(t):this.withIconTextTechnique(t),this}withIcon(t,e){return(0,s.assert)(void 0!==this.m_iconInfoBuilder),this.m_iconInfoBuilder.withIcon(t),this.m_lineMarkerGroupIndex=e,this}
2withTextBackgroundImage(t){return this.m_textBackgroundImageTextureName=t,this}build(t,e,i,o,l,c,h,u){var p,d;const m=(0,r.getFeatureId)(c);(0,s.assert)(void 0!==this.m_technique),(0,s.assert)(void 0!==this.m_renderStyle),(0,s.assert)(void 0!==this.m_layoutStyle);const f=this.m_technique,g=this.m_renderStyle,y=this.m_layoutStyle,v=new a.IconText(n.ContextualArabicConverter.instance.convert(t),e,g,y,this.m_priority,this.m_zOrder,this.m_xOffset,this.m_yOffset,m,f.style,this.m_fadeNear,this.m_fadeFar,i,u,o,l);if(v.textMinZoomLevel=this.m_textMinZoomLevel,v.textMaxZoomLevel=this.m_textMaxZoomLevel,v.iconMinZoomLevel=this.m_iconMinZoomLevel,v.iconMaxZoomLevel=this.m_iconMaxZoomLevel,v.textBrightness=this.m_textBrightness,v.distanceScale=this.m_distanceScale,v.mayOverlap=this.m_mayOverlap,v.reserveSpace=this.m_reserveSpace,v.userData=c,v.technique=this.m_technique,v.textFadeTime=void 0!==f.textFadeTime?1e3*f.textFadeTime:void 0,v.pathLengthSqr=h,v.alwaysOnTop=this.m_alwaysOnTop,v.renderOrder=this.m_renderOrder,v.textIsOptional=this.m_textIsOptional,v.iconIsOptional=this.m_iconIsOptional,v.iconCompositionType=this.m_iconCompositionType,v.lineMarkerGroupIndex=this.m_lineMarkerGroupIndex,this.m_textBackgroundImageTextureName){const t=f;v.textBackgroundInfo={technique:t,imageTextureName:this.m_textBackgroundImageTextureName,iconText:v,reserveSpace:t.textReserveSpace,renderOrder:null!==(p=v.renderOrder)&&void 0!==p?p:0}}return v.iconInfoList=null===(d=this.m_iconInfoBuilder)||void 0===d?void 0:d.build(v),v}withTextTechnique(t){var e,i;this.m_mayOverlap=!0===t.mayOverlap,this.m_reserveSpace=!1!==t.reserveSpace,this.m_iconInfoBuilder=void 0,this.m_textBackgroundImageTextureName=void 0,this.m_iconIsOptional=void 0,this.m_iconCompositionType=void 0,this.m_lineMarkerGroupIndex=void 0,this.m_textMinZoomLevel=null!==(e=(0,r.getPropertyValue)(t.minZoomLevel,this.m_env))&&void 0!==e?e:void 0,this.m_textMaxZoomLevel=null!==(i=(0,r.getPropertyValue)(t.maxZoomLevel,this.m_env))&&void 0!==i?i:void 0}withIconTextTechnique(t){var e,i,n,o,l,h,u,p,d;this.m_mayOverlap=!0===t.textMayOverlap,this.m_reserveSpace=!1!==t.textReserveSpace,this.m_alwaysOnTop=!0===t.alwaysOnTop,this.m_textIsOptional=!0===t.textIsOptional,this.m_iconIsOptional=!0===t.iconIsOptional,this.m_iconCompositionType="nextToEachOther"===t["icon-composition-type"]?a.IconCompositionType.NEXT_TO_EACH_OTHER:a.IconCompositionType.OVERLAID,this.m_textMinZoomLevel=null!==(i=(0,r.getPropertyValue)(null!==(e=t.textMinZoomLevel)&&void 0!==e?e:t.minZoomLevel,this.m_env))&&void 0!==i?i:void 0,this.m_textBrightness=null!==(n=s.MathUtils.clamp((0,r.getPropertyValue)(t.textBrightness,this.m_env),0,1))&&void 0!==n?n:1,this.m_textMaxZoomLevel=null!==(l=(0,r.getPropertyValue)(null!==(o=t.textMaxZoomLevel)&&void 0!==o?o:t.maxZoomLevel,this.m_env))&&void 0!==l?l:void 0,this.m_iconMinZoomLevel=null!==(u=(0,r.getPropertyValue)(null!==(h=t.iconMinZoomLevel)&&void 0!==h?h:t.minZoomLevel,this.m_env))&&void 0!==u?u:void 0,this.m_iconMaxZoomLevel=null!==(d=(0,r.getPropertyValue)(null!==(p=t.iconMaxZoomLevel)&&void 0!==p?p:t.maxZoomLevel,this.m_env))&&void 0!==d?d:void 0,this.m_iconInfoBuilder||(this.m_iconInfoBuilder=new c.IconInfoBuilder(this.m_env)),this.m_iconInfoBuilder.withTechnique(t)}isValidRenderOrder(t){return Math.abs(t)<this.renderOrderUpBound}}e.IconTextBuilder=u,u.RENDER_ORDER_UP_BOUND=1e7},9473:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IconTextGroup=void 0;const r=i(4342);class n extends r.PriorityListGroup{static comparePlacementPriority(t,e){return e.priority-t.priority||e.zOrder-t.zOrder||e.elements.length-t.elements.length}}e.IconTextGroup=n},7013:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IconTextGroupPriorityList=void 0;const r=i(4342);class n extends r.GroupedPriorityList{}e.IconTextGroupPriorityList=n},950:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IconTextGroupState=void 0;const r=i(4342),n=i(3981),o=i(2002);e.IconTextGroupState=class{constructor(t,e,i){this.group=t,this.tileKey=e,this.m_visited=!1,(0,r.assert)(t.elements.length>0);const s=t.elements.length;this.m_iconTextStates=[],this.m_visited=!0;for(let e=0;e<s;++e){const r=t.elements[e];if(r.type===o.IconTextType.LineMarker&&void 0!==r.path){const t=r.path.length;for(let e=0;e<t;e++){const t=new n.IconTextState(r,e),o=i(t);void 0!==o&&(t.update(o),this.m_iconTextStates.push(t))}}else{const t=new n.IconTextState(r),e=i(t);void 0!==e&&(t.update(e),this.m_iconTextStates.push(t))}}}get visited(){return this.m_visited}set visited(t){this.m_visited=t}get priority(){return this.group.priority}get zOrder(){return this.group.zOrder}updateFading(t,e){for(const i of this.m_iconTextStates)void 0!==i&&i.updateFading(t,e)}traverseVisibleIconTexts(t){for(const e of this.m_iconTextStates)void 0!==e&&e.visible&&t(e)}updateIconTexts(t){for(const e of this.m_iconTextStates){const i=t(e);e.update(i)}}get size(){return this.m_iconTextStates.length}get iconTextStates(){return this.m_iconTextStates}}},5738:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.IconTextManager=void 0;const r=i(9365),n=i(6815),o=i(1984),s=i(4342),a=i(5316),l=s.LoggerManager.instance.create("IconTextManager");function c(t,e=0){if(t.imageTextures){const i=t.imageTextures[e];if(i>=0)return t.stringCatalog[i]}}function h(t,e=0){if(t.textBackgroundImageTextures){const i=t.textBackgroundImageTextures[e];if(i>=0)return t.stringCatalog[i]}}function u(t,e=0){return t.objInfos?t.objInfos[e]:void 0}function p(t,e,i=0){const r=(new n.Vector3).fromBufferAttribute(t,i);return r.x+=e,r}function d(t,e=0){var i;(0,s.assert)(t.texts.length>e);const r=t.texts[e];return(0,s.assert)(t.stringCatalog.length>r),null!==(i=t.stringCatalog[r])&&void 0!==i?i:""}e.IconTextManager=class{constructor(){this.m_imageTextures=new Map,this.m_lineMarkerGroups=new Map}addIconTexts(t,e){const i=(0,s.assertExists)(e.iconTextGeometries),n=t.computeWorldOffsetX(),l=t.mapView,c=Math.floor(l.zoomLevel),h=new o.MapEnv({$zoom:c},l.env),u=new a.IconTextBuilder(h,t.textStyleCache,t.dataSource.dataSourceOrder);for(const a of i){(0,s.assert)(void 0!==a.technique);const i=(0,s.assertExists)(a.technique),l=e.techniques[i];if(!(0,o.isLineMarkerTechnique)(l)&&!(0,o.isIconTextTechnique)(l))continue;if(!1===l.visible)continue;const c=new r.BufferAttribute(new Float64Array(a.positions.buffer),a.positions.itemCount);u.withTechnique(l),(0,o.isLineMarkerTechnique)(l)&&c.count>0?this.addLineMarker(u,t,a,c,n):(0,o.isIconTextTechnique)(l)&&this.addIconText(u,t,a,c,n)}}async addTextureAtlas(t,e,i,r){const n=await fetch(e,{signal:r});if(!n.ok)throw new Error(`addTextureAtlas: Cannot load textureAtlas: ${n.statusText}`);const o=await n.json();
2for(const e of Object.getOwnPropertyNames(o)){const r=o[e],n={preload:i,url:t,xOffset:r.x,yOffset:r.y,width:r.width,height:r.height};this.addImageTexture(n,e)}}addImageTexture(t,e){void 0!==this.m_imageTextures.get(e)&&l.warn(`addImageTexture: Name already used: ${e} (overriding it)`),this.m_imageTextures.set(e,t)}getImageTexture(t){return this.m_imageTextures.get(t)}clear(){this.m_imageTextures.clear(),this.m_lineMarkerGroups.clear()}addLineMarker(t,e,i,r,n){const o=d(i),s=c(i),a=s+"-"+o;let l=this.m_lineMarkerGroups.get(a);void 0===l&&(l=this.m_lineMarkerGroups.size,this.m_lineMarkerGroups.set(a,l));const h=[];for(let t=0;t<r.count;++t)h.push(p(r,n,t));const m=t.withIcon(s,l).build(o,h,e.offset,e.dataSource.name,e.dataSource.dataSourceOrder,u(i));e.addIconText(m)}addIconText(t,e,i,r,n){var o,s;for(let a=0;a<r.count;++a){const l=null!==(s=null===(o=i.offsetDirections)||void 0===o?void 0:o[a])&&void 0!==s?s:0;t.withIcon(c(i,a)),t.withTextBackgroundImage(h(i,a));const m=t.build(d(i,a),p(r,n,a),e.offset,e.dataSource.name,e.dataSource.dataSourceOrder,u(i,a),void 0,l);e.addIconText(m)}}}},304:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IconTextRenderer=e.DEFAULT_TEXT_DISTANCE_SCALE=e.DEFAULT_FONT_CATALOG_NAME=void 0;const r=i(9896),n=i(8117),o=i(7793),s=i(8817),a=i(3441),l=i(6307),c=i(977),h=i(5971),u=i(3334),p=i(5448),d=i(6815),m=i(4760),f=i(5269),g=i(5823),y=i(1984),v=i(4342),_=i(507),b=i(9587),x=i(7362),w=i(2967),S=i(9473),T=i(8950),E=i(791),M=i(2002),A=i(5570),C=i(9913),P=(i(7234),i(4957)),L=i(9463),R=i(3800);var I;i(859),function(t){t[t.PersistentLabels=0]="PersistentLabels",t[t.NewLabels=1]="NewLabels"}(I||(I={})),e.DEFAULT_FONT_CATALOG_NAME="default",e.DEFAULT_TEXT_DISTANCE_SCALE=.5;const O=v.LoggerManager.instance.create("IconTextRenderer",{level:v.LogLevel.Log}),D=new d.Vector3,k=new p.Vector2,N=new p.Vector2,F=[],U={},z={},j={},B=new h.Color,V=new h.Color,G={vector2:[new p.Vector2]};function H(t,e,i,r,n){z.path=r,z.pathOverflow=n,z.layer=t.renderOrder,z.letterCaseArray=t.glyphCaseArray,z.pickingData=t.userData?t:void 0,e.addText(t.glyphs,i,z)}e.IconTextRenderer=class{constructor(t,e,i,n,o,s,a,l){this.m_viewState=t,this.m_screenProjector=e,this.m_imageRepo=i,this.m_textureCache=n,this.m_renderer=o,this.m_loadPromisesCount=0,this.m_textCanvases=new Map,this.m_fontCatalogUrls=new Map,this.m_tmpVector=new p.Vector2,this.m_tmpVector3=new d.Vector3,this.m_cameraLookAt=new d.Vector3,this.m_cacheInvalidated=!1,this.m_addNewLabels=!0,this.m_forceNewLabelsPass=!1,this.m_iconTextStateCache=new E.IconTextStateCache,this.m_camera=new r.OrthographicCamera(-1,1,1,-1),this.m_textStyleCache=new R.TextStyleCache,this.m_screenCollisions=new x.ScreenCollisions,this.m_isUpdatePending=!1,this.m_options=Object.assign({},s),(0,T.initializeDefaultOptions)(this.m_options),this.m_maxFarDistanceRatio=Math.max(this.m_options.maxDistanceRatioForText,this.m_options.maxDistanceRatioForIconText),this.m_textCanvasFactory=null!=a?a:new L.TextCanvasFactory(this.m_renderer),this.m_textCanvasFactory.setGlyphCountLimits(this.m_options.minNumGlyphs,this.m_options.maxNumGlyphs),this.m_imageRenderer=null!=l?l:new A.ImageRenderer(this.m_renderer,this.m_imageRepo,this.m_textureCache),this.initializeCamera(),this.updateFontCatalogs()}set screenCollisions(t){this.m_screenCollisions=t}get screenCollisions(){return this.m_screenCollisions}set disableFading(t){this.m_options.disableFading=t}get disableFading(){return!0===this.m_options.disableFading}get styleCache(){return this.m_textStyleCache}get delayLabelsUntilMovementFinished(){return!0===this.m_options.delayLabelsUntilMovementFinished}set delayLabelsUntilMovementFinished(t){this.m_options.delayLabelsUntilMovementFinished=t}get showReplacementGlyphs(){return!0===this.m_options.showReplacementGlyphs}set showReplacementGlyphs(t){this.m_options.showReplacementGlyphs=t,this.m_textCanvases.forEach(e=>{e.fontCatalog.showReplacementGlyphs=t})}restoreRenderers(t){this.m_renderer=t,this.m_imageRenderer=new A.ImageRenderer(this.m_renderer,this.m_imageRepo,this.m_textureCache)}async updateFontCatalogs(t,i){t=null!=t?t:[];const r=this.m_options.fontCatalog;if(r&&-1===t.findIndex(t=>t.name===e.DEFAULT_FONT_CATALOG_NAME)&&t.push({name:e.DEFAULT_FONT_CATALOG_NAME,url:r}),t.length>
20){for(const[e]of this.m_textCanvases)t.findIndex(t=>t.name===e)<0&&(this.m_fontCatalogUrls.delete(e),this.m_textCanvases.delete(e));await Promise.all(t.map(t=>this.addTextCanvas(t,i)))}else this.m_textCanvases.clear(),this.m_fontCatalogUrls.clear();this.m_textStyleCache.updateTextCanvases(this.m_textCanvases)}async setTheme(t,e){return this.invalidateCache(),this.m_textStyleCache.updateTextStyles(t.textStyles,t.defaultTextStyle),await this.updateFontCatalogs(t.fontCatalogs,e)}renderText(t){let e;this.m_camera.far=t,this.updateGlyphDebugMesh(),this.m_imageRenderer.update();for(const t of this.m_imageRenderer.layers){for(const[,i]of this.m_textCanvases)i.render(this.m_camera,null==e?void 0:e.id,t.id,void 0,!1);this.m_imageRenderer.render(this.m_camera,t),e=t}for(const[,t]of this.m_textCanvases)t.render(this.m_camera,null==e?void 0:e.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)}placeText(t,e){const i=t.filter(({dataSource:t})=>t.canProvideIconText()),{tileIconTextsChanged:r,hasIconTexts:n,hasBlockingElements:o}=function(t){let e=!1,i=!1,r=!1;return t.forEach(({renderedTiles:t})=>{t.forEach(t=>{i||(i=t.hasIconTexts()),r||(r=t.blockingElements.length>0),e||(e=t.iconTextsChanged),t.iconTextsChanged=!1})}),{tileIconTextsChanged:e,hasIconTexts:i,hasBlockingElements:r}}(i),s=this.hasOverlayText()||n;if(this.m_isUpdatePending=!1,this.reset(),!s&&!this.m_cacheInvalidated&&!this.m_viewState.renderedTilesChanged)return void this.clearRenderStates();const a=(this.m_cacheInvalidated||r||this.m_viewState.renderedTilesChanged)&&this.m_addNewLabels;a&&(this.m_iconTextStateCache.clearVisited(),this.updateIconTexts(i)),this.m_iconTextStateCache.update(e,this.m_options.disableFading,a,this.m_viewState.zoomLevel),this.m_addNewLabels&&o&&this.prepopulateScreenWithBlockingElements(t),this.placeIconTexts(e,a),this.placeOverlayIconTexts()}addOverlayText(t){0!==t.length&&(this.m_overlayIconTexts=void 0===this.m_overlayIconTexts?t.slice():this.m_overlayIconTexts.concat(t))}clearOverlayText(){this.m_overlayIconTexts=[]}hasOverlayText(){return void 0!==this.m_overlayIconTexts&&this.m_overlayIconTexts.length>0}get overlayText(){return this.m_overlayIconTexts}pickIconTexts(t,e){const i=new Map;for(const[,e]of this.m_textCanvases)e.pickText(t,t=>{i.set(t,!0)});this.m_imageRenderer.pickIconTexts(t,t=>{i.set(t,!1)}
2),i.forEach((t,i)=>{e(i,t)})}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 t={heapSize:0,gpuSize:0};for(const[,e]of this.m_textCanvases)e.getMemoryUsage(t);return this.m_imageRenderer.getMemoryUsage(t),t}reset(){this.m_cameraLookAt.copy(this.m_viewState.lookAtVector),this.m_screenCollisions.reset();for(const[,t]of this.m_textCanvases)t.clear();this.m_imageRenderer.reset()}prepopulateScreenWithBlockingElements(t){const e=[];t.forEach(t=>{const i=new d.Vector3,r=new d.Vector3;for(const n of t.renderedTiles.values())for(const t of n.blockingElements)if(!(t.points.length<2)){this.m_screenProjector.project3(t.points[0],i);for(let n=1;n<t.points.length;n++){this.m_screenProjector.project3(t.points[n],r);const o=t.screenSpaceLines[n-1];o.start.copy(i),o.end.copy(r);const s={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:o};e.push(s),i.copy(r)}}}),this.m_screenCollisions.allocateIBoxes(e)}placeIconTextGroup(t,e,i,r){var n;(0,v.assert)(t.visited);const o=this.m_viewState.projection,s=this.m_viewState.elevationProvider,a=null==s?void 0:s.getDisplacementMap(t.tileKey);for(const l of t.iconTextStates){if(!l.initialized)continue;if(i===I.PersistentLabels&&!l.visible||i===I.NewLabels&&l.visible)continue;const t=l.iconText,c=this.m_textStyleCache.getTextStyle(t.style),h=c.textCanvas;if(void 0!==s&&!t.elevated){if(!a){this.m_isUpdatePending=!0,this.m_forceNewLabelsPass=!0;continue}(0,b.overlayIconText)(t,s,a,o)}const u=t.type;if(u===M.IconTextType.PathLabel&&(0,C.isPathLabelTooSmall)(t,this.m_screenProjector,F,this.m_viewState.env)){t.dbgPathTooSmall,l.reset();continue}const p=!0;if(h){if(!this.initializeGlyphs(t,c,p))continue;const e=h.getLayer(null!==(n=t.renderOrder)&&void 0!==n?n:g.DEFAULT_TEXT_CANVAS_LAYER);if(void 0!==e&&e.storage.drawCount+t.glyphs.length>e.storage.capacity){O.warn("layer glyph storage capacity exceeded.");continue}h.textRenderStyle=t.renderStyle,h.textLayoutStyle=t.layoutStyle}switch(u){case M.IconTextType.PointIconText:this.addPointIconText(l,h,e);break;case M.IconTextType.LineMarker:this.addLineMarkerLabel(l,r,h,e);break;case M.IconTextType.PathLabel:h&&this.addPathLabel(l,F,h,e)}}return!0}addLoadPromise(t){0===this.m_loadPromisesCount&&(this.m_loadPromise=void 0),++this.m_loadPromisesCount,this.m_loadPromise=this.m_loadPromise?Promise.all([this.m_loadPromise,t]):t}initializeGlyphs(t,e,i){if(t.loadingState===w.LoadingState.Initialized)return void 0!==t.glyphs;(0,v.assert)(void 0!==e.textCanvas);const r=e.textCanvas;if(void 0===t.loadingState)if(t.loadingState=w.LoadingState.Requested,void 0===t.renderStyle&&(t.renderStyle=new g.TextRenderStyle(Object.assign(Object.assign({},e.renderParams),t.renderParams))),void 0===t.layoutStyle&&(t.layoutStyle=new g.TextLayoutStyle(Object.assign(Object.assign({},e.layoutParams),t.layoutParams))),""===t.text)t.loadingState=w.LoadingState.Loaded;else{const e=r.fontCatalog.loadCharset(t.text,t.renderStyle).then(()=>{t.loadingState=w.LoadingState.Loaded,this.m_isUpdatePending=!0,this.m_forceNewLabelsPass=this.m_forceNewLabelsPass||i}).catch(e=>{O.info(`Error loading charset for '${t.text}' with font ${r.fontCatalog.name}`,e)}).finally(()=>{--this.m_loadPromisesCount});this.addLoadPromise(e)}return t.loadingState===w.LoadingState.Loaded&&(r.textRenderStyle=t.renderStyle,r.textLayoutStyle=t.layoutStyle,t.glyphCaseArray=[],t.textBounds=void 0,t.glyphs=r.fontCatalog.getGlyphs(t.text,r.textRenderStyle,t.glyphCaseArray),t.loadingState=w.LoadingState.Initialized),void 0!==t.glyphs}initializeCamera(){this.m_camera.position.z=1,this.m_camera.near=0}updateCamera(){const{width:t,height:e}=this.m_renderer.getSize(G.vector2[0]);this.m_camera.left=t/-2,this.m_camera.right=t/2,this.m_camera.bottom=e/-2,this.m_camera.top=e/2,this.m_camera.updateProjectionMatrix(),this.m_camera.updateMatrixWorld(!1),this.m_screenCollisions.update(t,e)}async addTextCanvas(t,e){if(this.m_fontCatalogUrls.get(t.name)===t.url)return await Promise.resolve();this.m_fontCatalogUrls.set(t.name,t.url);const i=g.FontCatalog.load(t.url,2048,e).then(e=>{const i=t.name;if(this.m_fontCatalogUrls.get(i)===t.url){e.showReplacementGlyphs=this.showReplacementGlyphs;const t=this.m_textCanvasFactory.createTextCanvas(e,i);
2this.m_textCanvases.set(i,t)}}).catch(i=>{if(this.m_fontCatalogUrls.delete(t.name),null==e?void 0:e.aborted)throw i;O.info("rendering without font catalog, only icons possible",i)}).finally(()=>{--this.m_loadPromisesCount});return this.addLoadPromise(i),i}updateGlyphDebugMesh(){const t=_.debugContext.getValue("DEBUG_GLYPHS");void 0!==t&&(t&&void 0===this.m_debugGlyphTextureCacheMesh&&this.initializeGlyphDebugMesh(),(0,v.assert)(void 0!==this.m_debugGlyphTextureCacheMesh),(0,v.assert)(void 0!==this.m_debugGlyphTextureCacheWireMesh),this.m_debugGlyphTextureCacheMesh.visible=t,this.m_debugGlyphTextureCacheWireMesh.visible=t)}initializeGlyphDebugMesh(){if(0===this.m_textCanvases.size)return;const t=this.m_textCanvases.values().next().value,e=t.fontCatalog,i=new s.PlaneGeometry(e.textureSize.width/2.5,e.textureSize.height/2.5,e.textureSize.width/e.maxWidth,e.textureSize.height/e.maxHeight),r=new c.MeshBasicMaterial({transparent:!0,depthWrite:!1,depthTest:!1,map:e.texture});this.m_debugGlyphTextureCacheMesh=new f.Mesh(i,r),this.m_debugGlyphTextureCacheMesh.renderOrder=1e4,this.m_debugGlyphTextureCacheMesh.visible=!1,this.m_debugGlyphTextureCacheMesh.name="glyphDebug";const n=new a.WireframeGeometry(i),o=new l.LineBasicMaterial({transparent:!0,color:10066329,depthWrite:!1,depthTest:!1});this.m_debugGlyphTextureCacheWireMesh=new m.LineSegments(n,o),this.m_debugGlyphTextureCacheWireMesh.renderOrder=9999,this.m_debugGlyphTextureCacheWireMesh.visible=!1,this.m_debugGlyphTextureCacheWireMesh.name="glyphDebug",t.getLayer(g.DEFAULT_TEXT_CANVAS_LAYER).storage.scene.add(this.m_debugGlyphTextureCacheMesh,this.m_debugGlyphTextureCacheWireMesh)}updateIconTexts(t){this.m_iconTextStateCache.clearTextCache(),this.m_cacheInvalidated=!1,t.forEach(t=>{this.updateIconTextsFromSource(t.visibleTiles,t.dataSource)})}updateIconTextsFromSource(t,e){const i=this.gatherGroups(t);if(0===i.length)return;e.isDetached()||i[0].tile.mapView.zoomLevel>e.maxDataLevel&&e.canProvideIconText()&&t.forEach(t=>{this.updateTileIconTexts(t)});const r=(0,C.getMaxViewDistance)(this.m_viewState,this.m_maxFarDistanceRatio);for(const{tile:t,group:e}of i)this.prepareIconTextGroup(e,t.tileKey,r)}prepareIconTextGroup(t,e,i){if(0===t.elements.length)return;const[,r]=this.m_iconTextStateCache.getOrSet(t,e,t=>{let{result:e,viewDistance:r}=(0,C.checkReadyForPlacement)(t.iconText,t.iconText.type===M.IconTextType.LineMarker?t.lineMarkerIndex:void 0,this.m_viewState,i);return e!==C.PrePlacementResult.TooFar&&e!==C.PrePlacementResult.Invisible||(r=void 0),e!==C.PrePlacementResult.Ok||this.m_iconTextStateCache.deduplicateIconText(this.m_viewState.zoomLevel,t)||(e=C.PrePlacementResult.Duplicate,r=void 0),r})}updateTileIconTexts(t){t.iconTextGroups.forEachGroup(e=>{e.elements.forEach(e=>{var i,r,n;const o=e.technique;e.renderStyle=t.textStyleCache.getRenderStyle(o,!0),e.layoutStyle=t.textStyleCache.getLayoutStyle(o,!0),e.textBounds=void 0,null===(i=e.iconInfoList)||void 0===i||i.forEach(t=>{t.buffer=void 0,t.uvBox=void 0});const s=t.mapView.env;e.fadeFar=null!==(r=(0,y.getPropertyValue)(o.fadeFar,s))&&void 0!==r?r:void 0,e.fadeNear=null!==(n=(0,y.getPropertyValue)(o.fadeNear,s))&&void 0!==n?n:void 0,e.yOffset=(0,y.getPropertyValue)(o.yOffset,s),e.xOffset=(0,y.getPropertyValue)(o.xOffset,s),e.zOrder=(0,y.getPropertyValue)(o.zOrder,s)})})}gatherGroups(t){const e=[];return t.forEach(t=>{t.iconTextGroups.forEachGroup(i=>{e.push({tile:t,group:i})})}),e.sort((t,e)=>S.IconTextGroup.comparePlacementPriority(t.group,e.group)),e}placeIconTexts(t,e){const i=[],r={numRenderedIconTexts:0,fadeAnimationRunning:!1,time:t};if(0===this.m_iconTextStateCache.size)return void O.debug("IconText cache empty.");const n=this.m_forceNewLabelsPass||e;this.m_forceNewLabelsPass=!1;const o=this.m_iconTextStateCache.sortedGroupStates;let s=o[0].group,a=0;for(let t=0;t<o.length;++t){const e=o[t],l=e.group;if(n&&0!==S.IconTextGroup.comparePlacementPriority(s,l)&&(this.placeNewIconTexts(a,t,r,i),s=l,a=t),!this.placeIconTextGroup(e,r,I.PersistentLabels,i))break}n&&this.placeNewIconTexts(a,o.length,r,i),r.fadeAnimationRunning&&(this.m_isUpdatePending=!0)}placeNewIconTexts(t,e,i,r){const n=this.m_iconTextStateCache.sortedGroupStates;for(let o=t;o<e&&this.placeIconTextGroup(n[o],i,I.NewLabels,r);++o);}placeOverlayIconTexts(){var t;if(void 0===this.m_overlayIconTexts||0===this.m_overlayIconTexts.length)return;const e=this.m_tmpVector.set(this.m_screenProjector.width,this.m_screenProjector.height),i=-e.width/2,r=e.height/2;
2for(const n of this.m_overlayIconTexts){const s=this.m_textStyleCache.getTextStyle(n.style),a=s.textCanvas;if(void 0===a)continue;const l=!1;if(this.initializeGlyphs(n,s,l),n.loadingState!==w.LoadingState.Initialized)continue;const c=a.getLayer(null!==(t=n.renderOrder)&&void 0!==t?t:g.DEFAULT_TEXT_CANVAS_LAYER);if(void 0!==c&&c.storage.drawCount+n.glyphs.length>c.storage.capacity)continue;let h;if(a.textRenderStyle=n.renderStyle,a.textLayoutStyle=n.layoutStyle,n.type!==M.IconTextType.PathLabel)N.x=i+n.position.x*e.width,N.y=r-n.position.y*e.height,void 0!==n.xOffset&&(N.x+=n.xOffset),void 0!==n.yOffset&&(N.y-=n.yOffset),D.x=N.x,D.y=N.y,D.z=0,H(n,a,D);else{N.x=i,N.y=r,void 0!==n.xOffset&&(N.x+=n.xOffset),void 0!==n.yOffset&&(N.y-=n.yOffset);const t=[];for(const i of n.path){const r=N.x+i.x*e.width,n=N.y-i.y*e.height;t.push(new p.Vector2(r,n))}h=new P.SimplePath;for(let e=0;e<t.length-1;++e)h.add(new o.LineCurve(t[e],t[e+1]));H(n,a,D,h,!0)}}}getDistanceScalingFactor(t,e,i){let r=i/e;return r=1+(r-1)*t.distanceScale,r=Math.max(r,this.m_options.labelDistanceScaleMin),r=Math.min(r,this.m_options.labelDistanceScaleMax),r}getDistanceFadingFactor(t,e,i){let r=1;const n=e.viewDistance;if(void 0!==n&&void 0!==t.fadeFar&&t.fadeFar>0){const e=void 0===t.fadeNear?0:t.fadeNear,o=t.fadeFar;o>e&&(r=1-(0,u.clamp)((n/i-e)/(o-e),0,1))}return r}getIconScreenPositions(t,e,i){var r,n,o;const s=[];if(!t.iconInfoList)return s;if(t.iconCompositionType===w.IconCompositionType.NEXT_TO_EACH_OTHER){let a=0;for(let e=0;e<t.iconInfoList.length;e++)a+=null!==(r=t.iconInfoList[e].computedWidth)&&void 0!==r?r:0;a*=i;const l=new p.Vector2(e.x-a/2,e.y);for(let e=0;e<t.iconInfoList.length;e++){const r=t.iconInfoList[e-1],a=t.iconInfoList[e];let c=0;r&&(c=(null!==(n=r.computedWidth)&&void 0!==n?n:0)*i/2);const h=(null!==(o=a.computedWidth)&&void 0!==o?o:0)*i/2;l.x+=c+h,s.push(l.clone())}}else for(let i=0;i<t.iconInfoList.length;i++)s.push(e);return s}addIconText(t,e,i,r,n,o){var s,a;const l=t.iconText,c=t.textRenderState,h=l.type===M.IconTextType.LineMarker,u=!0===l.textIsOptional,p=!0===l.iconIsOptional;D.x=i.x,D.y=i.y,D.z=0;const d=(0,C.pointToPlaneDistance)(e,this.m_viewState.worldCenter,this.m_cameraLookAt);if(void 0!==l.fadeFar&&(l.fadeFar<=0||l.fadeFar*this.m_viewState.maxVisibilityDist<d))return t.reset(),!1;t.setViewDistance(d);const m=this.getDistanceScalingFactor(l,d,this.m_viewState.lookAtDistance),f=this.getDistanceFadingFactor(l,t,this.m_viewState.maxVisibilityDist);let g=!1;if(o){const t=l.technique,e=void 0!==t.minDistance?Math.pow(t.minDistance,2):0;for(let t=0;t<o.length&&!(g=v.Math2D.distSquared(o[t],o[t+1],N.x,N.y)<e);t+=2);}let y=void 0!==l.iconInfoList&&v.MathUtils.isWithinBounds(this.m_viewState.zoomLevel,l.iconMinZoomLevel,l.iconMaxZoomLevel)&&l.iconInfoList.every(t=>!1!==t.isValid)&&!g;y&&(this.m_imageRenderer.prepareIcons(l,this.m_viewState.env)?(null===(s=l.iconInfoList)||void 0===s?void 0:s.some(t=>0===t.computedWidth||0===t.computedHeight))&&(y=!1):(y=!1,this.m_forceNewLabelsPass=!0,this.m_isUpdatePending=!0));const _=this.getIconScreenPositions(l,i,m);let b;if(y){const t=l.iconInfoList;if(l.iconCompositionType===w.IconCompositionType.NEXT_TO_EACH_OTHER)for(let e=0;e<_.length&&(b=(0,C.placeIcon)(t[e],_[e],m,this.m_viewState.env,this.m_screenCollisions),b!==C.PlacementResult.Rejected);e++);else b=(0,C.placeIcon)(t[0],_[0],m,this.m_viewState.env,this.m_screenCollisions)}const x=!p&&b===C.PlacementResult.Rejected,S=!t.visible,T=0===(null===(a=l.renderParams.fontSize)||void 0===a?void 0:a.size),E=!(!r||!c||T),A=E&&function(t,e,i){const r=t.textRenderState,n=t.iconText;if((0,v.assert)(n.type!==M.IconTextType.PathLabel),void 0===r||""===n.text)return!1;if(!v.MathUtils.isWithinBounds(e.zoomLevel,n.textMinZoomLevel,n.textMaxZoomLevel))return!1;const o=(0,C.getMaxViewDistance)(e,i.maxDistanceRatioForIconText);return!!(!0===n.ignoreDistance||void 0===t.viewDistance||t.viewDistance<o&&t.viewDistance>0)}(t,this.m_viewState,this.m_options)&&!(S&&x)&&!g;let P;A&&(P=(0,C.placeText)(t,i,m,r,this.m_viewState.env,this.m_screenCollisions,D,!h));let L=!1;if(E&&x||P===C.PlacementResult.Rejected?(c.startFadeOut(n.time),L=c.isVisible()):P===C.PlacementResult.Ok?(L=!0,c.startFadeIn(n.time,this.m_options.disableFading)):c.reset(),L){n.fadeAnimationRunning=n.fadeAnimationRunning||c.isFading(),function(t,e,
2i,r,n){const o=t.iconText,s=t.textRenderState.opacity*r*o.renderStyle.opacity;if(0===s)return!1;U.letterCaseArray=o.glyphCaseArray,void 0===o.textBufferObject&&(o.textBufferObject=e.createTextBufferObject(o.glyphs,U));const a=o.renderStyle.backgroundOpacity>0&&e.textRenderStyle.fontSize.backgroundSize>0;j.layer=o.renderOrder,j.position=i,j.scale=n,j.opacity=s,void 0!==o.textBrightness?(B.setScalar(o.textBrightness),V.setScalar(o.textBrightness),j.color=B.multiply(o.renderStyle.color),j.backgroundColor=V.multiply(o.renderStyle.backgroundColor)):(j.color=void 0,j.backgroundColor=void 0),j.backgroundOpacity=a?j.opacity*o.renderStyle.backgroundOpacity:0,j.pickingData=o.userData?o:void 0,e.addTextBufferObject(o.textBufferObject,j),j.pickingData=void 0}(t,r,D,f,m);const e=l.textBackgroundInfo;e&&this.m_imageRenderer.prepareTextBackground(l)&&l.textBounds&&(k.x=D.x,k.y=D.y,this.m_imageRenderer.addTextBackground(e,k,l.textBounds,t.renderDistance,m))}let R=!1;const I=t.iconRenderState;if(void 0!==I&&(b===C.PlacementResult.Rejected||!u&&P===C.PlacementResult.Rejected?(I.startFadeOut(n.time),R=I.isVisible()):b===C.PlacementResult.Ok?(R=!0,I.startFadeIn(n.time,this.m_options.disableFading)):I.reset(),R&&(n.fadeAnimationRunning=n.fadeAnimationRunning||I.isFading(),l.iconInfoList)))for(let e=0;e<l.iconInfoList.length;e++){const i=l.iconInfoList[e];this.m_imageRenderer.addIcon(i,_[e],this.m_screenCollisions,t.renderDistance,m,!1!==i.reserveSpace&&b===C.PlacementResult.Ok,I.op
2acity*f,this.m_viewState.env),o&&o.push(_[e].x,_[e].y)}return R||L?(n.numRenderedIconTexts++,!0):(t.reset(),!1)}addPointIconText(t,e,i){const r=(0,C.getWorldPosition)(t.iconText,this.m_viewState.projection,this.m_viewState.env,this.m_tmpVector3);return!!this.labelPotentiallyVisible(r,N)&&this.addIconText(t,r,N,e,i)}addLineMarkerLabel(t,e,i,r){var n;const o=t.iconText;if(!(null===(n=this.m_imageRenderer)||void 0===n?void 0:n.prepareIcons(o,this.m_viewState.env)))return;let s;void 0!==o.lineMarkerGroupIndex&&(s=e[o.lineMarkerGroupIndex],void 0===s&&(s=[],e[o.lineMarkerGroupIndex]=s));const a=t.position;this.labelPotentiallyVisible(a,N)&&this.addIconText(t,a,N,i,r,s)}addPathLabel(t,e,i,r){const o=(0,C.getMaxViewDistance)(this.m_viewState,this.m_options.maxDistanceRatioForText),s=t.iconText;if(!(!0===s.ignoreDistance||void 0===t.viewDistance||t.viewDistance<o))return t.textRenderState.reset(),!1;if(void 0!==s.fadeFar&&(s.fadeFar<=0||s.fadeFar*this.m_viewState.maxVisibilityDist<t.renderDistance))return t.textRenderState.reset(),!1;let a=new n.Path;N.copy(e[0]);for(let t=0;t<e.length-1;++t)a.add(new P.SimpleLineCurve(e[t],e[t+1]));if(a.getPoint(.5).x-a.getPoint(.51).x>0){N.copy(e[e.length-1]),a=new n.Path;for(let t=e.length-1;t>0;--t)a.add(new P.SimpleLineCurve(e[t],e[t-1]))}t.setViewDistance((0,C.computeViewDistance)(s,void 0,this.m_viewState.worldCenter,this.m_cameraLookAt));const l=-t.renderDistance,c=this.getDistanceScalingFactor(s,l,this.m_viewState.lookAtDistance),h=i.textRenderStyle.fontSize.size;if(i.textRenderStyle.fontSize.size*=c,(0,C.placePathLabel)(t,a,N,i,this.m_screenCollisions)!==C.PlacementResult.Ok)return i.textRenderStyle.fontSize.size=h,t.textRenderState.reset(),!1;t.textRenderState.startFadeIn(r.time,this.m_options.disableFading);let u=s.renderStyle.opacity;if(t.textRenderState.isFading()&&(u*=t.textRenderState.opacity,r.fadeAnimationRunning=!0),0===t.textRenderState.opacity)return i.textRenderStyle.fontSize.size=h,!1;const p=i.textRenderStyle.opacity,d=i.textRenderStyle.backgroundOpacity,m=this.getDistanceFadingFactor(s,t,this.m_viewState.maxVisibilityDist);return i.textRenderStyle.opacity=u*m,i.textRenderStyle.backgroundOpacity=i.textRenderStyle.opacity*s.renderStyle.backgroundOpacity,D.z=t.renderDistance,H(s,i,D,a),r.numRenderedIconTexts++,i.textRenderStyle.fontSize.size=h,i.textRenderStyle.opacity=p,i.textRenderStyle.backgroundOpacity=d,!0}labelPotentiallyVisible(t,e){var i;const r=(0,u.clamp)(null!==(i=this.m_options.maxIconTextDistanceToBorder)&&void 0!==i?i:0,0,1);return void 0!==this.m_screenProjector.projectAreaToScreen(t,r,r,e)}}},8950:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.initializeDefaultOptions=void 0,e.initializeDefaultOptions=function(t){void 0===t.minNumGlyphs&&(t.minNumGlyphs=1024),void 0===t.maxNumGlyphs&&(t.maxNumGlyphs=32768),void 0===t.labelDistanceScaleMin&&(t.labelDistanceScaleMin=.7),void 0===t.labelDistanceScaleMax&&(t.labelDistanceScaleMax=1.5),void 0===t.maxDistanceRatioForText&&(t.maxDistanceRatioForText=.99),void 0===t.maxDistanceRatioForIconText&&(t.maxDistanceRatioForIconText=.99),void 0===t.disableFading&&(t.disableFading=!1),void 0===t.delayLabelsUntilMovementFinished&&(t.delayLabelsUntilMovementFinished=!0),void 0===t.showReplacementGlyphs&&(t.showReplacementGlyphs=!1),void 0===t.maxIconTextDistanceToBorder&&(t.maxIconTextDistanceToBorder=.2)}},3981:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isLineMarkerState=e.IconTextState=void 0;const r=i(5823),n=i(4342),o=i(2002),s=i(3569),a=i(6445);e.IconTextState=class{constructor(t,e){this.iconText=t,this.m_lineMarkerIndex=e}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 t=this.iconRenderState;return!(void 0===t||!t.isVisible())}get textPlacement(){const t=this.iconText.layoutStyle,e=this.m_textLayoutState;return void 0!==e?e.textPlacement:{h:(0,r.hPlacementFromAlignment)(t.horizontalAlignment),v:(0,r.vPlacementFromAlignment)(t.verticalAlignment)}}set textPlacement(t){void 0===this.m_textLayoutState&&!0===this.isBaseTextPlacement(t)||(void 0===this.m_textLayoutState?this.m_textLayoutState=new a.LayoutState(t):this.m_textLayoutState.textPlacement=t)}isBaseTextPlacement(t){const e=this.iconText.layoutStyle;if(void 0!==e)return(0,r.hAlignFromPlacement)(t.h)===e.horizontalAlignment&&(0,r.vAlignFromPlacement)(t.v)===e.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(t){this.m_textRenderState=t.m_textRenderState,this.m_textLayoutState=t.m_textLayoutState,this.m_iconRenderState=t.m_iconRenderState,t.m_textRenderState=void 0,t.m_textLayoutState=void 0,t.m_iconRenderState=void 0,void 0===this.iconText.glyphs&&(this.iconText.glyphs=t.iconText.glyphs,this.iconText.glyphCaseArray=t.iconText.glyphCaseArray),this.iconText.textBounds=void 0,this.iconText.textBufferObject=void 0}get viewDistance(){return this.m_viewDistance}update(t){this.initialized||void 0===t||this.initializeRenderStates(),this.setViewDistance(t)}setViewDistance(t){this.m_viewDistance=t}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(t,e){void 0!==this.m_textRenderState&&this.m_textRenderState.updateFading(t,e),void 0!==this.iconRenderState&&this.iconRenderState.updateFading(t,e)}initializeRenderStates(){var t;(0,n.assert)(void 0===this.m_textRenderState),(0,n.assert)(void 0===this.m_textLayoutState),(0,n.assert)(void 0===this.m_iconRenderState);const{textFadeTime:e}=this.iconText;if(this.m_textRenderState=new s.RenderState(e),this.iconText.type===o.IconTextType.PointIconText||this.iconText.type===o.IconTextType.LineMarker){const i=null===(t=this.iconText.technique)||void 0===t?void 0:t.iconFadeTime;this.m_iconRenderState=new s.RenderState(void 0!==i?1e3*i:e)}}},e.isLineMarkerState=function(t){return void 0!==t.m_lineMarkerIndex}},791:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.IconTextStateCache=void 0;const r=i(4342),n=i(9473),o=i(950),s=i(3981),a=function(){const t=Array.from(Array(23).keys()),e=[];for(let i of t){const t=Math.min(4,13-Math.min(13,Math.floor(i)));e.push(100<<(t<<2))}return e}(),l={entries:[],index:-1};function c(t){return t.hasFeatureId()?t.featureId:t.text}e.IconTextStateCache=class{constructor(){this.m_referenceMap=new Map,this.m_textMap=new Map}getOrSet(t,e,i){let r=this.get(t);return void 0!==r?(r.updateIconTexts(i),[r,!0]):(r=new o.IconTextGroupState(t,e,i),this.set(t,r),[r,!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((t,e)=>n.IconTextGroup.comparePlacementPriority(t.group,e.group))),(0,r.assert)(this.m_referenceMap.size===this.m_sortedGroupStates.length),this.m_sortedGroupStates}update(t,e,i,r){const n=i?this.replaceIconText.bind(this,r):void 0;for(const[r,o]of this.m_referenceMap.entries())o.visited?o.updateFading(t,e):(i&&o.traverseVisibleIconTexts(n),this.m_referenceMap.delete(r),this.m_sortedGroupStates=void 0)}clearVisited(){for(const t of this.m_referenceMap.values())t.visited=!1}clear(){this.m_referenceMap.clear(),this.m_sortedGroupStates=void 0,this.m_textMap.clear(),l.entries=[],l.index=-1}deduplicateIconText(t,e){const i=this.findDuplicate(e,t);if(void 0===i)return this.m_textMap.set(c(e.iconText),[e]),!0;if(-1===i.index)return i.entries.push(e),!0;const r=i.entries[i.index];return!(r.visible||!e.visible||(i.entries[i.index]=e,r.reset(),0))}clearTextCache(){this.m_textMap.clear()}replaceIconText(t,e){(0,r.assert)(e.visible);const i=this.findDuplicate(e,t);return void 0!==i&&-1!==i.index&&(i.entries[i.index].replace(e),!0)}get(t){const e=this.m_referenceMap.get(t);return void 0!==e&&(e.visited=!0),e}set(t,e){(0,r.assert)(t.elements.length>0),this.m_referenceMap.set(t,e),this.m_sortedGroupStates=void 0}findDuplicate(t,e){const i=t.iconText,r=this.m_textMap.get(c(i));if(void 0===r)return;l.entries=r;const n=function(t,e,i){const r=function(t){return a[Math.floor(t)]}(i),n=t.iconText,o=e.length,l=t.position,c=t.visible,h=(0,s.isLineMarkerState)(t);let u,p=-1;for(let t=0;t<o;++t){const i=e[t],o=i.iconText,a=n.type!==o.type||h!==(0,s.isLineMarkerState)(i),d=c&&i.visible;a||d||l.distanceToSquared(o.position)>r||void 0===u&&(p=t,u=o)}return p}(t,r,e);return l.index=n,l}}},2002:(t,e)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.IconTextType=void 0,(i=e.IconTextType||(e.IconTextType={}))[i.PointIconText=0]="PointIconText",i[i.PathLabel=1]="PathLabel",i[i.LineMarker=2]="LineMarker"},8488:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MapViewState=void 0;const r=i(6815);e.MapViewState=class{constructor(t,e){this.m_mapView=t,this.m_renderedTilesChangeCheck=e,this.m_lookAtVector=new r.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}}},9913:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getWorldPosition=e.isPathLabelTooSmall=e.placePathLabel=e.placeText=e.placeIcon=e.PlacementResult=e.checkReadyForPlacement=e.PrePlacementResult=e.getMaxViewDistance=e.pointToPlaneDistance=e.computeViewDistance=void 0;const r=i(433),n=i(3334),o=i(5448),s=i(6815),a=i(8152),l=i(2616),c=i(5823),h=i(1984),u=i(4342),p=i(7362),d=i(2967),m=i(2002),f=i(5154),g=i(5570),y=new s.Vector3(0,0,0),v=new s.Vector3(0,0,0),_=new s.Vector3(0,0,0);function b(t,e,i,r){let n;const o=t.path;if(o&&o.length>1)if(void 0!==e&&o&&o.length>e)n=x(o[e],i,r);else{const t=x(o[0],i,r),e=x(o[o.length-1],i,r);n=Math.min(t,e)}else n=x(t.position,i,r);return n}function x(t,e,i){return _.copy(t).sub(e).dot(i)}var w;e.computeViewDistance=b,e.pointToPlaneDistance=x,e.getMaxViewDistance=function(t,e){return t.maxVisibilityDist*e},function(t){t[t.Ok=0]="Ok",t[t.Invisible=1]="Invisible",t[t.TooFar=2]="TooFar",t[t.Duplicate=3]="Duplicate",t[t.Count=4]="Count"}(w=e.PrePlacementResult||(e.PrePlacementResult={}));const S=new s.Vector3;
2e.checkReadyForPlacement=function(t,e,i,r){let n;if(!t.visible||i.zoomLevel===t.textMaxZoomLevel)return{result:w.Invisible,viewDistance:n};const o=t.iconInfoList&&u.MathUtils.isWithinBounds(i.zoomLevel,t.iconMinZoomLevel,t.iconMaxZoomLevel);return u.MathUtils.isWithinBounds(i.zoomLevel,t.textMinZoomLevel,t.textMaxZoomLevel)||o?(n=void 0===r?b(t,e,i.worldCenter,i.lookAtVector):function(t,e,i,r,n,o){const s=b(t,e,i,r);return n!==l.ProjectionType.Spherical?s<=o?s:void 0:(y.copy(t.position).normalize(),v.copy(i).normalize(),y.dot(v)>.5877852522924731&&s<=o?s:void 0)}(t,e,i.worldCenter,i.lookAtVector,i.projection.type,r),void 0===n?{result:w.TooFar,viewDistance:n}:{result:w.Ok,viewDistance:n}):{result:w.Invisible,viewDistance:n}};const T=new r.Box2,E=new r.Box2,M=[],A={},C=[],P=new p.CollisionBox,L=new o.Vector2,R=new o.Vector2,I=new u.Math2D.Box,O=new o.Vector2,D=new o.Vector2;var k;function N(t,e,i,r,n,s,l,p,y){const v=t.iconText;(0,u.assert)(void 0!==v.glyphs),(0,u.assert)(void 0!==v.layoutStyle);const _=!v.textBounds||p,b=_?E:v.textBounds;if(_){U(n,i),A.outputCharacterBounds=void 0,A.path=void 0,A.pathOverflow=!1,A.letterCaseArray=v.glyphCaseArray,n.measureText(v.glyphs,b,A);const t=v.technique;if(t&&(0,h.isIconTextTechnique)(t)){const e=(0,a.getPropertyValue)(t["background-padding"],s);e&&(e.x&&(b.min.x-=e.x),e.y&&(b.max.y+=e.y),e.z&&(b.max.x+=e.z),e.w&&(b.min.y-=e.w))}}const x=function(t,e,i,r,n,s=new o.Vector2){switch((0,u.assert)(t.type===m.IconTextType.PointIconText||t.type===m.IconTextType.LineMarker),(0,u.assert)(void 0!==t.layoutStyle),s.x=t.xOffset,s.y=t.yOffset,i.h){case c.HorizontalPlacement.Left:s.x-=e.max.x;break;case c.HorizontalPlacement.Right:s.x-=e.min.x}switch(i.v){case c.VerticalPlacement.Top:s.y-=e.min.y;break;case c.VerticalPlacement.Center:s.y-=.5*(e.max.y+e.min.y);break;case c.VerticalPlacement.Bottom:s.y-=e.max.y}if(t.iconInfoList){let e=0,r=0;if(t.iconCompositionType===d.IconCompositionType.NEXT_TO_EACH_OTHER)for(let i=0;i<t.iconInfoList.length;i++){const n=t.iconInfoList[i];(0,f.imageIsRenderable)(n)&&((0,u.assert)(void 0!==n.computedWidth),(0,u.assert)(void 0!==n.computedHeight),e+=n.computedWidth,r=n.computedHeight)}else{const i=t.iconInfoList[0];(0,f.imageIsRenderable)(i)&&((0,u.assert)(void 0!==i.computedWidth),(0,u.assert)(void 0!==i.computedHeight),e=i.computedWidth,r=i.computedHeight)}s.x+=e*(.5+i.h),s.y+=r*(.5+i.v);const o=(0,c.hPlacementFromAlignment)(t.layoutStyle.horizontalAlignment),l=(0,c.vPlacementFromAlignment)(t.layoutStyle.verticalAlignment);if(o!==i.h||l!==i.v){const e=t.technique;let r=(0,a.getPropertyValue)(e.iconXOffset,n),h=(0,a.getPropertyValue)(e.iconYOffset,n);r="number"==typeof r?r:0,h="number"==typeof h?h:0;const u=o-i.h,p=l-i.v,d=r-t.xOffset,m=h-t.yOffset;o===c.HorizontalPlacement.Center||l===c.VerticalPlacement.Center?(s.x+=2*Math.abs(u)*d,s.y-=2*p*Math.abs(d),s.y+=2*Math.abs(p)*m,s.x-=2*u*Math.abs(m)):(s.x+=2*Math.min(Math.abs(u),.5)*d,s.y-=2*Math.sign(p)*Math.min(Math.abs(p),.5)*Math.abs(d),s.y+=2*Math.min(Math.abs(p),.5)*m,s.x-=2*Math.sign(u)*Math.min(Math.abs(u),.5)*Math.abs(m))}}return s.multiplyScalar(r),s}(v,b,i,r,s,R).add(e);return y.set(x.x,x.y,t.renderDistance),F(v,b,r,x,s,g.Margin.CHECK),l.isVisible(I)?(_&&(T.getSize(D),D.multiplyScalar(r),I.set(O.x-D.x/2,O.y-D.y/2,D.x,D.y)),!v.textMayOverlap&&l.isAllocated(I)?k.Rejected:(v.textReservesSpace&&(F(v,b,r,x,s,g.Margin.ALLOCATE),l.allocate(I)),_?(v.textBufferObject=void 0,v.textBounds=v.textBounds?v.textBounds.copy(b):b.clone()):U(n,i),t.textPlacement=i,k.Ok)):k.Invisible}function F(t,e,i,r,n,o=g.Margin.NONE){var s,l,c;const u=t.technique;let p=0;u&&((0,h.isIconTextTechnique)(u)||(0,h.isTextTechnique)(u))&&(o===g.Margin.CHECK?p=null!==(l=null!==(s=(0,a.getPropertyValue)(u["check-margin"],n))&&void 0!==s?s:(0,a.getPropertyValue)(u.margin,n))&&void 0!==l?l:0:o===g.Margin.ALLOCATE&&(p=null!==(c=(0,a.getPropertyValue)(u.margin,n))&&void 0!==c?c:0)),T.copy(e).translate(r),T.getCenter(O),T.expandByScalar(p),T.getSize(D),D.multiplyScalar(i),I.set(O.x-D.x/2,O.y-D.y/2,D.x,D.y)}function U(t,e){t.textLayoutStyle.horizontalAlignment=(0,c.hAlignFromPlacement)(e.h),t.textLayoutStyle.verticalAlignment=(0,c.vAlignFromPlacement)(e.v)}!function(t){t[t.Ok=0]="Ok",t[t.Rejected=1]="Rejected",t[t.Invisible=2]="Invisible"}(k=e.PlacementResult||(e.PlacementResult={}
2)),e.placeIcon=function(t,e,i,r,n){return g.ImageRenderer.computeIconScreenBox(t,e,i,r,I,g.Margin.CHECK),n.isVisible(I)?!0!==t.mayOverlap&&n.isAllocated(I)?k.Rejected:k.Ok:k.Invisible},e.placeText=function(t,e,i,r,n,o,s,a=!1){(0,u.assert)(void 0!==t.iconText.layoutStyle);const l=t.iconText.layoutStyle;return(a=a&&void 0!==l.placements&&l.placements.length>1)?function(t,e,i,r,n,o,s){(0,u.assert)(void 0!==t.iconText.layoutStyle);const a=t.iconText,l=t.visible,c=t.textPlacement,h=a.layoutStyle.placements,p=h.length,d=h.findIndex(t=>t.h===c.h&&t.v===c.v);(0,u.assert)(d>=0);let m=!0;for(let a=d;a<p+d;++a){const c=a===d&&l,u=N(t,e,h[a%p],i,r,n,o,!c,S);if(u===k.Ok)return s.copy(S),k.Ok;c&&s.copy(S),m=m&&u===k.Invisible}return m?k.Invisible:k.Rejected}(t,e,i,r,n,o,s):function(t,e,i,r,n,o,s){return(0,u.assert)(void 0!==t.iconText.layoutStyle),N(t,e,t.textPlacement,i,r,n,o,!t.visible,s)}(t,e,i,r,n,o,s)},e.placePathLabel=function(t,e,i,r,n){if(A.path=e,A.outputCharacterBounds=M,A.letterCaseArray=t.iconText.glyphCaseArray,A.horizontalOffset=(0,c.getHorizontalOffset)(t.iconText),!r.measureText(t.iconText.glyphs,T,A))return k.Rejected;if(P.copy(T.translate(i)),!n.isVisible(P))return k.Invisible;let o,s=!1;t.iconText.textMayOverlap||(o=n.search(P),s=o.length>0),C.length=M.length;for(let t=0;t<M.length;++t){const e=M[t].translate(i);let r=C[t];
2if(void 0===r?(r=new p.CollisionBox(e),C[t]=r):r.copy(e),s&&n.intersectsDetails(r,o))return k.Rejected}if(t.iconText.textReservesSpace){const t=new p.DetailedCollisionBox(P,C.slice());C.length=0,n.allocate(t)}return k.Ok},e.isPathLabelTooSmall=function(t,e,i,r){var n;if((0,u.assert)(t.type===m.IconTextType.PathLabel),0===(null===(n=t.renderParams.fontSize)||void 0===n?void 0:n.size))return!0;i.length=0;let o=!1;for(const[n,s]of t.points.entries())j({iconText:t,tmpPosition:y,tmpCameraDir:v,env:r,currentInd:n}),y.copy(s),void 0!==(o?e.project(y.sub(v),L):e.projectToScreen(y.sub(v),L))&&(o=!0,i.push(L.clone()));if(!o)return!0;const s=5*t.text.length;return T.setFromPoints(i),T.max.sub(T.min).lengthSq()<s*s&&(t.dbgPathTooSmall=!0,!0)};const z=new l.OrientedBox3;function j({iconText:t,tmpPosition:e,tmpCameraDir:i,env:r,currentInd:n}){var o;if(!Array.isArray(t.points))return;0===n?(e.copy(t.points[1]),e.sub(t.points[0]).normalize()):(e.copy(t.points[n]),e.sub(t.points[n-1]).normalize());const s=(0,a.getPropertyValue)(null===(o=t.technique)||void 0===o?void 0:o["world-line-offset"],r);i.set(-e.y,e.x,0).multiplyScalar(s)}e.getWorldPosition=function(t,e,i,r){var o;const s=(0,a.getPropertyValue)(null===(o=t.technique)||void 0===o?void 0:o.worldOffset,i);if(null==r||r.copy(t.position),null!=s&&void 0!==t.offsetDirection){e.localTangentSpace(t.position,z);const i=z.yAxis,o=(0,n.degToRad)(t.offsetDirection);i.applyAxisAngle(z.zAxis.negate(),o),r.addScaledVector(z.yAxis,s)}return r}},7234:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PlacementStats=void 0,e.PlacementStats=class{constructor(t){this.m_logger=t,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 t=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",t),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:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RenderState=e.DEFAULT_FADE_TIME=e.FadingState=void 0;const r=i(3334),n=i(4342);var o;!function(t){t[t.Undefined=0]="Undefined",t[t.FadingIn=1]="FadingIn",t[t.FadedIn=2]="FadedIn",t[t.FadingOut=-1]="FadingOut",t[t.FadedOut=-2]="FadedOut"}(o=e.FadingState||(e.FadingState={})),e.DEFAULT_FADE_TIME=300,e.RenderState=class{constructor(t=e.DEFAULT_FADE_TIME){this.fadeTime=t,this.value=0,this.startTime=0,this.opacity=0,this.m_state=o.Undefined}reset(){this.m_state=o.Undefined,this.value=0,this.startTime=0,this.opacity=0}isUndefined(){return this.m_state===o.Undefined}isFading(){return this.m_state===o.FadingIn||this.m_state===o.FadingOut}isFadingIn(){return this.m_state===o.FadingIn}isFadingOut(){return this.m_state===o.FadingOut}isFadedIn(){return this.m_state===o.FadedIn}isFadedOut(){return this.m_state===o.FadedOut}isVisible(){return this.m_state!==o.FadedOut&&this.m_state!==o.Undefined&&this.opacity>0}startFadeIn(t,e){if(this.m_state!==o.FadingIn&&this.m_state!==o.FadedIn){if(!0===e||0===this.fadeTime)return this.value=1,this.opacity=1,this.m_state=o.FadedIn,void(this.startTime=t);this.m_state===o.FadingOut?(this.value=1-this.value,this.startTime=t-this.value*this.fadeTime):(this.startTime=t,this.value=0,this.opacity=0),this.m_state=o.FadingIn}}startFadeOut(t){this.m_state!==o.FadingOut&&this.m_state!==o.FadedOut&&this.m_state!==o.Undef
2ined&&(this.m_state===o.FadingIn?(this.startTime=t-this.value*this.fadeTime,this.value=1-this.value):(this.startTime=t,this.value=0,this.opacity=1),this.m_state=o.FadingOut)}updateFading(t,e){if(this.m_state!==o.FadingIn&&this.m_state!==o.FadingOut)return;0===this.startTime&&(this.startTime=t);const i=t-this.startTime,s=this.m_state===o.FadingIn?0:1,a=this.m_state===o.FadingIn?1:0;e||i>=this.fadeTime?(this.value=1,this.opacity=a,this.m_state=this.m_state===o.FadingIn?o.FadedIn:o.FadedOut):(this.value=i/this.fadeTime,this.opacity=(0,r.clamp)(n.MathUtils.smootherStep(s,a,this.value),0,1),(0,n.assert)(this.isFading()))}}},859:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.UpdateStats=void 0;const r=i(9913);e.UpdateStats=class{constructor(t){this.m_logger=t,this.tiles=0,this.totalGroups=0,this.newGroups=0,this.totalLabels=0,this.results=new Array(r.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[r.PrePlacementResult.Ok]),this.m_logger.debug("Invisible",this.results[r.PrePlacementResult.Invisible]),this.m_logger.debug("Too far",this.results[r.PrePlacementResult.TooFar]),this.m_logger.debug("Duplicate",this.results[r.PrePlacementResult.Duplicate])}}},4298:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BoxBuffer=e.BoxBufferMesh=void 0;const r=i(6271),n=i(9365),o=i(3148),s=i(5269),a=i(4342),l=i(161);class c extends s.Mesh{constructor(t,e){super(t,e),this.type="BoxBufferMesh"}get isEmpty(){if(void 0===this.geometry)return!0;{const t=this.geometry;return null===t.index||0===t.index.count}}}e.BoxBufferMesh=c;class h{constructor(t,e=0,i=0,r=32768){this.m_material=t,this.m_renderOrder=e,this.m_maxElementCount=r,this.m_size=0,this.resizeBuffer(i),this.m_pickInfos=new Array}clone(){return new h(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(t=1){const e=this.m_indexAttribute;if(e.count+6*t>=e.array.length){if(e.array.length>=6*this.m_maxElementCount)return!1;const t=Math.min(this.m_maxElementCount,0===this.size?256:2*this.size);this.resize(t)}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(t){this.m_positionAttribute.count=t.positionAttributeCount,this.m_colorAttribute.count=t.colorAttributeCount,this.m_uvAttribute.count=t.uvAttributeCount,this.m_indexAttribute.count=t.indexAttributeCount,this.m_pickInfos.length=t.pickInfoCount}addBox(t,e,i,r,n,o){if(!this.canAddElements())return!1;const{s0:s,t0:a,s1:l,t1:c}=e,{x:h,y:u,w:p,h:d}=t,m=i.r*r,f=i.g*r,g=i.b*r,y=r,v=this.m_positionAttribute,_=this.m_colorAttribute,b=this.m_uvAttribute,x=this.m_indexAttribute,w=v.count,S=x.count;return v.setXYZ(w,h,u,n),v.setXYZ(w+1,h+p,u,n),v.setXYZ(w+2,h,u+d,n),v.setXYZ(w+3,h+p,u+d,n),_.setXYZW(w,m,f,g,y),_.setXYZW(w+1,m,f,g,y),_.setXYZW(w+2,m,f,g,y),_.setXYZW(w+3,m,f,g,y),b.setXY(w,s,a),b.setXY(w+1,l,a),b.setXY(w+2,s,c),b.setXY(w+3,l,c),x.setX(S,w),x.setX(S+1,w+1),x.setX(S+2,w+2),x.setX(S+3,w+2),x.setX(S+4,w+1),x.setX(S+5,w+3),v.count+=4,_.count+=4,b.count+=4,x.count+=6,this.m_pickInfos.push(o),!0}updateBufferGeometry(){const t=this.m_positionAttribute,e=this.m_colorAttribute,i=this.m_uvAttribute,r=this.m_indexAttribute;t.count>0&&(t.needsUpdate=!0,t.updateRange.offset=0,t.updateRange.count=4*t.count),e.count>0&&(e.needsUpdate=!0,e.updateRange.offset=0,e.updateRange.count=4*e.count),i.count>0&&(i.needsUpdate=!0,i.updateRange.offset=0,i.updateRange.count=4*i.count),r.count>0&&(r.needsUpdate=!0,r.updateRange.offset=0,r.updateRange.count=r.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(t,e,i){var r;const n=this.m_pickInfos.length,o=this.m_pickInfos,s=this.m_positionAttribute,l=t.x,c=t.y;for(let t=0;t<n;t++){const n=4*t,h=s.getX(n);if(l<h)continue;const u=s.getX(n+1);if(l>u)continue;const p=s.getY(n);if(c<p)continue;const d=s.getY(n+2);if(c>d)continue;const m=new a.Math2D.Box(h,p,u-h,d-p),f=o[t];if(void 0!==i&&void 0!==f&&void 0!==f.uvBoxForPicking&&this.isPixelTrans
2parent(i,l,c,m,f.uvBoxForPicking))continue;const g=null===(r=o[t])||void 0===r?void 0:r.iconText;g&&e(g)}}resize(t,e){return void 0!==this.m_geometry&&this.m_geometry.dispose(),this.m_geometry=new o.BufferGeometry,void 0!==t&&(!0===e||t>this.size)&&this.resizeBuffer(t),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 c(this.m_geometry,this.m_material),this.m_mesh.renderOrder=this.m_renderOrder):this.m_mesh.geometry=this.m_geometry,this.m_mesh}updateMemoryUsage(t){const e=3*this.m_positionAttribute.count*4+4*this.m_colorAttribute.count+4*this.m_uvAttribute.count*4+4*this.m_indexAttribute.count;t.heapSize+=e,t.gpuSize+=e}isPixelTransparent(t,e,i,r,n){const{u:o,v:s}=(0,l.screenToUvCoordinates)(e,i,r,n),{width:a,height:c}=t instanceof SVGImageElement?t.getBBox():t,h=a*o,u=c*s,p=(0,l.getPixelFromImage)(h,u,t);return void 0!==p&&0===p[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(t){const e=new Float32Array(4*t*3);if(void 0!==this.m_positionAttribute&&this.m_positionAttribute.array.length>0){const t=this.m_positionAttribute.count;e.set(this.m_positionAttribute.array),this.m_positionAttribute.array=e,this.m_positionAttribute.count=t}else this.m_positionAttribute=new n.BufferAttribute(e,3),this.m_positionAttribute.count=0,this.m_positionAttribute.setUsage(r.DynamicDrawUsage);const i=new Uint8Array(4*t*4);if(void 0!==this.m_colorAttribute){const t=this.m_colorAttribute.count;i.set(this.m_colorAttribute.array),this.m_colorAttribute.array=i,this.m_colorAttribute.count=t}else this.m_colorAttribute=new n.BufferAttribute(i,4,!0),this.m_colorAttribute.count=0,this.m_colorAttribute.setUsage(r.DynamicDrawUsage);const o=new Float32Array(4*t*4);if(void 0!==this.m_uvAttribute){const t=this.m_uvAttribute.count;o.set(this.m_uvAttribute.array),this.m_uvAttribute.array=o,this.m_uvAttribute.count=t}else this.m_uvAttribute=new n.BufferAttribute(o,4),this.m_uvAttribute.count=0,this.m_uvAttribute.setUsage(r.DynamicDrawUsage);const s=6*t*1,a=s>65535?new Uint32Array(s):new Uint16Array(s);if(void 0!==this.m_indexAttribute){const t=this.m_indexAttribute.count;a.set(this.m_indexAttribute.array),this.m_indexAttribute.array=a,this.m_indexAttribute.count=t}else this.m_indexAttribute=new n.BufferAttribute(a,1),this.m_indexAttribute.count=0,this.m_indexAttribute.setUsage(r.DynamicDrawUsage);this.m_size=t}}e.BoxBuffer=h},3174:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IconInfoBuilder=void 0;const r=i(8152),n=i(4342),o=i(207);e.IconInfoBuilder=class{constructor(t){this.m_env=t}withTechnique(t){return this.m_imageTextureName=void 0!==t.imageTexture?(0,r.getPropertyValue)(t.imageTexture,this.m_env):void 0,this.m_technique=t,this}withIcon(t){return void 0!==t&&(this.m_imageTextureName=t),this}build(t){var e,i,s,a;(0,n.assert)(void 0!==this.m_technique);const l=this.m_technique,c=this.m_env,h=null===(e=this.m_imageTextureName)||void 0===e?void 0:e.split(",").filter((t,e,i)=>t&&i.indexOf(t)===e);if(void 0===h)return;const u=null!==(i=l.iconMayOverlap)&&void 0!==i?i:l.textMayOverlap,p=null!==(s=l.iconReserveSpace)&&void 0!==s?s:l.textReserveSpace,d=(0,r.getPropertyValue)(l.iconColor,c),m=null!==d?o.ColorCache.instance.getColor(d):void 0,f=[];for(let e=0;e<h.length;e++){const i={technique:l,imageTextureName:h[e],iconText:t,mayOverlap:u,reserveSpace:p,iconBrightness:n.MathUtils.clamp(null!==(a=l.iconBrightness)&&void 0!==a?a:1,0,1),iconColor:m};f.push(i)}return f.length>0?f:void 0}}},5154:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.imageIsRenderable=void 0,e.imageIsRenderable=function(t){return void 0!==t.buffer}},5570:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImageRenderer=e.Margin=e.ImageBatchRegistry=e.ImageBuffer=void 0;const r=i(5971),n=i(5448),o=i(5808),s=i(8152),a=i(4250),l=i(4342),c=i(7063),h=i(6802),u=i(4298),p=l.LoggerManager.instance.create("IconRenderer"),d=new r.Color(1,1,1),m=new r.Color;class f{constructor(t,e,i){this.buffer=t,this.layer=e,this.m_onDispose=i,this.m_refCount=0}increaseRefCount(){return++this.m_refCount,this}decreaseRefCount(){return(0,l.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()}}e.ImageBuffer=f;class g{constructor(t,e,i,r){this.m_rendererCapabilities=t,this.imageItem=e,this.m_onDispose=i,(0,l.assert)(void 0!==this.imageItem.image);const n=(0,c.loadTexture)(this.imageItem.image,r,{magFilter:"linear",minFilter:g.trilinear?"linearMipMapLinear":"linear"});(0,l.assert)(void 0!==n),g.trilinear&&this.imageItem.mipMaps&&(n.mipmaps=this.imageItem.mipMaps,n.image=n.mipmaps[0]),n.flipY=!1,n.premultiplyAlpha=!0,this.m_material=new a.IconMaterial({rendererCapabilities:this.m_rendererCapabilities,map:n}),this.m_imageBuffers=new Map}getBuffer(t){let e=this.m_imageBuffers.get(t.id);if(e)return e.increaseRefCount();const i=new u.BoxBuffer(this.m_material,t.id),r=i.mesh;return r.frustumCulled=!1,t.scene.add(r),e=new f(i,t,()=>{this.disposeBuffer(t.id)}),this.m_imageBuffers.set(t.id,e),e.increaseRefCount()}reset(){for(const t of this.m_imageBuffers.values())t.buffer.reset()}update(){for(const t of this.m_imageBuffers.values())t.buffer.updateBufferGeometry()}pickBoxes(t,e,i){for(const r of this.m_imageBuffers.values())r.buffer.pickBoxes(t,e,i)}updateMemoryUsage(t){if(void 0!==this.imageItem.image){const e=this.imageItem.image.width*this.imageItem.image.height*4;t.heapSize+=e,t.gpuSize+=e}for(const e of this.m_imageBuffers.values())e.buffer.updateMemoryUsage(t)}dispose(){this.m_imageBuffers.clear(),this.m_material.map.dispose(),this.m_material.dispose(),this.m_onDispose()}disposeBuffer(t){(0,l.assert)(this.m_imageBuffers.size>0),this.m_imageBuffers.delete(t),0===this.m_imageBuffers.size&&this.dispose()}}g.trilinear=!0;class y{constructor(t,e){this.m_rendererCapabilities=t,this.m_textureCache=e,this.m_batchMap=new Map}registerImage(t,e){var i;const{imageItem:r,imageTexture:n}=t;if(!r)return;(0,l.assert)(void 0!==t.imageTextureName);const o=null!==(i=null==n?void 0:n.url)&&void 0!==i?i:t.imageTextureName;let s=this.m_batchMap.get(o);return void 0===s&&(s=new g(this.m_rendererCapabilities,r,()=>{this.deleteBatch(o)},this.m_textureCache),this.m_batchMap.set(o,s)),s.getBuffer(e)}addIcon(t,e,i,r){if(!1===t.isValid||!t.buffer)return void p.warn("IconBatchRegistry: trying to add iconInfo without buffer prepared: ",t.imageTextureName);let n;(0,l.assert)(void 0!==t.uvBox),void 0!==t.iconBrightness?(n=m.setScalar(t.iconBrightness),void 0!==t.iconColor&&(n=m.multiply(t.iconColor))):n=void 0!==t.iconColor?t.iconColor:d,t.buffer.buffer.addBox(e,t.uvBox,n,r,i,t)}
2addTextBackground(t,e,i){if(!1===t.isValid||!t.buffer)return void p.warn("IconBatchRegistry: trying to add background image without buffer prepared: ",t.imageTextureName);(0,l.assert)(void 0!==t.uvBox);const r=d;t.buffer.buffer.addBox(e,t.uvBox,r,1,i,t)}reset(){for(const t of this.m_batchMap.values())t.reset()}update(){for(const t of this.m_batchMap.values())t.update()}pickImageTexts(t,e){for(const i of this.m_batchMap.values())i.pickBoxes(t,e,i.imageItem.image)}updateMemoryUsage(t){for(const e of this.m_batchMap.values())e.updateMemoryUsage(t)}deleteBatch(t){this.m_batchMap.delete(t)}}var v;e.ImageBatchRegistry=y,function(t){t[t.ALLOCATE=0]="ALLOCATE",t[t.CHECK=1]="CHECK",t[t.NONE=2]="NONE"}(v=e.Margin||(e.Margin={}));class _{static computeIconScreenBox(t,e,i,r,n=new l.Math2D.Box,o=v.NONE){var a,c,h;(0,l.assert)(void 0!==t.buffer);const u=t.technique;let p=0;o===v.CHECK?p=null!==(c=null!==(a=(0,s.getPropertyValue)(u["check-margin"],r))&&void 0!==a?a:(0,s.getPropertyValue)(u.margin,r))&&void 0!==c?c:0:o===v.ALLOCATE&&(p=null!==(h=(0,s.getPropertyValue)(u.margin,r))&&void 0!==h?h:0);const d=t.computedWidth*i+2*p,m=t.computedHeight*i+2*p,f=(0,s.getPropertyValue)(u.iconXOffset,r),g=(0,s.getPropertyValue)(u.iconYOffset,r),y=e.x+("number"==typeof f?f:0)*i,_=e.y+("number"==typeof g?g:0)*i;return n.x=y-d/2,n.y=_-m/2,n.w=d,n.h=m,n}constructor(t,e,i){this.m_renderer=t,this.m_imageRepo=e,this.m_textureCache=i,this.m_tempScreenBox=new l.Math2D.Box,this.m_layers=[],this.m_imageBatchRegistry=new y(this.renderer.capabilities,this.m_textureCache)}get renderer(){return this.m_renderer}prepareIcon(t,e){if(void 0!==t.buffer)return!0;const i=t.imageTextureName;if(void 0===i)return t.isValid=!1,!1;const r=this.m_imageRepo.findImage(i);if(r){const{imageItem:i,imageTexture:n}=r;if(i.loaded)return this.setupIconInfo(t,i,e,n),!0}return this.m_imageRepo.loadImage(i).then(e=>{t.isValid=!0}).catch(e=>{t.imageItem=null,t.isValid=!1}),!1}prepareIcons(t,e){let i=!1;const r=t.iconInfoList;return r&&t.visible&&(i=!0,r.forEach(t=>{i=this.prepareIcon(t,e)&&i})),i}prepareTextBackground(t){var e;const i=t.textBackgroundInfo;if(!1===t.visible)return!1;if(void 0===(null==i?void 0:i.imageTextureName))return!0;if(void 0!==(null===(e=t.textBackgroundInfo)||void 0===e?void 0:e.buffer))return!0;if(t.textBounds){const e=null==i?void 0:i.imageTextureName,r=new n.Vector2;t.textBounds.getSize(r);const o=h.MipMapGenerator.getPaddedSize(r.x,r.y),s=this.m_imageRepo.findImage(e,o);if(s){const{imageItem:t,imageTexture:e}=s;if(t.loaded)return this.setupTextBackgroundInfo(i,t,r,o,e),!0}this.m_imageRepo.loadImage(e,o).then(t=>{i.isValid=!0}).catch(t=>{p.error(t),i.imageItem=null,i.isValid=!1})}return!1}reset(){this.m_imageBatchRegistry.reset()}addIcon(t,e,i,r,n,o,s,a){(0,l.assert)(void 0!==t.buffer),o&&(_.computeIconScreenBox(t,e,n,a,this.m_tempScreenBox,v.ALLOCATE),i.allocate(this.m_tempScreenBox)),s>0&&(_.computeIconScreenBox(t,e,n,a,this.m_tempScreenBox,v.NONE),this.m_imageBatchRegistry.addIcon(t,this.m_tempScreenBox,r,s))}addTextBackground(t,e,i,r,n){(0,l.assert)(void 0!==t.buffer),(i=i.clone()).min.x*=n,i.min.y*=n,i.max.x*=n,i.max.y*=n,i.translate(e);const o=new l.Math2D.Box(i.min.x,i.min.y,i.max.x-i.min.x,i.max.y-i.min.y);this.m_imageBatchRegistry.addTextBackground(t,o,r)}update(){this.m_imageBatchRegistry.update()}get layers(){return this.m_layers}render(t,e){this.m_renderer.render(e.scene,t)}pickIconTexts(t,e){this.m_imageBatchRegistry.pickImageTexts(t,e)}getMemoryUsage(t){this.m_imageBatchRegistry.updateMemoryUsage(t)}addLayer(t){let e=this.m_layers.find(e=>e.id===t);return void 0===e&&(e={id:t,scene:new o.Scene},this.m_layers.push(e),this.m_layers.sort((t,e)=>t.id-e.id)),e}setupTextBackgroundInfo(t,e,i,r,n){var o,s;if((0,l.assert)(void 0===t.uvBox),!e.image)return p.error("setupTextBackgroundInfo: No imageItem/imageData found"),void(t.isValid=!1);const a=e.image.width,c=e.image.height,h=g.trilinear&&e.mipMaps,u=a/(h?r.width:a),d=c/(h?r.height:c);t.computedWidth=null!==(o=null==i?void 0:i.x)&&void 0!==o?o:a,t.computedHeight=null!==(s=null==i?void 0:i.y)&&void 0!==s?s:c,t.uvBox={s0:0,t0:d,s1:u,t1:0},t.imageItem=e,t.imageTexture=n,t.buffer=this.m_imageBatchRegistry.registerImage(t,this.addLayer(t.renderOrder)),t.isValid=!0}setupIconInfo(t,e,i,r){var n,o;if((0,l.assert)(void 0===t.uvBox),!e.image)return p.error("setupImageInfo: No imageItem/imageData found"),void(t.isValid=!1);const a=t.technique,c=e.image.width,u=e.image.height,d=h.MipMapGenerator.getPaddedSize(c,u),m=g.trilinear&&e.mipMaps,f=m?d.width:c,y=m?d.height:u,v=void 0!==(null==r?void 0:r.width)?r.width:c,_=void 0!==(null==r?void 0:r.height)?r.height:u,b=void 0!==(null==r?void 0:r.width)?r.width:c,x=void 0!==(null==r?void 0:r.height)?r.height:u,w=void 0!==(null==r?void 0:r.xOffset)?r.xOffset:0,S=void 0!==(null==r?void 0:r.yOffset)?r.yOffset:0,T=w/f,E=(w+b)/f,M=S/y,A=(S+x)/y;let C=null!==(n=a.iconScale)&&void 0!==n?n:.5,P=null!==(o=a.iconScale)&&void 0!==o?o:.5;const L=(0,s.getPropertyValue)(a.screenWidth,i);null!=L&&(P=C=L/v);const R=(0,s.getPropertyValue)(a.screenHeight,i);null!=R&&(P=R/_,void 0!==L&&(C=P)),t.computedWidth=v*C,t.computedHeight=_*P,t.uvBox={s0:T,t0:A,s1:E,t1:M},t.uvBoxForPicking={s0:w/c,t0:(S+x)/u,s1:(w+b)/c,t1:S/u},t.imageItem=e,t.imageTexture=r,t.buffer=this.m_imageBatchRegistry.registerImage(t,this.addLayer(t.renderOrder)),t.isValid=!0}}e.ImageRenderer=_},161:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.screenToUvCoordinates=e.getPixelFromImage=void 0;const r=i(4342);let n,o;e.getPixelFromImage=function(t,e,i){return i instanceof ImageData?function(t,e,i){const{width:n,height:o,data:s}=t,a=s.length/(o*n);if(!r.MathUtils.isWithinBounds(e,0,n)||!r.MathUtils.isWithinBounds(i,0,o))return;const l=(i*n+e)*a;return s.slice(l,l+a)}(i,t,e):function(t,e,i){const{width:s,height:a}=t instanceof SVGImageElement?t.getBBox():t;if(r.MathUtils.isWithinBounds(e,0,s)&&r.MathUtils.isWithinBounds(i,0,a)&&(n||(n=document.createElement("canvas"),o=n.getContext("2d",{willReadFrequently:!0})),o))return n.width=s,n.height=a,o.drawImage(t,0,0),o.getImageData(e,i,1,1).data}(i,t,e)},e.screenToUvCoordinates=function(t,e,i,n){const o=i.x,s=i.x+i.w,a=i.y,l=i.y+i.h;return{u:r.MathUtils.map(t,o,s,n.s0,n.s1),v:r.MathUtils.map(e,a,l,n.t0,n.t1)}}},6445:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LayoutState=void 0;const r=i(5823);e.LayoutState=class{constructor(t){this.m_hAlign=r.DefaultTextStyle.DEFAULT_HORIZONTAL_ALIGNMENT,this.m_vAlign=r.DefaultTextStyle.DEFAULT_VERTICAL_ALIGNMENT,this.textPlacement=t}set textPlacement(t){this.m_hAlign=(0,r.hAlignFromPlacement)(t.h),this.m_vAlign=(0,r.vAlignFromPlacement)(t.v)}get textPlacement(){return{h:(0,r.hPlacementFromAlignment)(this.m_hAlign),v:(0,r.vPlacementFromAlignment)(this.m_vAlign)}}reset(t){this.m_hAlign=t.horizontalAlignment,this.m_vAlign=t.verticalAlignment}get horizontalAlignment(){return this.m_hAlign}get verticalAlignment(){return this.m_vAlign}}},4957:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SimplePath=e.PathParam=e.SimpleLineCurve=void 0;const r=i(8117),n=i(7793);class o extends n.LineCurve{constructor(t,e){super(t,e)}getLengths(){return void 0===this.m_lengths&&(this.m_lengths=[0,this.v2.distanceTo(this.v1)]),this.m_lengths}}e.SimpleLineCurve=o;class s{constructor(t,e,i){this.path=t,this.index=e,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}}e.PathParam=s;class a extends r.Path{constructor(){super()}getLengths(){if(this.m_cache)return this.m_cache;let t=0;const e=new Array;return e.push(0),this.curves.forEach(i=>{const r=i;t+=r.v1.distanceTo(r.v2),e.push(t)}),this.m_cache=e,e}getParamAt(t){const e=t*this.getLength(),i=this.getCurveLengths();for(let t=0;t<i.length;++t){if(i[t]<e)continue;const r=i[t]-e,n=this.curves[t].getLength();return new s(this,t,0===n?0:1-r/n)}return null}}e.SimplePath=a},9463:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextCanvasFactory=void 0;const r=i(5823),n=i(4342);e.TextCanvasFactory=class{constructor(t){this.m_renderer=t,this.m_minGlyphCount=0,this.m_maxGlyphCount=0}setGlyphCountLimits(t,e){this.m_minGlyphCount=t,this.m_maxGlyphCount=e}createTextCanvas(t,e){return(0,n.assert)(this.m_maxGlyphCount>0),new r.TextCanvas({renderer:this.m_renderer,fontCatalog:t,minGlyphCount:this.m_minGlyphCount,maxGlyphCount:this.m_maxGlyphCount,name:e})}}},3800:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextStyleCache=void 0;const r=i(8152),n=i(5823),o=i(1984),s=i(1667),a=i(4342),l=i(207),c=i(8427),h=i(304),u=a.LoggerManager.instance.create("TextStyleCache"),p=new n.TextRenderStyle({fontSize:{unit:n.FontUnit.Pixel,size:32,backgroundSize:8},color:l.ColorCache.instance.getColor("#6d7477"),opacity:1,backgroundColor:l.ColorCache.instance.getColor("#f7fbfd"),backgroundOpacity:.5}),d=new n.TextLayoutStyle({verticalAlignment:n.VerticalAlignment.Center,horizontalAlignment:n.HorizontalAlignment.Center,placements:[]}),m="default";function f(t,e,i){const r=i?function(t){const e=[];return(t?t.toUpperCase().replace(" ","").split(","):[]).forEach(t=>{const i=function(t){if(t.length<1||t.length>2)return;const e={h:n.HorizontalPlacement.Center,v:n.VerticalPlacement.Center};let i=t.charAt(0),r=!0;switch(i){case o.PlacementToken.Top:case o.PlacementToken.North:e.v=n.VerticalPlacement.Top;break;case o.PlacementToken.Bottom:case o.PlacementToken.South:e.v=n.VerticalPlacement.Bottom;break;default:if(r=!1,2===t.length)return}if(r&&1===t.length)return e;switch(i=1===t.length?t.charAt(0):t.charAt(1),i){case o.PlacementToken.Right:case o.PlacementToken.East:e.h=n.HorizontalPlacement.Right;break;case o.PlacementToken.Left:case o.PlacementToken.West:e.h=n.HorizontalPlacement.Left;break;default:return}return e}(t);void 0!==i&&e.push(i)}),e}(i):void 0;return(0,n.resolvePlacementAndAlignment)(function(t){return"Left"===t||"Center"===t||"Right"===t?n.HorizontalAlignment[t]:d.horizontalAlignment}(t),function(t){return"Above"===t||"Center"===t||"Below"===t?n.VerticalAlignment[t]:d.verticalAlignment}(e),r)}e.TextStyleCache=class{constructor(){this.m_textStyles=new Map,this.m_defaultStyle={name:m,fontCatalog:void 0,renderParams:p.params,layoutParams:d.params},this.updateDefaultTextStyle()}updateTextStyles(t,e){this.m_textStyles.clear(),null==t||t.forEach(t=>{this.m_textStyles.set(t.name,this.createTextStyle(t,t.name))}),this.updateDefaultTextStyle(e,t)}
2updateTextCanvases(t){this.initializeTextCanvas(this.m_defaultStyle,t);for(const[,e]of this.m_textStyles)this.initializeTextCanvas(e,t)}getTextStyle(t){let e;return void 0===t?e=this.m_defaultStyle:(e=this.m_textStyles.get(t),void 0===e&&(e=this.m_defaultStyle)),e}createRenderStyle(t,e){const i=t.mapView,h=i.zoomLevel,u=Math.floor(h),p=new o.MapEnv({$zoom:u},i.env),d=this.m_defaultStyle.renderParams,m=(0,a.getOptionValue)(d.opacity,1);let f,g=(0,r.getPropertyValue)((0,a.getOptionValue)(e.opacity,m),p);if(void 0!==e.color){let t=(0,c.evaluateColorProperty)(e.color,p);void 0!==t&&(s.ColorUtils.hasAlphaInHex(t)&&(g*=s.ColorUtils.getAlphaFromHex(t),t=s.ColorUtils.removeAlphaFromHex(t)),f=l.ColorCache.instance.getColor(t))}const y=(0,a.getOptionValue)(d.fontSize.backgroundSize,0),v=(0,r.getPropertyValue)((0,a.getOptionValue)(e.backgroundSize,y),p),_=void 0!==e.backgroundColor&&void 0!==e.backgroundSize&&v>0,b=(0,a.getOptionValue)(d.backgroundOpacity,0);let x,w=(0,r.getPropertyValue)((0,a.getOptionValue)(e.backgroundOpacity,_?1:b),p);if(void 0!==e.backgroundColor){let t=(0,c.evaluateColorProperty)(e.backgroundColor,p);void 0!==t&&(s.ColorUtils.hasAlphaInHex(t)&&(w*=s.ColorUtils.getAlphaFromHex(t),t=s.ColorUtils.removeAlphaFromHex(t)),x=l.ColorCache.instance.getColor(t))}const S={fontName:(0,a.getOptionValue)(e.fontName,d.fontName),fontSize:{unit:n.FontUnit.Pixel,size:(0,r.getPropertyValue)((0,a.getOptionValue)(e.size,d.fontSize.size),p),backgroundSize:v},fontStyle:"Regular"===e.fontStyle||"Bold"===e.fontStyle||"Italic"===e.fontStyle||"BoldItalic"===e.fontStyle?n.FontStyle[e.fontStyle]:d.fontStyle,fontVariant:"Regular"===e.fontVariant||"AllCaps"===e.fontVariant||"SmallCaps"===e.fontVariant?n.FontVariant[e.fontVariant]:d.fontVariant,rotation:(0,a.getOptionValue)(e.rotation,d.rotation),color:(0,a.getOptionValue)(f,(0,a.getOptionValue)(d.color,n.DefaultTextStyle.DEFAULT_COLOR)),backgroundColor:(0,a.getOptionValue)(x,(0,a.getOptionValue)(d.backgroundColor,n.DefaultTextStyle.DEFAULT_BACKGROUND_COLOR)),opacity:g,backgroundOpacity:w},T=this.getTextStyle(e.style).renderParams;return new n.TextRenderStyle(Object.assign(Object.assign({},T),S))}createLayoutStyle(t,e){var i,s,a,l,c,h;const u=t.mapView,p=Math.floor(t.mapView.zoomLevel),d=new o.MapEnv({$zoom:p},u.env),m=this.m_defaultStyle.layoutParams,g=(0,r.getPropertyValue)(e.hAlignment,d),y=(0,r.getPropertyValue)(e.vAlignment,d),v=(0,o.isIconTextTechnique)(e)?(0,r.getPropertyValue)(e["text-placement"],d):null,{horizontalAlignment:_,verticalAlignment:b,placements:x}=f(g,y,v),w=(0,r.getPropertyValue)(e.wrappingMode,d),S="None"===w||"Character"===w||"Word"===w?n.WrappingMode[w]:m.wrappingMode,T={tracking:null!==(i=(0,r.getPropertyValue)(e.tracking,d))&&void 0!==i?i:m.tracking,leading:null!==(s=(0,r.getPropertyValue)(e.leading,d))&&void 0!==s?s:m.leading,maxLines:null!==(a=(0,r.getPropertyValue)(e.maxLines,d))&&void 0!==a?a:m.maxLines,lineWidth:null!==(l=(0,r.getPropertyValue)(e.lineWidth,d))&&void 0!==l?l:m.lineWidth,canvasRotation:null!==(c=(0,r.getPropertyValue)(e.canvasRotation,d))&&void 0!==c?c:m.canvasRotation,lineRotation:null!==(h=(0,r.getPropertyValue)(e.lineRotation,d))&&void 0!==h?h:m.lineRotation,wrappingMode:S,horizontalAlignment:_,verticalAlignment:b,placements:x},E=this.getTextStyle(e.style);return new n.TextLayoutStyle(Object.assign(Object.assign({},E),T))}updateDefaultTextStyle(t,e){var i,r;this.m_defaultStyle.fontCatalog=void 0;const n=null!==(r=null!==(i=null==e?void 0:e.find(t=>t.name===m))&&void 0!==i?i:t)&&void 0!==r?r:null==e?void 0:e[0];n&&(this.m_defaultStyle=this.createTextStyle(n,m)),this.m_defaultStyle.textCanvas=void 0}initializeTextCanvas(t,e){var i,r,n;t.textCanvas||(t.textCanvas=null!==(i=t.fontCatalog&&e.has(t.fontCatalog)?e.get(t.fontCatalog):e.get(h.DEFAULT_FONT_CATALOG_NAME))&&void 0!==i?i:e.values().next().value,void 0!==t.fontCatalog&&t.fontCatalog!==(null===(r=t.textCanvas)||void 0===r?void 0:r.name)&&u.warn(`Font catalog '${t.fontCatalog}' set in text style '${t.name}' not found.`+(t.textCanvas?` Using default font catalog ${null===(n=t.textCanvas)||void 0===n?void 0:n.name}`:"")))}createTextStyle(t,e){var i;const{horizontalAlignment:r,verticalAlignment:o,placements:s}=f(t.hAlignment,t.vAlignment,t.placements);return{name:e,fontCatalog:(0,a.getOptionValue)(t.fontCatalogName,this.m_defaultStyle.fontCatalog),renderParams:{fontName:t.fontName,fontSize:{unit:n.FontUnit.Pixel,size:32,backgroundSize:null!==(i=t.backgroundSize)&&void 0!==i?i:8},fontStyle:"Regular"===t.fontStyle||"Bold"===t.fontStyle||"Italic"===t.fontStyle||"BoldItalic"===t.fontStyle?n.FontStyle[t.fontStyle]:void 0,fontVariant:"Regular"===t.fontVariant||"AllCaps"===t.fontVariant||"SmallCaps"===t.fontVariant?n.FontVariant[t.fontVariant]:void 0,rotation:t.rotation,color:void 0!==t.color?l.ColorCache.instance.getColor(t.color):void 0,backgroundColor:void 0!==t.backgroundColor?l.ColorCache.instance.getColor(t.backgroundColor):void 0,opacity:t.opacity,backgroundOpacity:t.backgroundOpacity},layoutParams:{tracking:t.tracking,leading:t.leading,maxLines:t.maxLines,lineWidth:t.lineWidth,canvasRotation:t.canvasRotation,lineRotation:t.lineRotation,wrappingMode:"None"===t.wrappingMode||"Character"===t.wrappingMode||"Word"===t.wrappingMode?n.WrappingMode[t.wrappingMode]:n.WrappingMode.Word,verticalAlignment:o,horizontalAlignment:r,placements:s}}}}},3922:(t,e)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.TileTextStyleCache=void 0,e.TileTextStyleCache=class{constructor(t){this.textRenderStyles=[],this.textLayoutStyles=[],this.tile=t}clear(){this.textRenderStyles.length=0,this.textLayoutStyles.length=0}getRenderStyle(t,e){let i=this.textRenderStyles[t._index];return(e||void 0===i)&&(i=this.textRenderStyles[t._index]=this.tile.mapView.iconTextRenderer.styleCache.createRenderStyle(this.tile,t)),i}getLayoutStyle(t,e){let i=this.textLayoutStyles[t._index];return(e||void 0===i)&&(i=this.textLayoutStyles[t._index]=this.tile.mapView.iconTextRenderer.styleCache.createLayoutStyle(this.tile,t)),i}}},5159:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImageCache=void 0;const r=i(9237),n=i(9360);class o{constructor(){this.m_images=new Map}static get instance(){return void 0===o.m_instance&&(o.m_instance=new o),o.m_instance}static dispose(){o.m_instance=void 0}registerImage(t,e){let i=this.findImageCacheItem(e.url);return i?(void 0===t||i.owners.includes(t)||i.owners.push(t),i.imageLikeItem):(i={imageLikeItem:e,owners:[t]},this.m_images.set(e.url,i),i.imageLikeItem)}registerImageByUrl(t,e,i,o=!1){const s=o?new n.SVGMarkupItem(e):new r.ImageItem(e,i);return this.registerImage(t,s)}removeImage(t,e){const i=this.m_images.get(e);return void 0!==i&&(this.unlinkCacheItem(i,t),!0)}findImage(t){const e=this.m_images.get(t);if(void 0!==e)return e.imageLikeItem}clear(t){this.m_images.forEach(e=>{this.unlinkCacheItem(e,t)})}get size(){return this.m_images.size}findImageCacheItem(t){return this.m_images.get(t)}cancelLoading(t){t.loading&&(t.cancelled=!0)}unlinkCacheItem(t,e){const i=t.owners.indexOf(e);i>=0&&t.owners.splice(i,1),0===t.owners.length&&(this.m_images.delete(t.imageLikeItem.url),this.cancelLoading(t.imageLikeItem))}}e.ImageCache=o},9237:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImageItem=void 0;const r=i(2676),n=i(4342),o=i(6802),s=n.LoggerManager.instance.create("loadImage"),a=new o.MipMapGenerator;e.ImageItem=class{constructor(t,e){this.url=t,this.image=e}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 t=this.image;return t instanceof HTMLImageElement&&!t.complete?(this.loadingPromise=new Promise((e,i)=>{t.addEventListener("load",this.finalizeImage.bind(this,t,e)),t.addEventListener("error",i)}),this.loadingPromise):(this.finalizeImage(this.image),Promise.resolve(this))}return this.loadingPromise=new Promise((t,e)=>{s.debug(`Loading image: ${this.url}`),!0===this.cancelled?(s.debug(`Cancelled loading image: ${this.url}`),t(this)):(new r.ImageLoader).load(this.url,e=>{if(!0===this.cancelled)return s.debug(`Cancelled loading image: ${this.url}`),void t(this);this.finalizeImage(e,t)},void 0,t=>{s.error(`... loading image failed: ${this.url} : ${t}`),this.loadingPromise=void 0,e(`... loading image failed: ${this.url} : ${t}`)})}),this.loadingPromise}finalizeImage(t,e){this.image=t,this.mipMaps=a.generateTextureAtlasMipMap(this),this.loadingPromise=void 0,e&&e(this)}}},9297:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImageRepo=void 0;const r=i(5738),n=i(5159),o=i(9237),s=i(9360);e.ImageRepo=class{constructor(){this.m_iconTextManager=new r.IconTextManager}get iconTextManager(){return this.m_iconTextManager}get imageCache(){return n.ImageCache.instance}findImage(t,e){var i;const r=this.m_iconTextManager.getImageTexture(t),n=null!==(i=null==r?void 0:r.url)&&void 0!==i?i:t;let a;return e&&(a=this.imageCache.findImage(s.SVGMarkupItem.getImageItemUrl(n,e))),a||(a=this.imageCache.findImage(n)),a instanceof o.ImageItem?{imageItem:a,imageTexture:r}:void 0}async loadImage(t,e){const i=this.m_iconTextManager.getImageTexture(t),r=i?i.url:t;let n;if(e){const t=s.SVGMarkupItem.getImageItemUrl(r,e),i=this.imageCache.findImage(t);if(i)n=i;else{const i=this.imageCache.findImage(r);if(i instanceof o.ImageItem)n=i;else if(i instanceof s.SVGMarkupItem){await i.loadImage();const r=this.imageCache.findImage(t);r?n=r:(n=i.createImageItem(e),n&&this.imageCache.registerImage(this,n))}}}else{const t=this.imageCache.findImage(r);t instanceof o.ImageItem&&(n=t)}if(n)return await n.loadImage(),{imageItem:n,imageTexture:i};throw new Error(`${t} image not found`)}clear(){this.imageCache.clear(this)}}},7063:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.loadTexture=void 0;const r=i(6271),n=i(2676),o=i(1984),s=i(4342),a=i(5640),l=i(2119),c=s.LoggerManager.instance.create("LoadTexture");function h(t,e,i,r){const o=new l.TextureHandle;return(new n.ImageLoader).load(t,t=>{o.image=t,e(o)},void 0,i),r&&o.addEventListener("dispose",()=>{URL.revokeObjectURL(t)}),o}function u(t){return"nodeName"in t&&"IMG"===t.nodeName}e.loadTexture=function(t,e,i,n,s,p){const d=e.get(t);if(d)return d.addReference(),null==s||s(d),d;const m=function(t,e,i){if("string"==typeof t)return h(t,e,i,!1);if((0,o.isTextureBuffer)(t))return"image/raw"===t.type?function(t,e,i){const n=t.dataTextureProperties;if(n){const i=n.type?(0,a.toTextureDataType)(n.type):void 0,o=function(t,e){if(void 0===e)return new Uint8Array(t);switch(e){case r.UnsignedByteType:return new Uint8Array(t);case r.ByteType:return new Int8Array(t);case r.ShortType:return new Int16Array(t);case r.UnsignedShortType:return new Uint16Array(t);case r.IntType:return new Int32Array(t);case r.UnsignedIntType:return new Uint32Array(t);case r.FloatType:return new Float32Array(t);case r.HalfFloatType:return new Uint16Array(t)}throw new Error("Unsupported texture data type")}(t.buffer,i),s=n.format?(0,a.toPixelFormat)(n.format):void 0,c=l.TextureHandle.fromBufferSource(o,n.width,n.height,s,i);return e(c),c}i("no data texture properties provided.")}(t,e,i):h(URL.createObjectURL(new Blob([t.buffer],{type:t.type})),e,i,!0);if(u(t)||"nodeName"in(n=t)&&"CANVAS"===n.nodeName){const i=l.TextureHandle.fromHtmlImage(t);if(u(t)&&!t.complete){const r=()=>{e(i),t.removeEventListener("load",r)};t.addEventListener("load",r)}else e(i);return i}if(function(t){return"data"in t&&"width"in t&&"height"in t}(t)){const i=new l.TextureHandle(t);return e(i),i}var n;i("Wrong input type")}(t,t=>{n?(t.onUpdate=()=>{t.onUpdate=null,null==s||s(t)},n.initTexture(t)):null==s||s(t)},t=>{c.error("Failed to load texture: ",t),null==p||p(t)});return m&&(function(t,e){t.needsUpdate=!0,e&&(void 0!==e.wrapS&&(t.wrapS=(0,a.toWrappingMode)(e.wrapS)),void 0!==e.wrapT&&(t.wrapT=(0,a.toWrappingMode)(e.wrapT)),void 0!==e.magFilter&&(t.magFilter=(0,a.toTextureFilter)(e.magFilter)),void 0!==e.minFilter&&(t.minFilter=(0,a.toTextureFilter)(e.minFilter)),void 0!==e.flipY&&(t.flipY=e.flipY),void 0!==e.repeatU&&(t.repeat.x=e.repeatU),void 0!==e.repeatV&&(t.repeat.y=e.repeatV))}(m,i),e.set(t,m)),m}},6802:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MipMapGenerator=void 0;const r=i(3334),n=i(5448),o="undefined"==typeof window;function s(){const t=document.createElement("canvas"),e=t.getContext("2d",{willReadFrequently:!0});if(!e)throw new Error("Error getting canvas context.");return[t,e]}class a{static getPaddedSize(t,e){return new n.Vector2((0,r.ceilPowerOfTwo)(t),(0,r.ceilPowerOfTwo)(e))}constructor(){o||([this.m_paddingCanvas,this.m_paddingContext]=s(),[this.m_resizeCanvas,this.m_resizeContext]=s())}generateTextureAtlasMipMap(t){if(o)throw new Error("MipMapGenerator only works in browser.");if(void 0===t.image)throw new Error("Can not generate mip maps. Image data not loaded!");const e=t.image instanceof HTMLImageElement&&t.image.src.startsWith("data")?this.getScaledSVG(t.image):t.image,i=[];let{width:r,height:n}=a.getPaddedSize(e.width,e.height);for(this.copyImageWithPadding(e,r,n),i.push(this.m_paddingContext.getImageData(0,0,r,n)),r*=.5,n*=.5;r>=1||n>=1;){const t=i[i.length-1];i.push(this.resizeImage(t,Math.max(r,1),Math.max(n,1))),r*=.5,n*=.5}return i}getScaledSVG(t,e=2){var i;const r=t.width*e,n=t.height*e;return this.m_resizeCanvas.width=r,this.m_resizeCanvas.height=n,this.m_resizeContext.clearRect(0,0,r,n),this.m_resizeContext.drawImage(t,0,0,r,n),null===(i=this.m_resizeContext)||void 0===i?void 0:i.getImageData(0,0,r,n)}copyImageWithPadding(t,e,i){return this.m_paddingCanvas.width=e,this.m_paddingCanvas.height=i,this.m_paddingContext.clearRect(0,0,e,i),t instanceof ImageData?this.m_paddingContext.putImageData(t,0,0):this.m_paddingContext.drawImage(t,0,0),t.width!==e&&this.m_paddingContext.drawImage(this.m_paddingCanvas,t.width-1,0,1,t.height,t.width,0,e-t.width,t.height),t.height!==i&&this.m_paddingContext.drawImage(this.m_paddingCanvas,0,t.height-1,e,1,0,t.height,e,i-t.height),this.m_paddingCanvas}resizeImage(t,e,i){const r=this.copyImageWithPadding(t,t.width,t.height);return this.m_resizeCanvas.width=e,this.m_resizeCanvas.height=i,this.m_resizeContext.clearRect(0,0,e,i),this.m_resizeContext.drawImage(r,0,0,e,i),this.m_resizeContext.getImageData(0,0,e,i)}}e.MipMapGenerator=a},9360:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.SVGMarkupItem=void 0;const r=i(9237);class n{constructor(t){this.url=t,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(t=>t.text()).then(t=>(this.m_svg=t,this.loaded=!0,this))),this.loadingPromise}createImageItem(t){if(void 0===this.svg)return;const e=this.m_parser.parseFromString(this.svg,"image/svg+xml").children[0];e.setAttribute("width",`${t.width}`),e.setAttribute("height",`${t.height}`),e.setAttribute("preserveAspectRatio","none");const i=(new XMLSerializer).serializeToString(e),o=new Image;return o.src="data:image/svg+xml;base64,"+btoa(i),new r.ImageItem(n.getImageItemUrl(this.url,t),o)}static getImageItemUrl(t,e){return`${t}-${e.width}-${e.height}`}}e.SVGMarkupItem=n},5996:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextureCache=void 0;const r=i(8263),n=i(7987);class o extends r.LRUCache{constructor(){super(2e6,n.Object3DUtils.getTextureSize),this.canEvict=(t,e)=>e.referenceCount<=1,this.evictionCallback=(t,e)=>{e.removeReference()}}set(t,e){super.set(t,e),e.addReference()}}e.TextureCache=o},2119:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextureHandle=void 0;const r=i(6271),n=i(394);class o extends n.Texture{static fromBufferSource(t,e,i,n,s){const a=new o(null,void 0,void 0,void 0,r.NearestFilter,r.NearestFilter,n,s);return a.isDataTexture=!0,a.image={data:t,width:e,height:i},a.generateMipmaps=!1,a.flipY=!1,a.unpackAlignment=1,a.needsUpdate=!0,a}static fromHtmlImage(t){const e=new o(t);return e.isCanvasTexture=!0,e}constructor(t,e,i,r,n,o,s,a,l,c){super(t,e,i,r,n,o,s,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()}}e.TextureHandle=o},3638:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isWorkerBootstrapResponse=e.isWorkerBootstrapRequest=void 0,e.isWorkerBootstrapRequest=function(t){return t&&"worker-bootstrap-request"===t.type&&Array.isArray(t.dependencies)},e.isWorkerBootstrapResponse=function(t){return t&&"worker-bootstrap-response"===t.type&&Array.isArray(t.resolvedDependencies)}},1973:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerLoader=void 0;const r=i(4342),n=i(3638),o=r.LoggerManager.instance.create("WorkerLoader");class s{static startWorker(t,e=1e4){return t.startsWith("blob:")?this.startWorkerImmediately(t,e):this.directlyFallbackToBlobBasedLoading?this.startWorkerBlob(t,e):this.startWorkerImmediately(t,e).catch(i=>{if("undefined"!=typeof window){const n=window.location.href,a=new URL(t,n).href;if((0,r.getUrlOrigin)(a)===(0,r.getUrlOrigin)(n))throw i;return o.log("#startWorker: cross-origin worker construction failed, trying load with blob"),this.directlyFallbackToBlobBasedLoading=!0,s.startWorkerBlob(t,e)}throw i})}static startWorkerImmediately(t,e){try{const i=new Worker(t);return this.waitWorkerInitialized(i,e)}catch(t){return Promise.reject(t)}}static startWorkerBlob(t,e){return this.fetchScriptSourceToBlobUrl(t).then(t=>this.startWorkerImmediately(t,e))}static fetchScriptSourceToBlobUrl(t){let e=this.sourceLoaderCache.get(t);return void 0!==e||(e=fetch(t).then(t=>t.text()).catch(t=>{throw new Error(`WorkerLoader#fetchScriptSourceToBlob: failed to load worker script: ${t}`)}).then(e=>{this.sourceLoaderCache.delete(t);const i=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(i)}),this.sourceLoaderCache.set(t,e)),e}static waitWorkerInitialized(t,e){return new Promise((i,r)=>{const o=e=>{const o=e.data;if((0,n.isWorkerBootstrapRequest)(o)){const e=o.dependencies,i=[];for(const t of e){const e=this.dependencyUrlMapping[t];if(!e)return a(),void r(new Error(`#waitWorkerInitialized: Unable to resolve '${t}' as needed by worker script.`));i.push(e)}const n={type:"worker-bootstrap-response",resolvedDependencies:i};t.postMessage(n)}else a(),i(t),setTimeout(()=>{t.dispatchEvent(e)},0)},s=t=>{a();let e="Error during worker initialization";t.message&&(e+=`: ${t.message}`),"string"==typeof t.filename&&"number"==typeof t.lineno&&(e+=` in ${t.filename}:${t.lineno}`),r(new Error(e))},a=()=>{clearTimeout(l),t.removeEventListener("message",o),t.removeEventListener("error",s)};t.addEventListener("error",s),t.addEventListener("message",o);const l=setTimeout(()=>{a(),r(new Error("Timeout exceeded when waiting for first message from worker."))},e)})}}e.WorkerLoader=s,s.directlyFallbackToBlobBasedLoading=!1,s.sourceLoaderCache=new Map,s.dependencyUrlMapping={}}
2,4250:function(t,e,i){var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(8583),e),n(i(8014),e),n(i(5033),e),n(i(8177),e),n(i(8878),e),n(i(5997),e),n(i(674),e),n(i(4744),e),n(i(4258),e),n(i(398),e),n(i(4919),e),n(i(5551),e),n(i(4821),e),n(i(4877),e),n(i(8484),e),n(i(460),e),n(i(4121),e),n(i(1549),e),n(i(2462),e),n(i(182),e),n(i(872),e),n(i(9489),e),n(i(4067),e),n(i(71),e),n(i(3224),e),n(i(2141),e),n(i(3298),e),n(i(9528),e),n(i(8578),e)},460:function(t,e,i){var r=this&&this.__rest||function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(i[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]])}return i};Object.defineProperty(e,"__esModule",{value:!0}),e.CirclePointsMaterial=void 0;const n=i(4125),o=i(5971),s=i(6729),a=i(5143),l=i(2141),c=i(8578);class h extends l.RawShaderMaterial{constructor(t){const e=new o.Color;let i,l,u,p;if(t){const{size:o,color:c,opacity:d}=t,m=r(t,["size","color","opacity"]);i=o,l=c,u=d,m.name="CirclePointsMaterial",m.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",m.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}",m.uniforms=a.UniformsUtils.merge([{size:new n.Uniform(h.DEFAULT_CIRCLE_SIZE),diffuseColor:new n.Uniform(e),opacity:new n.Uniform(1)},s.UniformsLib.fog]),m.depthTest=!1,m.extensions=Object.assign(Object.assign({},m.extensions),{derivatives:!0}),p=m}super(p),(0,c.enforceBlending)(this),this.type="CirclePointsMaterial",this.setOpacity(1),void 0!==i&&(this.size=i),void 0!==l&&(this.color=l),void 0!==u&&this.setOpacity(u)}get size(){return this.uniforms.size.value}set size(t){this.uniforms.size.value=t}get color(){return this.uniforms.diffuseColor.value}set color(t){this.uniforms.diffuseColor.value.copy(t)}}e.CirclePointsMaterial=h,h.DEFAULT_CIRCLE_SIZE=1},4121:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CopyMaterial=e.CopyShader=void 0;const r=i(6271),n=i(1498);e.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 o extends n.ShaderMaterial{constructor(t){super({name:"CopyMaterial",uniforms:t,vertexShader:e.CopyShader.vertexShader,fragmentShader:e.CopyShader.fragmentShader,premultipliedAlpha:!0,transparent:!1,blending:r.NoBlending,depthTest:!1,depthWrite:!1})}}e.CopyMaterial=o},1549:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EdgeMaterial=void 0;const r=i(4125),n=i(5971),o=i(394),s=i(8014),a=i(5033),l=i(8177),c=i(2141),h=i(8578);class u extends c.RawShaderMaterial{constructor(t){var e;let i;if(t){const s={},c=void 0!==t.extrusionRatio&&t.extrusionRatio>=a.ExtrusionFeatureDefs.DEFAULT_RATIO_MIN&&t.extrusionRatio<a.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX;t.displacementMap&&(0,h.setShaderDefine)(s,"USE_DISPLACEMENTMAP",!0),c&&(0,h.setShaderDefine)(s,"USE_EXTRUSION",!0),!0===t.vertexColors&&(0,h.setShaderDefine)(s,"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 r.Uniform(new n.Color(u.DEFAULT_COLOR)),edgeColor:new r.Uniform(new n.Color(u.DEFAULT_COLOR)),edgeColorMix:new r.Uniform(u.DEFAULT_COLOR_MIX),fadeNear:new r.Uniform(l.FadingFeature.DEFAULT_FADE_NEAR),fadeFar:new r.Uniform(l.FadingFeature.DEFAULT_FADE_FAR),extrusionRatio:new r.Uniform(a.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX),displacementMap:new r.Uniform(null!==(e=t.displacementMap)&&void 0!==e?e:new o.Texture)},depthWrite:!1,defines:s,rendererCapabilities:t.rendererCapabilities}}super(i),(0,h.enforceBlending)(this),l.FadingFeature.patchGlobalShaderChunks(),s.ExtrusionFeature.patchGlobalShaderChunks(),void 0!==t&&(void 0!==t.color&&this.color.set(t.color),void 0!==t.colorMix&&(this.colorMix=t.colorMix),void 0!==t.fadeNear&&(this.fadeNear=t.fadeNear),void 0!==t.fadeFar&&(this.fadeFar=t.fadeFar),void 0!==t.displacementMap&&(this.displacementMap=t.displacementMap),void 0!==t.extrusionRatio&&(this.extrusionRatio=t.extrusionRatio))}get objectColor(){return this.uniforms.color.value}set objectColor(t){this.uniforms.color.value.copy(t)}get color(){return this.uniforms.edgeColor.value}set color(t){this.uniforms.edgeColor.value.copy(t)}get lineWidth(){return this.linewidth}set lineWidth(t){this.linewidth=t,this.linewidth<=0?this.visible=!1:this.visible=!0}get colorMix(){return this.uniforms.edgeColorMix.value}set colorMix(t){this.uniforms.edgeColorMix.value!==t&&(this.uniforms.edgeColorMix.value=t)}get fadeNear(){return this.uniforms.fadeNear.value}set fadeNear(t){this.uniforms.fadeNear.value=t}get fadeFar(){return this.uniforms.fadeFar.value}set fadeFar(t){this.uniforms.fadeFar.value!==t&&(this.uniforms.fadeFar.value=t,(0,h.setShaderMaterialDefine)(this,"USE_FADING",t>0))}get extrusionRatio(){return this.uniforms.extrusionRatio.value}set extrusionRatio(t){if(this.uniforms.extrusionRatio.value===t)return;this.uniforms.extrusionRatio.value=t;const e=t>=a.ExtrusionFeatureDefs.DEFAULT_RATIO_MIN;(0,h.setShaderMaterialDefine)(this,"USE_EXTRUSION",e)}get displacementMap(){return this.uniforms.displacementMap.value}set displacementMap(t){if(this.uniforms.displacementMap.value===t)return;this.uniforms.displacementMap.value=t;const e=null!==t;e&&(this.uniforms.displacementMap.value.needsUpdate=!0),(0,h.setShaderMaterialDefine)(this,"USE_DISPLACEMENTMAP",e)}}e.EdgeMaterial=u,u.DEFAULT_COLOR=0,u.DEFAULT_COLOR_MIX=0},2462:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.GroundAtmosphereMaterial=e.GroundAtmosphereShader=void 0;const r=i(6271),n=i(4125),o=i(5971),s=i(8333),a=i(6815),l=i(2141),c=i(1870),h=i(8578);e.GroundAtmosphereShader={uniforms:{u_eyePositionWorld:new n.Uniform(new a.Vector3),u_lightDirectionWorld:new n.Uniform(new a.Vector3(0,1,0)),u_modelViewProjection:new n.Uniform(new s.Matrix4),u_atmosphereEnv:new n.Uniform(new a.Vector3(6384515.136999999,6537590.425,0)),u_hsvCorrection:new n.Uniform(new a.Vector3(0,0,0)),topColor:new n.Uniform(new o.Color(30719)),bottomColor:new n.Uniform(new o.Color(16777215)),offset:new n.Uniform(33),exponent:new n.Uniform(.6),fogColor:new n.Uniform(new o.Color(30719)),fogNear:new n.Uniform(new o.Color(30719)),fogFar:new n.Uniform(new o.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 ${c.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 ${c.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_
2LINEAR\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 `};class u extends l.RawShaderMaterial{constructor(t){let i;t&&(i={name:"GroundAtmosphereMaterial",vertexShader:e.GroundAtmosphereShader.vertexShader,fragmentShader:e.GroundAtmosphereShader.fragmentShader,uniforms:e.GroundAtmosphereShader.uniforms,transparent:!0,depthTest:!1,depthWrite:!1,side:r.FrontSide,blending:r.NormalBlending,rendererCapabilities:t.rendererCapabilities}),super(i)}setDynamicLighting(t){(0,h.setShaderMaterialDefine)(this,"DYNAMIC_LIGHT",t)}set outerRadius(t){this.uniforms.u_atmosphereEnv.value.y=t}get outerRadius(){return this.uniforms.u_atmosphereEnv.value.y}set innerRadius(t){this.uniforms.u_atmosphereEnv.value.x=t}get innerRadius(){return this.uniforms.u_atmosphereEnv.value.x}updateUniforms(t,e,i,r){const n=this.getCameraInfo(e,i);if(void 0===t||!t.isMaterial)throw Error("Wrong object used, only Material objects are supported");if(!(t.uniforms&&t.uniforms.u_atmosphereEnv&&t.uniforms.u_hsvCorrection&&t.uniforms.u_eyePositionWorld&&t.uniforms.u_modelViewProjection&&t.uniforms.u_lightDirectionWorld))throw Error("Atmosphere material has missing uniforms");{const e=n.eyePos,i=n.modelViewProjection,o=n.eyeHeight;t.uniforms.u_eyePositionWorld.value.copy(e),t.uniforms.u_modelViewProjection.value.copy(i),t.uniforms.u_atmosphereEnv.value.z=o,t.uniforms.u_lightDirectionWorld.value=r.clone();const s=o>this.outerRadius,a=(0,h.setShaderDefine)(t.defines,"CAMERA_IN_SPACE",s),l=(0,h.setShaderDefine)(t.defines,"CAMERA_IN_ATMOSPHERE",!s);t.needsUpdate=t.needsUpdate||a||l}}getCameraInfo(t,e,i=!1){if(i){const i=(new s.Matrix4).identity(),r=(new s.Matrix4).copy(t.matrixWorld).invert().transpose(),n=e.projectionMatrix,o=new s.Matrix4;o.multiplyMatrices(r,i),o.multiplyMatrices(n,o);const l=new a.Vector3;t.getWorldPosition(l);const c=new a.Vector3;return e.getWorldPosition(c),{modelViewProjection:o,eyePos:l,eyeHeight:c.distanceTo(l)}}{const i=t.matrixWorld,r=e.matrixWorldInverse,n=e.projectionMatrix,o=new s.Matrix4;o.multiplyMatrices(r,i),o.multiplyMatrices(n,o);const l=new a.Vector3;e.getWorldPosition(l);const c=new a.Vector3;t.getWorldPosition(c);const h=c.distanceTo(l);return l.sub(c),{modelViewProjection:o,eyePos:l,eyeHeight:h}}}}e.GroundAtmosphereMaterial=u},182:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.isHighPrecisionLineMaterial=e.HighPrecisionLineMaterial=void 0;const r=i(4125),n=i(5971),o=i(8333),s=i(6815),a=i(576),l=i(2141),c=i(7133);class h extends l.RawShaderMaterial{constructor(t){Object.assign(a.ShaderChunk,c.default);const e=t?{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 r.Uniform(new n.Color(h.DEFAULT_COLOR)),opacity:new r.Uniform(h.DEFAULT_OPACITY),u_mvp:new r.Uniform(new o.Matrix4),u_eyepos:new r.Uniform(new s.Vector3),u_eyepos_lowpart:new r.Uniform(new s.Vector3)},rendererCapabilities:t.rendererCapabilities}:void 0;e&&Object.assign(e,t),super(e),this.type="HighPrecisionLineMaterial",this.isHighPrecisionLineMaterial=!0,t&&(void 0!==t.color&&this.color.set(t.color),void 0!==t.opacity&&(this.opacity=t.opacity)),this.updateTransparencyFeature()}get color(){return this.uniforms.diffuseColor.value}set color(t){this.uniforms.diffuseColor.value.copy(t)}updateTransparencyFeature(){this.transparent=this.opacity<1}}e.HighPrecisionLineMaterial=h,h.DEFAULT_COLOR=80,h.DEFAULT_OPACITY=1,e.isHighPrecisionLineMaterial=function(t){return void 0!==t&&!0===t.isHighPrecisionLineMaterial}},872:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isHighPrecisionPointMaterial=e.HighPrecisionPointMaterial=void 0;const r=i(4125),n=i(3905),o=i(5971),s=i(8955),a=i(8333),l=i(6815),c=i(576),h=i(394),u=i(7133);class p extends n.PointsMaterial{constructor(t){Object.assign(c.ShaderChunk,u.default),super(t),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=c.ShaderChunk.points_frag,this.fog=!1,this.uniforms={diffuseColor:new r.Uniform(new o.Color(p.DEFAULT_COLOR)),opacity:new r.Uniform(p.DEFAULT_OPACITY),size:new r.Uniform(p.DEFAULT_SIZE),scale:new r.Uniform(p.DEFAULT_SCALE),map:new r.Uniform(new h.Texture),uvTransform:new r.Uniform(new s.Matrix3),u_mvp:new r.Uniform(new a.Matrix4),u_eyepos:new r.Uniform(new l.Vector3),u_eyepos_lowpart:new r.Uniform(new l.Vector3)},this.isHighPrecisionPointMaterial=!0,void 0!==t&&(void 0!==t.color&&this.color.set(t.color),void 0!==t.opacity&&(this.opacity=t.opacity),void 0!==t.size&&(this.size=t.size),void 0!==t.scale&&(this.scale=t.scale),void 0!==t.uvTransform&&(this.uvTransform=t.uvTransform),void 0!==t.map&&(this.map=t.map))}get scale(){return this.uniforms.scale.value}set scale(t){this.uniforms.scale.value=t}get uvTransform(){return this.uniforms.uvTransform.value}set uvTransform(t){this.uniforms.uvTransform.value=t}}e.HighPrecisionPointMaterial=p,p.DEFAULT_COLOR=80,p.DEFAULT_OPACITY=1,p.DEFAULT_SIZE=1,p.DEFAULT_SCALE=1,e.isHighPrecisionPointMaterial=function(t){return void 0!==t&&!0===t.isHighPrecisionPointMaterial}},9489:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.IconMaterial=void 0;const r=i(4125),n=i(2141);class o extends n.RawShaderMaterial{constructor(t){super(t?{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 r.Uniform(t.map)},depthTest:!1,depthWrite:!1,transparent:!0,vertexColors:!0,premultipliedAlpha:!0,rendererCapabilities:t.rendererCapabilities}:void 0)}get map(){return this.uniforms.map.value}}e.IconMaterial=o},3224:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MSAAMaterial=void 0;const r=i(6271),n=i(1498),o=i(4121);class s extends n.ShaderMaterial{constructor(t){super({uniforms:t,vertexShader:o.CopyShader.vertexShader,fragmentShader:o.CopyShader.fragmentShader,premultipliedAlpha:!0,transparent:!0,blending:r.AdditiveBlending,depthTest:!1,depthWrite:!1})}}e.MSAAMaterial=s},4821:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MapMeshBasicMaterial=void 0;const r=i(977),n=i(4342),o=i(4744),s=i(8014),a=i(5033),l=i(8177),c=i(4258),h=i(8878),u=i(5997),p=i(674);class d extends r.MeshBasicMaterial{constructor(t){super(t),l.FadingFeature.patchGlobalShaderChunks(),this.addFadingProperties(),this.applyFadingParameters(t),s.ExtrusionFeature.patchGlobalShaderChunks(),this.addExtrusionProperties(),this.applyExtrusionParameters(Object.assign(Object.assign({},t),{zFightingWorkaround:!0})),this.addDisplacementProperties(),this.applyDisplacementParameters(t),o.ColorCorrectionFeature.patchGlobalShaderChunks(),this.addColorCorrectionProperties(),this.applyColorCorrectionParameters(t)}clone(){return(new d).copy(this)}copy(t){return super.copy(t),this.copyFadingParameters(t),this.copyExtrusionParameters(t),this.copyDisplacementParameters(t),this.copyColorCorrectionParameters(t),this}get fadeNear(){return l.FadingFeature.DEFAULT_FADE_NEAR}set fadeNear(t){}get fadeFar(){return l.FadingFeature.DEFAULT_FADE_FAR}set fadeFar(t){}set brightness(t){}get brightness(){return o.ColorCorrectionFeature.DEFAULT_BRIGHTNESS}set gamma(t){}get gamma(){return o.ColorCorrectionFeature.DEFAULT_GAMMA}get extrusionRatio(){return a.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX}set extrusionRatio(t){}get displacementMap(){return null}set displacementMap(t){}setDisplacementMap(t){}addFadingProperties(){}applyFadingParameters(t){}copyFadingParameters(t){}addExtrusionProperties(){}applyExtrusionParameters(t){}copyExtrusionParameters(t){}addDisplacementProperties(){}copyColorCorrectionParameters(t){}applyDisplacementParameters(t){}copyDisplacementParameters(t){}addColorCorrectionProperties(){}applyColorCorrectionParameters(t){}}e.MapMeshBasicMaterial=d,(0,n.applyMixinsWithoutProperties)(d,[p.FadingFeatureMixin]),(0,n.applyMixinsWithoutProperties)(d,[u.ExtrusionFeatureMixin]),(0,n.applyMixinsWithoutProperties)(d,[h.DisplacementFeatureMixin]),(0,n.applyMixinsWithoutProperties)(d,[c.ColorCorrectionFeatureMixin])},8484:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MapMeshDepthMaterial=void 0;const r=i(4127),n=i(4342),o=i(8014),s=i(5033),a=i(5997);class l extends r.MeshDepthMaterial{constructor(t){super(t),o.ExtrusionFeature.patchGlobalShaderChunks(),this.addExtrusionProperties(),this.applyExtrusionParameters(Object.assign(Object.assign({},t),{zFightingWorkaround:!1}))}get extrusionRatio(){return s.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX}set extrusionRatio(t){}addExtrusionProperties(){}applyExtrusionParameters(t){}copyExtrusionParameters(t){}}e.MapMeshDepthMaterial=l,(0,n.applyMixinsWithoutProperties)(l,[a.ExtrusionFeatureMixin])}
2,4877:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MapMeshPhongMaterial=void 0;const r=i(4125),n=i(2149),o=i(4342),s=i(8014),a=i(5033),l=i(8177),c=i(71),h=i(5997),u=i(674),p=i(5089);class d extends n.MeshPhongMaterial{constructor(t){var e;super(t),l.FadingFeature.patchGlobalShaderChunks(),this.addFadingProperties(),this.applyFadingParameters(t),s.ExtrusionFeature.patchGlobalShaderChunks(),this.addExtrusionProperties(),this.applyExtrusionParameters(Object.assign(Object.assign({},t),{zFightingWorkaround:!0})),this.m_colorIntensity=null!==(e=null==t?void 0:t.colorIntensity)&&void 0!==e?e:1,this.onBeforeCompile=(0,o.chainCallbacks)(this.onBeforeCompile,t=>{(0,c.linkMixinWithShader)(this,t),t.fragmentShader=t.fragmentShader.replace("#include <lights_phong_pars_fragment>",`#include <lights_phong_pars_fragment>\n ${p.blinnPhongNoSpecular}\n `)}),(0,c.linkMixinWithMaterial)(this,this),(0,o.assert)(void 0!==this.shaderDefines),(0,o.assert)(void 0!==this.shaderUniforms),this.shaderUniforms.colorIntensity=new r.Uniform(this.colorIntensity)}clone(){return(new d).copy(this)}copy(t){return super.copy(t),this.copyFadingParameters(t),this.copyExtrusionParameters(t),this.colorIntensity=t.colorIntensity,this}get colorIntensity(){return this.m_colorIntensity}set colorIntensity(t){this.m_colorIntensity=t,this.shaderUniforms.colorIntensity.value=t}get fadeNear(){return l.FadingFeature.DEFAULT_FADE_NEAR}set fadeNear(t){}get fadeFar(){return l.FadingFeature.DEFAULT_FADE_FAR}set fadeFar(t){}get extrusionRatio(){return a.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX}set extrusionRatio(t){}addFadingProperties(){}applyFadingParameters(t){}copyFadingParameters(t){}addExtrusionProperties(){}applyExtrusionParameters(t){}copyExtrusionParameters(t){}}e.MapMeshPhongMaterial=d,(0,o.applyMixinsWithoutProperties)(d,[u.FadingFeatureMixin]),(0,o.applyMixinsWithoutProperties)(d,[h.ExtrusionFeatureMixin])},4067:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MapMeshStandardMaterial=void 0;const r=i(8282),n=i(576),o=i(4342),s=i(8014),a=i(5033),l=i(8177),c=i(5997),h=i(674),u=i(759);class p extends r.MeshStandardMaterial{constructor(t){super(t),l.FadingFeature.patchGlobalShaderChunks(),this.addFadingProperties(),this.applyFadingParameters(t),s.ExtrusionFeature.patchGlobalShaderChunks(),this.addExtrusionProperties(),this.applyExtrusionParameters(Object.assign(Object.assign({},t),{zFightingWorkaround:!0})),!0===(null==t?void 0:t.removeDiffuseLight)&&(this.onBeforeCompile=(0,o.chainCallbacks)(this.onBeforeCompile,t=>{t.fragmentShader=n.ShaderChunk.meshphysical_frag.replace("#include <lights_physical_pars_fragment>",u.simpleLightingShadowChunk)}))}clone(){return(new p).copy(this)}copy(t){return super.copy(t),this.copyFadingParameters(t),this.copyExtrusionParameters(t),this}get fadeNear(){return l.FadingFeature.DEFAULT_FADE_NEAR}set fadeNear(t){}get fadeFar(){return l.FadingFeature.DEFAULT_FADE_FAR}set fadeFar(t){}get extrusionRatio(){return a.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX}set extrusionRatio(t){}get removeDiffuseLight(){return!1}set removeDiffuseLight(t){}addFadingProperties(){}applyFadingParameters(t){}copyFadingParameters(t){}addExtrusionProperties(){}applyExtrusionParameters(t){}copyExtrusionParameters(t){}}e.MapMeshStandardMaterial=p,(0,o.applyMixinsWithoutProperties)(p,[h.FadingFeatureMixin]),(0,o.applyMixinsWithoutProperties)(p,[c.ExtrusionFeatureMixin])},71:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.linkMixinWithShader=e.linkMixinWithMaterial=e.cameraToWorldDistance=void 0,e.cameraToWorldDistance=function(t,e){return t*e.maximum},e.linkMixinWithMaterial=function(t,e){void 0===e.defines&&(e.defines={}),t.shaderDefines=e.defines,void 0===t.shaderUniforms&&(t.shaderUniforms={})},e.linkMixinWithShader=function(t,e){Object.assign(e.uniforms,t.shaderUniforms),t.shaderUniforms=e.uniforms}},2141:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RawShaderMaterial=void 0;const r=i(6271),n=i(4085),o=i(4342),s=i(8578);class a extends n.RawShaderMaterial{constructor(t){const e=!0===(null==t?void 0:t.rendererCapabilities.isWebGL2),i=t?Object.assign(Object.assign({},t),{glslVersion:e?r.GLSL3:r.GLSL1,vertexShader:e&&t.vertexShader?(0,o.convertVertexShaderToWebGL2)(t.vertexShader):t.vertexShader,fragmentShader:e&&t.fragmentShader?(0,o.convertFragmentShaderToWebGL2)(t.fragmentShader):t.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(t){var e;void 0!==t&&(this.opacity=t,(null===(e=this.uniforms)||void 0===e?void 0:e.opacity)&&(this.uniforms.opacity.value=t))}}e.RawShaderMaterial=a},3298:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.SkyAtmosphereMaterial=e.SkyAtmosphereShader=void 0;const r=i(6271),n=i(4125),o=i(5971),s=i(8333),a=i(6815),l=i(2141),c=i(1870),h=i(8578);e.SkyAtmosphereShader={uniforms:{u_eyePositionWorld:new n.Uniform(new a.Vector3),u_lightDirectionWorld:new n.Uniform(new a.Vector3(0,1,0)),u_modelViewProjection:new n.Uniform(new s.Matrix4),u_atmosphereEnv:new n.Uniform(new a.Vector3(6378137,6537590.425,0)),u_hsvCorrection:new n.Uniform(new a.Vector3(0,0,0)),topColor:new n.Uniform(new o.Color(30719)),bottomColor:new n.Uniform(new o.Color(16777215)),offset:new n.Uniform(33),exponent:new n.Uniform(.6),fogColor:new n.Uniform(new o.Color(30719)),fogNear:new n.Uniform(new o.Color(30719)),fogFar:new n.Uniform(new o.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 ${c.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 ${c.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 `};class u extends l.RawShaderMaterial{constructor(t){let i;t&&(i={name:"SkyAtmosphereMaterial",vertexShader:e.SkyAtmosphereShader.vertexShader,fragmentShader:e.SkyAtmosphereShader.fragmentShader,uniforms:e.SkyAtmosphereShader.uniforms,transparent:!0,depthTest:!0,depthWrite:!1,side:r.BackSide,blending:r.NormalBlending,rendererCapabilities:t.rendererCapabilities}),super(i)}setDynamicLighting(t){(0,h.setShaderMaterialDefine)(this,"DYNAMIC_LIGHT",t)}set outerRadius(t){this.uniforms.u_atmosphereEnv.value.y=t}get outerRadius(){return this.uniforms.u_atmosphereEnv.value.y}set innerRadius(t){this.uniforms.u_atmosphereEnv.value.x=t}get innerRadius(){return this.uniforms.u_atmosphereEnv.value.x}updateUniforms(t,e,i,r){const n=this.getCameraInfo(e,i);if(void 0===t||!t.isMaterial)throw Error("Wrong object used, only Material objects are supported");if(!(t.uniforms&&t.uniforms.u_atmosphereEnv&&t.uniforms.u_hsvCorrection&&t.uniforms.u_eyePositionWorld&&t.uniforms.u_modelViewProjection&&t.uniforms.u_lightDirectionWorld))throw Error("Atmosphere material has missing uniforms");{const e=n.eyePos,i=n.modelViewProjection,o=n.eyeHeight;t.uniforms.u_eyePositionWorld.value.copy(e),t.uniforms.u_modelViewProjection.value.copy(i),t.uniforms.u_atmosphereEnv.value.z=o,t.uniforms.u_lightDirectionWorld.value=r.clone();const s=o>this.outerRadius,a=(0,h.setShaderDefine)(t.defines,"CAMERA_IN_SPACE",s),l=(0,h.setShaderDefine)(t.defines,"CAMERA_IN_ATMOSPHERE",!s);t.needsUpdate=t.needsUpdate||a||l}}getCameraInfo(t,e,i=!1){if(i){const i=(new s.Matrix4).identity(),r=(new s.Matrix4).copy(t.matrixWorld).invert().transpose(),n=e.projectionMatrix,o=new s.Matrix4;o.multiplyMatrices(r,i),o.multiplyMatrices(n,o);const l=new a.Vector3;t.getWorldPosition(l);const c=new a.Vector3;return e.getWorldPosition(c),{modelViewProjection:o,eyePos:l,eyeHeight:c.distanceTo(l)}}{const i=t.matrixWorld,r=e.matrixWorldInverse,n=e.projectionMatrix,o=new s.Matrix4;o.multiplyMatrices(r,i),o.multiplyMatrices(n,o);const l=new a.Vector3;e.getWorldPosition(l);const c=new a.Vector3;t.getWorldPosition(c);const h=c.distanceTo(l);return l.sub(c),{modelViewProjection:o,eyePos:l,eyeHeight:h}}}}e.SkyAtmosphereMaterial=u},9528:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.SolidLineMaterial=e.LineDashesModes=e.LineCapsModes=void 0;const r=i(6271),n=i(4125),o=i(5448),s=i(6577),a=i(6729),l=i(5143),c=i(394),h=i(1667),u=i(7610),p=i(8177),d=i(2141),m=i(8578);var f;!function(t){t[t.CAPS_NONE=0]="CAPS_NONE",t[t.CAPS_SQUARE=1]="CAPS_SQUARE",t[t.CAPS_ROUND=2]="CAPS_ROUND",t[t.CAPS_TRIANGLE_IN=3]="CAPS_TRIANGLE_IN",t[t.CAPS_TRIANGLE_OUT=4]="CAPS_TRIANGLE_OUT"}(f=e.LineCapsModes||(e.LineCapsModes={}));const g={butt:f.CAPS_NONE,square:f.CAPS_SQUARE,round:f.CAPS_ROUND},y=Object.keys(g).reduce((t,e)=>{const i=e;return t[g[i]]=i,t},{});var v;!function(t){t[t.DASHES_SQUARE=0]="DASHES_SQUARE",t[t.DASHES_ROUND=1]="DASHES_ROUND",t[t.DASHES_DIAMOND=2]="DASHES_DIAMOND"}(v=e.LineDashesModes||(e.LineDashesModes={}));const _={Square:v.DASHES_SQUARE,Round:v.DASHES_ROUND,Diamond:v.DASHES_DIAMOND},b=Object.keys(_).reduce((t,e)=>{const i=e;return t[_[i]]=i,t},{}),x=`\nprecision highp float;\nprecision highp int;\n\nuniform vec4 diffuseColor;\nuniform float opacity;\nuniform float extrusionWidth;\nuniform vec2 tileSize;\nuniform vec2 drawRange;\nuniform float antiAliasingPixelRange;\n\n#ifdef USE_DASH_IMAGE\n uniform sampler2D dashImage;\n uniform vec4 dashImageColor;\n#endif\n\n#ifdef USE_DASHED_LINE\n uniform vec4 dashPattern;\n uniform vec4 dashGapColor;\n\n #define DASHES_SQUARE ${v.DASHES_SQUARE}\n #define DASHES_ROUND ${v.DASHES_ROUND}\n #define DASHES_DIAMOND ${v.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\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 ${f.CAPS_NONE}\n#define CAPS_SQUARE ${f.CAPS_SQUARE}\n#define CAPS_ROUND ${f.CAPS_ROUND}\n#define CAPS_TRIANGLE_IN ${f.CAPS_TRIANGLE_IN}\n#define CAPS_TRIANGLE_OUT ${f.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:\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 image:\n if (diffuseColor.a == 1.0) {\n // diffuseColor is fully opaque, use simple mix function with dashImageColor's alpha as interpolation factor:\n outputColor = mix(diffuseColor, vec4(dashImageColor.rgb, 1.0), dashImageColor.a);\n } else {\n // diffuseColor is not fully opaque, perform a custom alpha blending:\n\n // Inverse transparency of dashImageColor:\n float invDashAlpha = 1.0 - dashImageColor.a;\n\n // Blend RGB channels based on alpha values:\n outputColor.rgb = diffuseColor.rgb * diffuseColor.a * invDashAlpha + dashImageColor.rgb * dashImageColor.a;\n\n // Compute final alpha by blending both alphas:\n outputColor.a = diffuseColor.a * invDashAlpha + dashImageColor.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 texture pixel, the dash becomes invisible, and the base (diffuse) color is drawn instead.\n outputColor = mix(diffuseColor, outputColor, textureAlpha * dashBlendFactor);\n\n // If dashGapColor differs from diffuseColor (rare use case?) we need an extra mix step like we do when no dashImage is used:\n if (diffuseColor.rgba != dashGapColor.rgba) {\n outputColor.a = mix(dashGapColor.a, outputColor.a, dashBlendFactor);\n outputColor.rgb = mix(dashGapColor.rgb * dashGapColor.a, outputColor.rgb * outputColor.a, dashBlendFactor) / outputColor.a;\n }\n #else\n // When no dash texture is used, color's alpha is blended as the other channels with the dash gap color. The dash gap 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 // At first the alpha is interpolated:\n outputColor.a = mix(dashGapColor.a, diffuseColor.a, dashBlendFactor);\n\n // Then color channels are premultiplied with the alpha channels, interpolated and finally divi
2ded 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(dashGapColor.rgb * dashGapColor.a, diffuseColor.rgb * diffuseColor.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 barycentricColor = vec3(edgeFactor());\n vec3 color = min(barycentricColor, 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\n // For lines with AA disabled, discarding based on distance of the pixel\n if (antiAliasingPixelRange == 0.0) {\n if (distToCenter > 1.0) {\n discard;\n }\n } else {\n s = smoothstep(vAAGradient.x, vAAGradient.y, distToCenter);\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, barycentricColor)) == false) {\n discard;\n }\n }\n\n // Alpha channel in diffuseColor is applied later once it's interpolated
2with 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 if (vWireframe == 1.0) {\n // Uncomment to see the wireframe only without fill color\n // gl_FragColor.a = 0.;\n if (all(equal(color, barycentricColor))) {\n gl_FragColor = vec4(1.0, 0., 0., 1.0);\n }\n }\n}`;class w extends d.RawShaderMaterial{constructor(t){var e,i,d,g,y,_;p.FadingFeature.patchGlobalShaderChunks();const b={CAPS_MODE:f.CAPS_ROUND,DASHES_MODE:v.DASHES_SQUARE};let S,T,E=!0,M=1;t&&(E=!0===t.fog,E&&(0,m.setShaderDefine)(b,"USE_FOG",!0),M=void 0!==t.opacity?t.opacity:M,S=t.displacementMap,void 0!==S&&(0,m.setShaderDefine)(b,"USE_DISPLACEMENTMAP",!0),t["dash-image"]&&(0,m.setShaderDefine)(b,"USE_DASH_IMAGE",!0),T={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\nconst float PI = 3.14159265358979323846;\nconst float EPSILON = 0.00001;\n\nattribute vec3 extrusionCoord;\nattribute vec3 position;\nattribute vec3 tangent;\nattribute vec3 tangent2;\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// Controls anti-aliasing applied to this polyline\n// 0 does not apply anti-aliasing, value > 0 will apply anti-aliasing.\nuniform float antiAliasingPixelRange;\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\n// Calculates the angle between 2 directions\n// Directions should be normalized\nfloat computeAngle(in vec3 dir1, in vec3 dir2) {\n float dotProduct = dot(dir1, dir2);\n return acos(dotProduct);\n}\n\n// rotate vector (clockwise if -y goes up, and +y goes down)\nvec3 rotate(in vec2 v, in float angle) {\n float cosine = cos(angle);\n float sine = sin(angle);\n return normalize(vec3(cosine * v.x - sine * v.y, sine * v.x + cosine * v.y, 0));\n}\n\nvoid computeExtrusionComponentsWorld(in float extrusionWidth, in vec2 extrusionSign, in vec3 tangent, in vec3 tangent2, inout vec3 biTangentComponent, inout vec3 tangentComponent) {\n if (extrusionSign.x == -1.0) {\n biTangentComponent = rotate(tangent2.xy, PI / 2.0);\n tangentComponent = tangent2.xyz * -1.0;\n } else {\n biTangentComponent = rotate(tangent.xy, PI / 2.0);\n tangentComponent = tangent.xyz;\n }\n\n biTangentComponent = biTangentComponent * extrusionSign.y * extrusionWidth * -1.0;\n tangentComponent = tangentComponent * extrusionWidth;\n}\n\nvec2 computeExtrudedPosLocal(in float linePosition, in float extrusionWidth, in vec2 extrusionSign) {\n // For every segment,\n // Extrude position forwards (extrusionSign.x positive, for end points) or\n // backwards (extrusionSign.x negative, for start points) by the extrusion width.\n return vec2(linePosition + extrusionSign.x * extrusionWidth, 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\n // Holds the extrusion direction\n // Direction is calculated by rotating the corresponding tangent vector by 90 deg.\n vec3 biTangentComponent;\n\n // Holds the extension towards tangent\n // Extending the ends of the legs by extrusionWidth so that the gaps will be covered during turns.\n vec3 tangentComponent;\n\n // Calculate the extrusion to be applied to the vertex position\n computeExtrusionComponentsWorld(extrusionWidth, extrusionSign, tangent, tangent2, biTangentComponent, tangentComponent);\n vec3 extrusionVecWorld = biTangentComponent + tangentComponent;\n vec3 extrudedPosWorld = position + extrusionVecWorld;\n\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 + antiAliasingPixelRange) / distanceScreen;\n extrusionVecWorld *= overscale;\n extrudedPosWorld = position + extrusionVecWorld;\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\n vec2 extrudedPosLocal = computeExtrudedPosLocal(linePos, totalExtrusionWidth, extrusionSign);
2\n\n // Store the normalized extrusion coordinates in vCoords (with their ranges in vRange).\n vRange = vec3(extrusionCoord.z, totalExtrusionWidth, extrusionSign.y);\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 > 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 towards right of the path direction by offset units.\n // When the lines move away from the center line, the alignment at the joints will be incorrect.\n // For the right turns, the paths will intersect with each other.\n // For the left turns, there will be a gap in the joints.\n // We need to handle this case by extending or shrinking the legs.\n #ifdef USE_OFFSET\n // Using extrusion sign to shift towards right as biTangent is away from the centerline.\n extrudedPosWorld += normalize(biTangentComponent) * offset * extrusionSign.y;\n\n vec3 t1 = normalize(tangent);\n vec3 t2 = normalize(tangent2);\n float angle = abs(computeAngle(t1, t2));\n float deg = degrees(angle);\n if (deg > 0.0 && deg < 180.0) {\n float offsetExtrusion = offset * abs(tan(angle * 0.5));\n\n // Sign of the normal.z determines if the turn is left or right.\n // For parallel or anti-parallel legs, the normal will be 0. Hence offsetExtrusion will not be applied.\n // Shrink or extend the leg along the tangent to align the legs properly.\n vec3 normal = normalize(cross(t1, t2));\n extrudedPosWorld += normalize(tangentComponent) * offsetExtrusion * normal.z;\n }\n #endif\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:x,uniforms:l.UniformsUtils.merge([{diffuseColor:new n.Uniform(w.DEFAULT_COLOR.clone()),dashGapColor:new n.Uniform(w.DEFAULT_DASH_GAP_COLOR.clone()),extrusionWidth:new n.Uniform(w.DEFAULT_WIDTH),offset:new n.Uniform(w.DEFAULT_OFFSET),opacity:new n.Uniform(w.DEFAULT_OPACITY),tileSize:new n.Uniform(new o.Vector2),fadeNear:new n.Uniform(p.FadingFeature.DEFAULT_FADE_NEAR),fadeFar:new n.Uniform(p.FadingFeature.DEFAULT_FADE_FAR),displacementMap:new n.Uniform(void 0!==S?S:new c.Texture),drawRange:new n.Uniform(new o.Vector2(w.DEFAULT_DRAW_RANGE_START,w.DEFAULT_DRAW_RANGE_END)),dashPattern:new n.Uniform(null!==(e=t["dash-pattern"])&&void 0!==e?e:new s.Vector4),dashImage:new n.Uniform(null!==(i=t["dash-image"])&&void 0!==i?i:new c.Texture),dashImageColor:new n.Uniform(w.DEFAULT_DASH_GAP_COLOR.clone()),canvasSize:new n.Uniform(new o.Vector2),wireframe:new n.Uniform(w.ENABLE_WIREFRAME?1:0),antiAliasingPixelRange:new n.Uniform(1.2)},a.UniformsLib.fog]),defines:b,opacity:M,rendererCapabilities:t.rendererCapabilities}),super(T),this.m_color=(new u.RGBA).fromVector(w.DEFAULT_COLOR),this.m_dashGapColor=(new u.RGBA).fromVector(w.DEFAULT_DASH_GAP_COLOR),this.m_dashImageColor=(new u.RGBA).fromVector(w.DEFAULT_DASH_IMAGE_COLOR),this.fog=E,this.setOpacity(M),this.stencilFunc=r.NotEqualStencilFunc,this.stencilZPass=r.ReplaceStencilOp,this.stencilRef=1,this.stencilWrite=!1,(0,m.enforceBlending)(this),this.extensions.derivatives=!0,t&&(void 0!==t.color&&(this.color="number"==typeof t.color?h.ColorUtils.getRgbaFromHex(t.color):null!==(d=u.RGBA.parse(t.color))&&void 0!==d?d:this.m_color),void 0!==t.width&&(this.width=t.width),void 0!==t.opacity&&this.setOpacity(t.opacity),void 0!==t.depthTest&&(this.depthTest=t.depthTest),void 0!==t.depthWrite&&(this.depthWrite=t.depthWrite),void 0!==t.fadeNear&&(this.fadeNear=t.fadeNear),void 0!==t.fadeFar&&(this.fadeFar=t.fadeFar),void 0!==t.displacementMap&&(this.displacementMap=t.displacementMap),void 0!==t.cap&&(this.cap=t.cap),void 0!==t.drawRangeStart&&(this.drawRangeStart=t.drawRangeStart),void 0!==t.drawRangeEnd&&(this.drawRangeEnd=t.drawRangeEnd),void 0!==t.dashes&&(this.dashes=t.dashes
2),void 0!==t["dash-gap-color"]&&(this["dash-gap-color"]="number"==typeof t["dash-gap-color"]?h.ColorUtils.getRgbaFromHex(t["dash-gap-color"]):null!==(g=u.RGBA.parse(t["dash-gap-color"]))&&void 0!==g?g:this.m_dashGapColor),void 0!==t["dash-image-color"]&&(this["dash-image-color"]="number"==typeof t["dash-image-color"]?h.ColorUtils.getRgbaFromHex(t["dash-image-color"]):null!==(y=u.RGBA.parse(t["dash-image-color"]))&&void 0!==y?y:this.m_dashGapColor),void 0!==t["dash-pattern"]&&(this["dash-pattern"]=t["dash-pattern"]),void 0!==t.fog&&(this.fog=t.fog,this.invalidateFog()),this.offset=null!==(_=t.offset)&&void 0!==_?_:0)}set offset(t){(0,m.setShaderMaterialDefine)(this,"USE_OFFSET",0!==t),this.uniforms.offset.value=t}get offset(){return this.uniforms.offset.value}setOpacity(t){super.setOpacity(t),void 0!==t&&this.updateStencil()}get color(){return this.m_color}set color(t){this.m_color.copy(t).toVector(this.uniforms.diffuseColor.value),this.updateStencil()}get"dash-gap-color"(){return this.m_dashGapColor}set"dash-gap-color"(t){this.m_dashGapColor.copy(t).toVector(this.uniforms.dashGapColor.value),this.updateStencil()}get width(){return 2*this.uniforms.extrusionWidth.value}set width(t){this.uniforms.extrusionWidth.value=t/2}get"dash-image"(){return this.uniforms.dashImage.value}set"dash-image"(t){this.uniforms.dashImage.value=t,(0,m.setShaderMaterialDefine)(this,"USE_DASH_IMAGE",!0)}get"dash-image-color"(){return this.m_dashImageColor}set"dash-image-color"(t){this.m_dashImageColor.copy(t).toVector(this.uniforms.dashImageColor.value)}get"dash-pattern"(){return this.uniforms.dashPattern.value}set"dash-pattern"(t){this.uniforms.dashPattern.value=t,t&&((0,m.setShaderMaterialDefine)(this,"USE_DASHED_LINE",t.x>0),(0,m.setShaderMaterialDefine)(this,"USE_SECOND_DASH",t.z>0),this.updateStencil())}get cap(){let t="round";const e=(0,m.getShaderMaterialDefine)(this,"CAPS_MODE");return"number"==typeof e&&y.hasOwnProperty(e)&&(t=y[e]),t}set cap(t){g.hasOwnProperty(t)&&(0,m.setShaderMaterialDefine)(this,"CAPS_MODE",g[t])}get dashes(){let t="Square";const e=(0,m.getShaderMaterialDefine)(this,"DASHES_MODE");return"number"==typeof e&&b.hasOwnProperty(e)&&(t=b[e]),t}set dashes(t){_.hasOwnProperty(t)&&(0,m.setShaderMaterialDefine)(this,"DASHES_MODE",_[t])}get fadeNear(){return this.uniforms.fadeNear.value}set fadeNear(t){this.uniforms.fadeNear.value=t}get fadeFar(){return this.uniforms.fadeFar.value}set fadeFar(t){this.uniforms.fadeFar.value=t,(0,m.setShaderMaterialDefine)(this,"USE_FADING",t>0)}get displacementMap(){return this.uniforms.displacementMap.value}set displacementMap(t){if(this.uniforms.displacementMap.value===t)return;this.uniforms.displacementMap.value=t;const e=null!==t;e&&(this.uniforms.displacementMap.value.needsUpdate=!0),(0,m.setShaderMaterialDefine)(this,"USE_DISPLACEMENTMAP",e)}get drawRangeStart(){return this.uniforms.drawRange.value.x}set drawRangeStart(t){this.uniforms.drawRange.value.x=t}get drawRangeEnd(){return this.uniforms.drawRange.value.y}set drawRangeEnd(t){this.uniforms.drawRange.value.y=t}set clipTileSize(t){this.uniforms.tileSize.value.copy(t);const e=t.x>0&&t.y>0;(0,m.setShaderMaterialDefine)(this,"USE_TILE_CLIP",e)}get clipTileSize(){return this.uniforms.tileSize.value}set canvasSize(t){this.uniforms.canvasSize.value.copy(t)}get canvasSize(){return this.uniforms.canvasSize.value}set antiAliasingPixelRange(t){this.uniforms.antiAliasingPixelRange.value=t}copy(t){return super.copy(t),this.invalidateFog(),this.setOpacity(t.opacity),this}updateStencil(){var t,e,i,r;this.stencilWrite=this.opacity*(null!==(e=null===(t=this.color)||void 0===t?void 0:t.a)&&void 0!==e?e:1)<1||"USE_DASHED_LINE"in this.defines&&this.opacity*(null!==(r=null===(i=this["dash-gap-color"])||void 0===i?void 0:i.a)&&void 0!==r?r:1)<1}}e.SolidLineMaterial=w,w.DEFAULT_COLOR=new s.Vector4(1,0,0,1),w.DEFAULT_DASH_GAP_COLOR=new s.Vector4(1,0,0,0),w.DEFAULT_DASH_IMAGE_COLOR=new s.Vector4(1,0,0,0),w.DEFAULT_WIDTH=1,w.DEFAULT_OPACITY=1,w.DEFAULT_DRAW_RANGE_START=0,w.DEFAULT_DRAW_RANGE_END=1,w.DEFAULT_DASH_SIZE=1,w.DEFAULT_GAP_SIZE=1,w.DEFAULT_OFFSET=0,w.ENABLE_WIREFRAME=!1},8578:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.getShaderDefine=e.setShaderDefine=e.getShaderMaterialDefine=e.setShaderMaterialDefine=e.disableBlending=e.enableBlending=e.enforceBlending=e.insertShaderInclude=e.DEFINE_BOOL_FALSE=e.DEFINE_BOOL_TRUE=void 0;const r=i(6271),n=i(4342);function o(t){!0!==t.transparent&&!0!==t.forcedBlending&&(t.blending=r.CustomBlending,!0===t.premultipliedAlpha?(t.blendSrc=r.OneFactor,t.blendDst=r.OneMinusSrcAlphaFactor,t.blendSrcAlpha=r.OneFactor,t.blendDstAlpha=r.OneMinusSrcAlphaFactor):(t.blendSrc=r.SrcAlphaFactor,t.blendDst=r.OneMinusSrcAlphaFactor,t.blendSrcAlpha=r.OneFactor,t.blendDstAlpha=r.OneMinusSrcAlphaFactor))}function s(t,e,i=!1){return void 0===t.defines?i:l(t.defines,e)}function a(t,i,r){let n=!1;return"number"==typeof r?(n=t[i]!==r,t[i]=r):!0===r?(n=t[i]!==e.DEFINE_BOOL_TRUE,t[i]=e.DEFINE_BOOL_TRUE):!1===r&&void 0!==t[i]&&(delete t[i],n=!0),n}function l(t,i){const r=t[i];return r!==e.DEFINE_BOOL_FALSE&&(r===e.DEFINE_BOOL_TRUE||r)}e.DEFINE_BOOL_TRUE="",e.DEFINE_BOOL_FALSE=void 0,e.insertShaderInclude=function(t,e,i,r){const n=!0===r?"\t"
2:"";return t.replace(`#include <${e}>`,`#include <${e}>\n${n}#include <${i}>`)},e.enforceBlending=function(t){t.transparent||(o(t),t.forcedBlending=!0)},e.enableBlending=o,e.disableBlending=function(t){!0!==t.transparent&&!0!==t.forcedBlending&&(t.blending=r.NormalBlending)},e.setShaderMaterialDefine=function(t,e,i){(0,n.assert)(void 0!==t.defines,"Do not use this function in ShaderMaterial derived c-tor.");const r=i!==s(t,e);return!!r&&(a(t.defines,e,i),t.needsUpdate=r,!0)},e.getShaderMaterialDefine=s,e.setShaderDefine=a,e.getShaderDefine=l},5562:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.needsCanvasSize=void 0,e.needsCanvasSize=function(t){return"canvasSize"in t}},4744:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.hasColorCorrectionFeature=e.ColorCorrectionFeature=void 0;const r=i(3334),n=i(576),o=i(4342),s=i(71),a=i(4030),l=i(8578);!function(t){function e(t){return void 0!==t.gamma||void 0!==t.brightness}t.DEFAULT_GAMMA=1,t.DEFAULT_BRIGHTNESS=1,t.isEnabled=e,t.patchGlobalShaderChunks=function(){void 0===n.ShaderChunk.color_correction_parts_fragment&&Object.assign(n.ShaderChunk,a.default)},t.updateColorCorrectionFeature=function(i){(0,o.assert)(void 0!==i.shaderDefines),(0,o.assert)(void 0!==i.shaderUniforms);const n=e(i),s=(0,l.setShaderDefine)(i.shaderDefines,"USE_COLOR_CORRECTION",n);i.needsUpdate=s,(0,o.assert)(void 0!==i.shaderUniforms.u_gamma),(0,o.assert)(void 0!==i.shaderUniforms.u_brightness),n?(i.shaderUniforms.u_gamma.value=i.gamma>0?i.gamma:0,i.shaderUniforms.u_brightness.value=(0,r.clamp)(i.brightness,0,1)):s&&(i.shaderUniforms.u_gamma.value=t.DEFAULT_GAMMA,i.shaderUniforms.u_brightness.value=t.DEFAULT_BRIGHTNESS)},t.onBeforeCompile=function(t,i){e(t)&&((0,o.assert)(void 0!==t.shaderUniforms),(0,s.linkMixinWithShader)(t,i),i.fragmentShader=(0,l.insertShaderInclude)(i.fragmentShader,"common","color_correction_parts_fragment"),i.fragmentShader=(0,l.insertShaderInclude)(i.fragmentShader,"color_fragment","color_correction_fragment",!0))}}(e.ColorCorrectionFeature||(e.ColorCorrectionFeature={})),e.hasColorCorrectionFeature=function(t){return"brightness"in t&&"gamma"in t}},8583:(t,e)=>{function i(t){return"displacementMap"in t}Object.defineProperty(e,"__esModule",{value:!0}),e.setDisplacementMapToMaterial=e.hasDisplacementFeature=void 0,e.hasDisplacementFeature=i,e.setDisplacementMapToMaterial=function(t,e){i(e)&&e.displacementMap!==t&&(e.displacementMap=t,e.needsUpdate=!0,null!==e.displacementMap&&(e.displacementMap.needsUpdate=!0))}},8014:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ExtrusionFeature=e.hasExtrusionFeature=void 0;const r=i(576),n=i(4342),o=i(71),s=i(4305),a=i(8578),l=i(5033);e.hasExtrusionFeature=function(t){return"extrusionRatio"in t},function(t){function e(t){return void 0!==t.extrusionRatio&&t.extrusionRatio>=l.ExtrusionFeatureDefs.DEFAULT_RATIO_MIN}t.isEnabled=e,t.patchGlobalShaderChunks=function(){void 0===r.ShaderChunk.extrusion_pars_vertex&&Object.assign(r.ShaderChunk,s.default)},t.updateExtrusionFeature=function(t){(0,n.assert)(void 0!==t.shaderDefines),(0,n.assert)(void 0!==t.shaderUniforms);const i=e(t),r=(0,a.setShaderDefine)(t.shaderDefines,"EXTRUSION_MATERIAL",i);t.needsUpdate=r,i?t.shaderUniforms.extrusionRatio.value=t.extrusionRatio:r&&(t.shaderUniforms.extrusionRatio.value=l.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX)},t.onBeforeCompile=function(t,i){e(t)&&((0,n.assert)(void 0!==t.shaderUniforms),(0,o.linkMixinWithShader)(t,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))}}(e.ExtrusionFeature||(e.ExtrusionFeature={}))},5033:(t,e)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.ExtrusionFeatureDefs=void 0,(i=e.ExtrusionFeatureDefs||(e.ExtrusionFeatureDefs={})).DEFAULT_RATIO_MIN=0,i.DEFAULT_RATIO_MAX=1,i.MIN_BUILDING_HEIGHT=.1},8177:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.FadingFeature=void 0;const r=i(576),n=i(4342),o=i(71),s=i(3739),a=i(8578);!function(t){function e(t){return void 0!==t.fadeNear&&void 0!==t.fadeFar&&t.fadeFar>0}t.DEFAULT_FADE_NEAR=-1,t.DEFAULT_FADE_FAR=-1,t.isEnabled=e,t.isDefined=function(t){return void 0!==t.fadeNear&&void 0!==t.fadeFar},t.patchGlobalShaderChunks=function(){void 0===r.ShaderChunk.fading_pars_vertex&&Object.assign(r.ShaderChunk,s.default)},t.updateFadingFeature=function(i){(0,n.assert)(void 0!==i.shaderDefines),(0,n.assert)(void 0!==i.shaderUniforms);const r=e(i),o=(0,a.setShaderDefine)(i.shaderDefines,"FADING_MATERIAL",r);i.needsUpdate=o,(0,n.assert)(void 0!==i.shaderUniforms.fadeNear&&void 0!==i.shaderUniforms.fadeFar),r?(i.shaderUniforms.fadeNear.value=i.fadeNear,i.shaderUniforms.fadeFar.value=i.fadeFar,o&&(0,a.enableBlending)(i)):o&&(i.shaderUniforms.fadeNear.value=t.DEFAULT_FADE_NEAR,i.shaderUniforms.fadeFar.value=t.DEFAULT_FADE_FAR,(0,a.disableBlending)(i))},t.onBeforeCompile=function(t,i){e(t)&&((0,n.assert)(void 0!==t.shaderUniforms),(0,o.linkMixinWithShader)(t,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))},t.addRenderHelper=function(e,i,r,s,a,l){e.onBeforeRender=(0,n.chainCallbacks)(e.onBeforeRender,(e,n,a,c,h,u)=>{const p=h;p.fadeNear=void 0===r||r===t.DEFAULT_FADE_NEAR?t.DEFAULT_FADE_NEAR:(0,o.cameraToWorldDistance)(r,i),p.fadeFar=void 0===s||s===t.DEFAULT_FADE_FAR?t.DEFAULT_FADE_FAR:(0,o.cameraToWorldDistance)(s,i),void 0!==l&&l(e,h)})}}(e.FadingFeature||(e.FadingFeature={}))},4258:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ColorCorrectionFeatureMixin=void 0;const r=i(4342),n=i(9276),o=i(71),s=i(4125),a=i(4744);e.ColorCorrectionFeatureMixin=class{constructor(){this.m_brightness=a.ColorCorrectionFeature.DEFAULT_BRIGHTNESS,this.m_gamma=a.ColorCorrectionFeature.DEFAULT_GAMMA}getBrightness(){return this.m_brightness}setBrightness(t){t!==this.m_brightness&&(this.m_brightness=t,a.ColorCorrectionFeature.updateColorCorrectionFeature(this))}getGamma(){return this.m_gamma}setGamma(t){t!==this.m_gamma&&(this.m_gamma=t,a.ColorCorrectionFeature.updateColorCorrectionFeature(this))}addColorCorrectionProperties(){Object.defineProperty(this,"brightness",{get:()=>this.getBrightness(),set:t=>{this.setBrightness(t)}}),Object.defineProperty(this,"gamma",{get:()=>this.getGamma(),set:t=>{this.setGamma(t)}})}applyColorCorrectionParameters(t){(0,o.linkMixinWithMaterial)(this,this),(0,r.assert)(void 0!==this.shaderDefines),(0,r.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!==t&&(void 0!==t.brightness&&this.setBrightness(t.brightness),void 0!==t.gamma&&this.setGamma(t.gamma)),this.onBeforeCompile=(0,n.chainCallbacks)(this.onBeforeCompile,t=>{a.ColorCorrectionFeature.onBeforeCompile(this,t)}),this.needsUpdate=a.ColorCorrectionFeature.isEnabled(this)}copyColorCorrectionParameters(t){return this.setBrightness(void 0===t.brightness?a.ColorCorrectionFeature.DEFAULT_BRIGHTNESS:t.brightness),this.setGamma(void 0===t.gamma?a.ColorCorrectionFeature.DEFAULT_GAMMA:t.gamma),this}}},8878:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DisplacementFeatureMixin=void 0;const r=i(4125),n=i(394),o=i(4342),s=i(71),a=i(8578),l=new n.Texture;var c;!function(t){function e(t){return null!==t.displacementMap}t.isEnabled=e,t.updateDisplacementFeature=function(t){(0,o.assert)(void 0!==t.shaderDefines),(0,o.assert)(void 0!==t.shaderUniforms);const i=e(t),r=(0,a.setShaderDefine)(t.shaderDefines,"USE_DISPLACEMENTMAP",i);if(t.needsUpdate=r,i){const e=t.displacementMap;e.needsUpdate=!0,t.shaderUniforms.displacementMap.value=e}else r&&(t.shaderUniforms.displacementMap.value=l)},t.onBeforeCompile=function(t,i){e(t)&&((0,o.assert)(void 0!==t.shaderUniforms),(0,s.linkMixinWithShader)(t,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,a.insertShaderInclude)(i.vertexShader,"uv2_pars_vertex","displacementmap_pars_vertex"),i.vertexShader=(0,a.insertShaderInclude)(i.vertexShader,"skinning_vertex","displacementmap_vertex",!0))}}(c||(c={})),e.DisplacementFeatureMixin=class{constructor(){this.m_displacementMap=null}get displacementMap(){return this.m_displacementMap}set displacementMap(t){this.setDisplacementMap(t)}getDisplacementMap(){return this.m_displacementMap}setDisplacementMap(t){t!==this.m_displacementMap&&(this.m_displacementMap=t,c.updateDisplacementFeature
2(this))}addDisplacementProperties(){Object.defineProperty(this,"displacementMap",{get:()=>this.getDisplacementMap(),set:t=>{this.setDisplacementMap(t)}})}applyDisplacementParameters(t){(0,s.linkMixinWithMaterial)(this,this),(0,o.assert)(void 0!==this.shaderDefines),(0,o.assert)(void 0!==this.shaderUniforms);const e=this.shaderUniforms;e.displacementMap=new r.Uniform(l),e.displacementScale=new r.Uniform(1),e.displacementBias=new r.Uniform(0),void 0!==t&&void 0!==t.displacementMap&&this.setDisplacementMap(t.displacementMap),this.onBeforeCompile=(0,o.chainCallbacks)(this.onBeforeCompile,t=>{c.onBeforeCompile(this,t)}),this.needsUpdate=c.isEnabled(this)}copyDisplacementParameters(t){return this.setDisplacementMap(t.displacementMap),this}}},5997:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ExtrusionFeatureMixin=void 0;const r=i(4125),n=i(4342),o=i(8014),s=i(5033),a=i(71);e.ExtrusionFeatureMixin=class{constructor(){this.m_extrusion=s.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX}getExtrusionRatio(){return this.m_extrusion}setExtrusionRatio(t){t!==this.m_extrusion&&(this.m_extrusion=t,o.ExtrusionFeature.updateExtrusionFeature(this))}addExtrusionProperties(){Object.defineProperty(this,"extrusionRatio",{get:()=>this.getExtrusionRatio(),set:t=>{this.setExtrusionRatio(t)}})}applyExtrusionParameters(t){(0,a.linkMixinWithMaterial)(this,this),(0,n.assert)(void 0!==this.shaderDefines),(0,n.assert)(void 0!==this.shaderUniforms),t&&!0===t.zFightingWorkaround&&(this.shaderDefines.ZFIGHTING_WORKAROUND=""),this.shaderUniforms.extrusionRatio=new r.Uniform(s.ExtrusionFeatureDefs.DEFAULT_RATIO_MAX),void 0!==t&&void 0!==t.extrusionRatio&&this.setExtrusionRatio(t.extrusionRatio),this.onBeforeCompile=(0,n.chainCallbacks)(this.onBeforeCompile,t=>{o.ExtrusionFeature.onBeforeCompile(this,t)}),this.needsUpdate=o.ExtrusionFeature.isEnabled(this)}copyExtrusionParameters(t){return void 0!==t.extrusionRatio&&this.setExtrusionRatio(t.extrusionRatio),this}}},674:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FadingFeatureMixin=void 0;const r=i(4125),n=i(4342),o=i(8177),s=i(71);e.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(t){t!==this.m_fadeNear&&(this.m_fadeNear=t,o.FadingFeature.updateFadingFeature(this))}getFadeFar(){return this.m_fadeFar}setFadeFar(t){t!==this.m_fadeFar&&(this.m_fadeFar=t,o.FadingFeature.updateFadingFeature(this))}addFadingProperties(){Object.defineProperty(this,"fadeNear",{get:()=>this.getFadeNear(),set:t=>{this.setFadeNear(t)}}),Object.defineProperty(this,"fadeFar",{get:()=>this.getFadeFar(),set:t=>{this.setFadeFar(t)}})}applyFadingParameters(t){(0,s.linkMixinWithMaterial)(this,this),(0,n.assert)(void 0!==this.shaderDefines),(0,n.assert)(void 0!==this.shaderUniforms),this.shaderUniforms.fadeNear=new r.Uniform(o.FadingFeature.DEFAULT_FADE_NEAR),this.shaderUniforms.fadeFar=new r.Uniform(o.FadingFeature.DEFAULT_FADE_FAR),void 0!==t&&(void 0!==t.fadeNear&&this.setFadeNear(t.fadeNear),void 0!==t.fadeFar&&this.setFadeFar(t.fadeFar)),this.onBeforeCompile=(0,n.chainCallbacks)(this.onBeforeCompile,t=>{o.FadingFeature.onBeforeCompile(this,t)}),this.needsUpdate=o.FadingFeature.isEnabled(this)}copyFadingParameters(t){return this.setFadeNear(void 0===t.fadeNear?o.FadingFeature.DEFAULT_FADE_NEAR:t.fadeNear),this.setFadeFar(void 0===t.fadeFar?o.FadingFeature.DEFAULT_FADE_FAR:t.fadeFar),this}}},1870:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.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));
2\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:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.blinnPhongNoSpecular=void 0,e.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:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.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:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});const r=i(5033),n=r.ExtrusionFeatureDefs.MIN_BUILDING_HEIGHT*r.ExtrusionFeatureDefs.MIN_BUILDING_HEIGHT;e.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 = ${n};\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(vVie
2wPosition.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:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.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:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.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:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.simpleLightingShadowChunk=void 0,e.simpleLightingShadowChunk="\n struct PhysicalMaterial {\n vec3\tdiffuseColor;\n float\troughness;\n float\tspecularF90;\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:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.LuminosityHighPassShader=void 0;const r=i(5971);e.LuminosityHighPassShader={uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new r.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:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SepiaShader=void 0,e.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;
2\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:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VignetteShader=void 0,e.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(t,e,i){var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(6201),e),n(i(9785),e),n(i(1662),e),n(i(9843),e),n(i(3401),e),n(i(889),e),n(i(3461),e),n(i(1741),e),n(i(8533),e)},3401:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getHorizontalOffset=e.TextCanvas=e.DEFAULT_TEXT_CANVAS_LAYER=void 0;const r=i(433),n=i(6815),o=i(6577),s=i(5808),a=i(9843),l=i(16),c=i(1662),h=i(5402),u=i(2516),p=i(3461),d=new n.Vector3,m={array:[new r.Box2],offset:0};let f=new Float32Array;e.DEFAULT_TEXT_CANVAS_LAYER=0;class g{constructor(t){this.m_renderer=t.renderer,this.m_fontCatalog=t.fontCatalog,this.minGlyphCount=t.minGlyphCount,this.maxGlyphCount=t.maxGlyphCount,this.name=t.name,void 0===t.material?(this.m_ownsMaterial=!0,this.m_material=(0,p.createSdfTextMaterial)({fontCatalog:t.fontCatalog,rendererCapabilities:this.m_renderer.capabilities})):(this.m_ownsMaterial=!1,this.m_material=t.material),void 0===t.backgroundMaterial?(this.m_ownsBgMaterial=!0,this.m_bgMaterial=(0,p.createSdfTextMaterial)({fontCatalog:t.fontCatalog,isBackground:!0,rendererCapabilities:this.m_renderer.capabilities})):(this.m_ownsBgMaterial=!1,this.m_bgMaterial=t.backgroundMaterial),this.m_defaultLayer={id:e.DEFAULT_TEXT_CANVAS_LAYER,storage:new l.TextGeometry(new s.Scene,this.m_material,this.m_bgMaterial,this.minGlyphCount,this.maxGlyphCount)},this.m_layers=[this.m_defaultLayer],this.m_currentTextRenderStyle=(new c.TextRenderStyle).copy(g.defaultTextRenderStyle),this.m_currentTextLayoutStyle=(new c.TextLayoutStyle).copy(g.defaultTextLayoutStyle),this.m_lineTypesetter=new h.LineTypesetter,this.m_pathTypesetter=new u.PathTypesetter}get fontCatalog(){return this.m_fontCatalog}set fontCatalog(t){this.m_fontCatalog=t;const e=this.m_material;e.uniforms.sdfTexture.value=this.m_fontCatalog.texture,e.uniforms.sdfParams.value=new o.Vector4(this.m_fontCatalog.textureSize.x,this.m_fontCatalog.textureSize.y,this.m_fontCatalog.size,this.m_fontCatalog.distanceRange),e.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 o.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(t){this.m_ownsMaterial&&(this.m_material.dispose(),this.m_ownsMaterial=!1),this.m_material=t;for(const t of this.m_layers)t.storage.mesh.material=this.m_material}get backgroundMaterial(){return this.m_bgMaterial}set backgroundMaterial(t){this.m_ownsBgMaterial&&(this.m_bgMaterial.dispose(),this.m_ownsBgMaterial=!1),this.m_bgMaterial=t;for(const t of this.m_layers)t.storage.backgroundMesh.material=this.m_bgMaterial}get textRenderStyle(){return this.m_currentTextRenderStyle}set textRenderStyle(t){this.m_currentTextRenderStyle.copy(t)}get textLayoutStyle(){return this.m_currentTextLayoutStyle}set textLayoutStyle(t){this.m_currentTextLayoutStyle.copy(t)}clear(){for(const t of this.m_layers)t.storage.clear();this.m_currentTextRenderStyle.copy(g.defaultTextRenderStyle),this.m_currentTextLayoutStyle.copy(g.defaultTextLayoutStyle)}
2render(t,e,i,r,n){this.m_fontCatalog.update(this.m_renderer);let o=null;void 0!==r&&(o=this.m_renderer.getRenderTarget(),this.m_renderer.setRenderTarget(r)),!0===n&&this.m_renderer.clear(!0);for(let r=0;r<this.m_layers.length;r++){const n=this.m_layers[r];if(n.id>=(null!=e?e:0)){if(!(void 0===i||n.id<i))break;n.storage.update(),this.m_renderer.render(n.storage.scene,t)}}void 0!==r&&this.m_renderer.setRenderTarget(o)}addLayer(t){let e=this.getLayer(t);return void 0===e&&(e={id:t,storage:new l.TextGeometry(new s.Scene,this.m_material,this.m_bgMaterial,this.minGlyphCount,this.maxGlyphCount)},this.m_layers.push(e),this.m_layers.sort((t,e)=>t.id-e.id)),e}getLayer(t){return this.m_layers.find(e=>e.id===t)}getAllLayers(){return this.m_layers}measureText(t,e,i){var r;let n,o,s,a;if(d.set(0,0,0),void 0!==i){if(n=i.path,o=i.pathOverflow,a=i.outputCharacterBounds,void 0!==i.path){const t=i.path.getPoint(0);if(null===t)return!1;d.set(t.x,t.y,0)}i.letterCaseArray&&(s=i.letterCaseArray)}return this.placeText({horizontalOffset:null!==(r=null==i?void 0:i.horizontalOffset)&&void 0!==r?r:0,input:t,layer:this.m_defaultLayer,textPath:n,textPathOverflow:o,bounds:e,individualBounds:a,letterCaseArray:s})}addText(t,e,i){let r,n,o;d.copy(e);let s=this.m_defaultLayer;if(void 0!==i){if(r=i.path,n=i.pathOverflow,void 0!==i.layer){let t=this.getLayer(i.layer);void 0===t&&(t=this.addLayer(i.layer)),s=t}void 0!==i.path&&d.set(0,0,d.z),i.letterCaseArray&&(o=i.letterCaseArray)}const a=s.storage.drawCount,l=this.placeText({input:t,textPath:r,textPathOverflow:n,layer:s,letterCaseArray:o,horizontalOffset:y(null==i?void 0:i.pickingData)});return l&&void 0!==i?(!0===i.updatePosition&&e.copy(d),void 0!==i.pickingData&&s.storage.addPickingData(a,s.storage.drawCount,i.pickingData)):l||(s.storage.m_drawCount=a),l}createTextBufferObject(t,e){let i,n;d.set(0,0,0);const o=this.m_currentTextRenderStyle.fontVariant===c.FontVariant.SmallCaps;if("string"!=typeof t)i=t,void 0!==e&&e.letterCaseArray&&(n=e.letterCaseArray);else if(n=[],i=this.m_fontCatalog.getGlyphs(t,this.m_currentTextRenderStyle,o?n:void 0),void 0===i)return;let s,l,h,u,p,m;return void 0!==e&&(s=e.path,l=e.pathOverflow,!0===e.outputBounds&&(h=new r.Box2),!0===e.outputCharacterBounds&&(u=[]),!0===e.storeStyles&&(p=this.m_currentTextRenderStyle.clone(),m=this.m_currentTextLayoutStyle.clone())),this.placeText({input:t,layer:this.m_defaultLayer,computeTextBuffer:!0,textPath:s,textPathOverflow:l,bounds:h,individualBounds:u,letterCaseArray:n}),new a.TextBufferObject(i,new Float32Array(f),h,u,p,m)}addTextBufferObject(t,e){var i;let r,n,o,s,a,l,c,h=this.m_defaultLayer;if(void 0!==e){if(void 0!==e.layer){let t=this.getLayer(e.layer);void 0===t&&(t=this.addLayer(e.layer)),h=t}r=null===(i=e.position)||void 0===i?void 0:i.clone(),n=e.scale,o=e.rotation,s=e.color,a=e.opacity,l=e.backgroundColor,c=e.backgroundOpacity}const u=h.storage.drawCount,p=h.storage.addTextBufferObject(t,r,n,o,s,a,l,c);return p&&void 0!==e?void 0!==e.pickingData&&h.storage.addPickingData(u,h.storage.drawCount,e.pickingData):p||(h.storage.m_drawCount=u),p}pickText(t,e){for(const i of this.m_layers)i.storage.pick(t,e)}getMemoryUsage(t){this.m_fontCatalog.updateMemoryUsage(t);for(const e of this.m_layers)e.storage.updateMemoryUsage(t)}placeText(t){if(0===t.input.length||0===this.m_currentTextLayoutStyle.maxLines)return void 0!==t.bounds&&(t.bounds.min.set(0,0),t.bounds.max.set(0,0)),void 0!==t.individualBounds&&(t.individualBounds.length=0),!0;let e,i;const r=this.m_currentTextRenderStyle.fontVariant===c.FontVariant.SmallCaps;if("string"!=typeof t.input)e=t.input,t.letterCaseArray&&(i=t.letterCaseArray);else if(i=[],e=this.m_fontCatalog.getGlyphs(t.input,this.m_currentTextRenderStyle,r?i:void 0),void 0===e)return!1;let n;void 0!==t.individualBounds&&(m.array=t.individualBounds,m.offset=0,n=m),void 0!==t.bounds&&(t.bounds.min.set(1/0,1/0),t.bounds.max.set(-1/0,-1/0)),!0===t.computeTextBuffer&&(f=new Float32Array(e.length*l.QUAD_VERTEX_MEMORY_FOOTPRINT));const o=void 0!==t.textPath,s={glyphs:e,fontCatalog:this.m_fontCatalog,textRenderStyle:this.m_currentTextRenderStyle,textLayoutStyle:this.m_currentTextLayoutStyle,position:d,geometry:t.layer.storage,smallCapsArray:r?i:void 0,globalBounds:t.bounds,individualBounds:n,vertexBuffer:!0===t.computeTextBuffer?f:void 0};let a=!0;return o?(Object.assign(s,{path:t.textPath,pathOverflow:!0===t.textPathOverflow,horizontalOffset:t.horizontalOffset}),a=this.m_pathTypesetter.arrangeGlyphs(s)):a=this.m_lineTypesetter.arrangeGlyphs(s),void 0!==n&&(n.array.length=n.offset),a}}function y(t){if(void 0===(null==t?void 0:t.userData))return 0;const{logical_offset:e,num_lines:i}=t.userData;if(void 0===e||void 0===i)return 0;if(1===i)return 0;const r=e/(i-1)*.5;return t.layoutStyle.horizontalAlignment/2+r||0}e.TextCanvas=g,g.defaultTextRenderStyle=new c.TextRenderStyle,g.defaultTextLayoutStyle=new c.TextLayoutStyle,e.getHorizontalOffset=y},6201:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.FontCatalog=void 0;const r=i(6271),n=i(642),o=i(8533),s=i(9785),a=i(2090),l=i(1662),c="_BoldAssets/",h="_ItalicAssets/";class u{static async load(t,e,i){const n=new URL(t,window.location.href),o=await u.loadJSON(n.href,i),a=new URL(`${o.name}_Assets/Extra/`,n),l=await u.loadJSON(a.href+"Specials.json",i),c=await u.loadTexture(a.href+"Specials.png",i);c.wrapS=r.ClampToEdgeWrapping,c.wrapT=r.ClampToEdgeWrapping,c.minFilter=r.NearestFilter,c.needsUpdate=!0;const h=o.fonts.find(t=>"Extra"===t.name),p=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,h,!0);return new u(n.href,o.name,o.type,o.size,o.maxWidth,o.maxHeight,o.distanceRange,o.fonts,o.supportedBlocks,e,p)}static async loadTexture(t,e){let i;return await new Promise((r,o)=>{i=()=>{o(e.reason)},null==e||e.addEventListener("abort",i),(new n.TextureLoader).load(t,r)}).finally(()=>{null==e||e.removeEventListener("abort",i)})}static async loadJSON(t,e){const i=await fetch(t,{signal:e});if(!i.ok)throw new Error(`${t} Status Text: ${i.statusText}`);const r=await i.text();return JSON.parse(r)}constructor(t,e,i,r,n,o,s,l,c,h,u){this.url=t,this.name=e,this.type=i,this.size=r,this.maxWidth=n,this.maxHeight=o,this.distanceRange=s,this.fonts=l,this.unicodeBlocks=c,this.maxCodePointCount=h,this.m_replacementGlyph=u,this.showReplacementGlyphs=!1,this.m_baseUrl=t.substring(0,t.lastIndexOf("/")),this.m_glyphTextureCache=new a.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(t){this.m_glyphTextureCache.update(t)}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(t,e,i,r){const n=this.getAssetsPath(i,e),o=`${n}/${t.name.replace(/ /g,"_")}.json`;let s=this.m_loadedJson.get(o);if(void 0===s){let e=this.m_loadingJson.get(o);if(void 0===e)try{e=u.loadJSON(o),this.m_loadingJson.set(o,e),s=await e,this.m_loadingJson.delete(o),this.m_loadedJson.set(o,s)}catch(t){console.error(t),this.m_loadingJson.delete(o)}else s=await e}const a=[];if(!0===r)for(const t of s.pages)a.push(this.loadPage(`${n}/${t}`));return await Promise.all(a),s}removeBlock(t,e,i){const r=this.getAssetsPath(i,e),n=`${r}/${t.name.replace(/ /g,"_")}.json`,o=this.m_loadedJson.get(n);if(void 0!==o){for(const t of o.pages){const e=`${r}/${t}`;this.m_loadingPages.delete(e),this.m_loadedPages.delete(e)}this.m_loadingJson.delete(n),this.m_loadedJson.delete(n)}}async loadCharset(t,e){const i=e.fontName,r=e.fontStyle,n=(e.fontVariant===l.FontVariant.AllCaps||e.fontVariant===l.FontVariant.SmallCaps?t.toUpperCase():t).replace(/[\s\S](?=([\s\S]+))/g,(t,e)=>e.indexOf(t)+1?"":t),o=[];for(const t of n){const e=t.codePointAt(0),n=this.getFont(e,i),s=`${n.name}_${r}`,a=`${s}_${e}`;let l=this.m_loadedGlyphs.get(s);void 0===l&&(l=new Map,this.m_loadedGlyphs.set(s,l));const c=l.get(e);if(void 0===c){let i=this.m_loadingGlyphs.get(a);if(void 0===i){if(!n.charset.includes(String.fromCodePoint(e))){const i=this.createReplacementGlyph(e,t,n);l.set(e,i),this.m_glyphTextureCache.add(a,i);continue}let o;for(const t of this.unicodeBlocks)if(e>=t.min&&e<=t.max){o=t;break}i=this.loadAssets(e,r,o,n),this.m_loadingGlyphs.set(a,i),i.then(t=>{this.m_loadingGlyphs.delete(a),l.set(e,t),this.m_glyphTextureCache.add(a,t)})}o.push(i)}
2else this.m_glyphTextureCache.has(a)||(o.push(Promise.resolve(c)),this.m_glyphTextureCache.add(a,c))}return Promise.all(o)}getGlyph(t,e,i){const r=this.m_loadedGlyphs.get(`${e.name}_${i}`);if(void 0!==r)return r.get(t)}getGlyphs(t,e,i){const r=[],n=e.fontName,o=e.fontStyle,s=e.fontVariant,a=s===l.FontVariant.AllCaps||s===l.FontVariant.SmallCaps;for(const e of t){const t=a?e.toUpperCase():e;for(const s of t){const t=s.codePointAt(0),a=this.getFont(t,n),l=this.getGlyph(t,a,o);if(void 0===l||l.isReplacement&&!this.showReplacementGlyphs)return;r.push(l),void 0!==i&&i.push(s!==e)}}return r}getFont(t,e){var i,r;let n=this.fonts[0].name;for(const o of this.unicodeBlocks)if(t>=o.min&&t<=o.max){const t=null!==(i=null==e?void 0:e.split("; "))&&void 0!==i?i:[];n=null!==(r=t.find(t=>{var e;return t&&(null===(e=o.fonts)||void 0===e?void 0:e.includes(t))}))&&void 0!==r?r:o.fonts[0];break}return this.fonts.find(t=>t.name===n)}updateMemoryUsage(t){let e=0;for(const t of this.unicodeBlocks)e+=2*(t.max-t.min);let i=this.m_glyphTextureCache.textureSize.x*this.m_glyphTextureCache.textureSize.y*4;for(const t in this.m_loadedPages.entries)if(void 0!==this.m_loadedPages.get(t)){const e=this.m_loadedPages.get(t);void 0!==e&&(i+=e.image.width*e.image.height*4)}t.heapSize+=e+i,t.gpuSize+=i}createReplacementGlyph(t,e,i){const r=this.m_replacementGlyph.clone();return r.codePoint=t,r.character=e,r.font=i,r.isReplacement=o.UnicodeUtils.isPrintable(t),r}async loadAssets(t,e,i,r){const n=await this.loadBlock(i,r,e);if(void 0===n)return this.m_replacementGlyph;const o=n.chars.find(e=>e.id===t),a=`${this.getAssetsPath(e,r)}/${n.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,r)}async loadPage(t){let e=this.m_loadedPages.get(t);if(void 0===e){let i=this.m_loadingPages.get(t);void 0===i?(i=u.loadTexture(t),this.m_loadingPages.set(t,i),e=await i,e.wrapS=r.ClampToEdgeWrapping,e.wrapT=r.ClampToEdgeWrapping,e.minFilter=r.NearestFilter,e.needsUpdate=!0,this.m_loadingPages.delete(t)&&this.m_loadedPages.set(t,e),this.m_loadingPages.delete(t)):e=await i}return e}getAssetsPath(t,e){let i="_Assets/";switch(t){case l.FontStyle.Bold:void 0!==e.bold&&(i=c);break;case l.FontStyle.Italic:void 0!==e.italic&&(i=h);break;case l.FontStyle.BoldItalic:void 0!==e.boldItalic?i="_BoldItalicAssets/":void 0!==e.italic?i=h:void 0!==e.bold&&(i=c)}return`${this.m_baseUrl}/${this.name}${i}${e.name}`}}e.FontCatalog=u},9785:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GlyphData=void 0;const r=i(6815),n=i(5448),o=i(8533);class s{constructor(t,e,i,s,a,l,c,h,u,p,d,m,f,g=!1){this.codePoint=t,this.block=e,this.width=i,this.height=s,this.advanceX=a,this.offsetX=l,this.offsetY=c,this.texture=m,this.font=f,this.isReplacement=g,this.positions=[],this.sourceTextureCoordinates=[],this.dynamicTextureCoordinates=[],this.copyIndex=0,this.isInCache=!1,this.character=String.fromCodePoint(t),this.direction=o.UnicodeUtils.getDirection(t,e);const y=this.offsetX,v=y+this.width,_=f.metrics.lineHeight-this.offsetY,b=_-this.height;this.positions.push(new r.Vector3(y,b,1),new r.Vector3(v,b,1),new r.Vector3(y,_,1),new r.Vector3(v,_,1)),this.sourceTextureCoordinates.push(new n.Vector2(h,u),new n.Vector2(p,u),new n.Vector2(h,d),new n.Vector2(p,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)}}e.GlyphData=s},2090:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GlyphTextureCache=void 0;const r=i(5381),n=i(9896),o=i(6271),s=i(9365),a=i(3148),l=i(9044),c=i(6280),h=i(8955),u=i(5448),p=i(5269),d=i(5117),m=i(5808),f=i(394),g=i(8263),y=i(9785),v=i(4420),_=4096;e.GlyphTextureCache=class{constructor(t,e,i){this.capacity=t,this.entryWidth=e,this.entryHeight=i;const f=Math.floor(Math.sqrt(t));this.m_cacheHeight=f*f<t?f+1:f,this.m_cacheWidth=f*this.m_cacheHeight<t?f+1:f,this.m_textureSize=new u.Vector2(this.m_cacheWidth*e,this.m_cacheHeight*i),(this.m_textureSize.y>_||this.m_textureSize.x>_)&&console.warn("GlyphTextureCache texture size ("+this.m_textureSize.x+", "+this.m_textureSize.y+") exceeds WebGL's widely supported MAX_TEXTURE_SIZE ("+_+").\nThis could result in rendering errors on some devices.\nPlease consider reducing its capacity or input assets size."),this.m_entryCache=new g.LRUCache(t),this.initCacheEntries(),this.m_scene=new m.Scene,this.m_camera=new n.Orthogra
2phicCamera(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 d.WebGLRenderTarget(this.m_textureSize.x,this.m_textureSize.y,{wrapS:o.ClampToEdgeWrapping,wrapT:o.ClampToEdgeWrapping,depthBuffer:!1,stencilBuffer:!1}),this.m_copyTextureSet=new Set,this.m_copyTransform=new h.Matrix3,this.m_copyPositions=[],this.m_copyPositions.push(new u.Vector2,new u.Vector2,new u.Vector2,new u.Vector2),this.m_copyVertexBuffer=new l.InterleavedBuffer(new Float32Array(20*t),5),this.m_copyVertexBuffer.setUsage(o.DynamicDrawUsage),this.m_copyPositionAttribute=new c.InterleavedBufferAttribute(this.m_copyVertexBuffer,3,0),this.m_copyUVAttribute=new c.InterleavedBufferAttribute(this.m_copyVertexBuffer,2,3),this.m_copyGeometry=new a.BufferGeometry,this.m_copyGeometry.setAttribute("position",this.m_copyPositionAttribute),this.m_copyGeometry.setAttribute("uv",this.m_copyUVAttribute);const y=new s.BufferAttribute(new Uint32Array(6*t),1);y.setUsage(o.DynamicDrawUsage),this.m_copyGeometry.setIndex(y),this.m_copyMesh=new p.Mesh(this.m_copyGeometry),this.m_copyMesh.frustumCulled=!1,this.m_copyGeometryDrawCount=0,this.m_clearPositionAttribute=new s.BufferAttribute(new Float32Array(8*t),2),this.m_clearPositionAttribute.setUsage(o.DynamicDrawUsage),this.m_clearGeometry=new a.BufferGeometry,this.m_clearGeometry.setAttribute("position",this.m_clearPositionAttribute);const v=new s.BufferAttribute(new Uint32Array(6*t),1);v.setUsage(o.DynamicDrawUsage),this.m_clearGeometry.setIndex(v),this.m_clearGeometry.boundingSphere=new r.Sphere,this.m_clearMesh=new p.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 t,e;this.m_entryCache.clear(),this.m_scene.remove(this.m_clearMesh,this.m_copyMesh),this.m_rt.dispose(),null===(t=this.m_clearMaterial)||void 0===t||t.dispose(),null===(e=this.m_copyMaterial)||void 0===e||e.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(t,e){if(void 0!==this.m_entryCache.get(t))return;const i=this.m_entryCache.oldest;if(null===i)throw new Error("GlyphTextureCache is uninitialized!");this.clearCacheEntry(i.value),this.copyGlyphToCache(t,e,i.value.location)}has(t){return this.m_entryCache.has(t)}get(t){return this.m_entryCache.get(t)}clear(){this.m_copyGeometryDrawCount=0,this.m_clearGeometryDrawCount=0,this.m_entryCache.clear(),this.m_copyTextureSet.clear(),this.initCacheEntries()}update(t){let e=null;const i=this.m_clearGeometryDrawCount>0,r=this.m_copyGeometryDrawCount>0;if((i||r)&&(e=t.getRenderTarget(),t.setRenderTarget(this.m_rt)),i){if(this.m_clearMaterial||(this.m_clearMaterial=new v.GlyphClearMaterial({rendererCapabilities:t.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,t.render(this.m_scene,this.m_camera),this.m_clearGeometryDrawCount=0,this.m_clearMesh.visible=!1}if(r){if(this.m_copyMaterial||(this.m_copyMaterial=new v.GlyphCopyMaterial({rendererCapabilities:t.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 e=Array.from(this.m_copyTextureSet),i=Math.ceil(this.m_copyTextureSet.size/8);for(let r=0;r<i;r++){const i=8*r;this.m_copyMaterial.uniforms.pageOffset.value=i;for(let t=0;t<8;t++){const r=i+t;r<this.m_copyTextureSet.size&&(this.m_copyMaterial.uniforms["page"+t].value=e[r])}t.render(this.m_scene,this.m_camera)}this.m_copyTextureSet.clear(),this.m_copyGeometryDrawCount=0}(i||r)&&t.setRenderTarget(e)}initCacheEntries(){const t=new y.GlyphData(0,"",0,0,0,0,0,0,0,0,0,f.Texture.DEFAULT_IMAGE,{name:"",metrics:{size:0,distanceRange:0,base:0,lineHeight:0,lineGap:0,capHeight:0,xHeight:0},charset:""});for(let e=0;e<this.m_cacheHeight;e++)for(let i=0;i<this.m_cacheWidth;i++){const r={glyphData:t,location:new u.Vector2(i,e)};this.m_entryCache.set(`Dummy_${e*this.m_cacheHeight+i}`,r)}}copyGlyphToCache(t,e,i){this.m_copyTextureSet.add(e.texture);let r=0;for(const t of this.m_copyTextureSet.values()){if(t===e.texture)break;r++}e.copyIndex=r,this.m_copyTransform.set(1,0,i.x*this.entryWidth-e.offsetX,0,1,i.y*this.entryHeight-e.positions[0].y,0,0,0);for(let t=0;t<4;++t)this.m_copyPositions[t].set(e.positions[t].x,e.positions[t].y),this.m_copyPositions[t].applyMatrix3(this.m_copyTransform);if(this.m_copyGeometryDrawCount>=this.capacity)return;const n=4*this.m_copyGeometryDrawCount,o=6*this.m_copyGeometryDrawCount;for(let t=0;t<4;++t)this.m_copyPositionAttribute.setXYZ(n+t,this.m_copyPositions[t].x,this.m_copyPositions[t].y,e.copyIndex),this.m_copyUVAttribute.setXY(n+t,e.sourceTextureCoordinates[t].x,e.sourceTextureCoordinates[t].y);if(null===this.m_copyGeometry.index)throw new Error("GlyphTextureCache copy geometry index is uninitialized!");this.m_copyGeometry.index.setX(o,n),this.m_copyGeometry.index.setX(o+1,n+1),this.m_copyGeometry.index.setX(o+2,n+2),this.m_copyGeometry.index.setX(o+3,n+2),this.m_copyGeometry.index.setX(o+4,n+1),this.m_copyGeometry.index.setX(o+5,n+3),++this.m_copyGeometryDrawCount;const s=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;e.dynamicTextureCoordinates[0].set(s,a),e.dynamicTextureCoordinates[1].set(l,a),e.dynamicTextureCoordinates[2].set(s,c),e.dynamicTextureCoordinates[3].set(l,c),e.isInCache=!0,this.m_entryCache.set(t,{glyphData:e,location:i})}clearCacheEntry(t){if(t.glyphData.isInCache=!1,this.m_copyPositions[0].set(t.location.x*this.entryWidth,t.location.y*this.entryHeight),this.m_copyPositions[1].set((t.location.x+1)*this.entryWidth,t.location.y*this.entryHeight),this.m_copyPositions[2].set(t.location.x*this.entryWidth,(t.location.y+1)*this.entryHeight),this.m_copyPositions[3].set((t.location.x+1)*this.entryWidth,(t.location.y+1)*this.entryHeight),this.m_clearGeometryDrawCount>=this.capacity)return;const e=4*this.m_clearGeometryDrawCount,i=6*this.m_clearGeometryDrawCount;for(let t=0;t<4;++t)this.m_clearPositionAttribute.setXY(e+t,this.m_copyPositions[t].x,this.m_copyPositions[t].y);if(null===this.m_clearGeometry.index)throw new Error("GlyphTextureCache clear geometry index is uninitialized!");this.m_clearGeometry.index.setX(i,e),this.m_clearGeometry.index.setX(i+1,e+1),this.m_clearGeometry.index.setX(i+2,e+2),this.m_clearGeometry.index.setX(i+3,e+2),this.m_clearGeometry.index.setX(i+4,e+1),this.m_clearGeometry.index.setX(i+5,e+3),++this.m_clearGeometryDrawCount}}},9843:(t,e)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.TextBufferObject=void 0,e.TextBufferObject=class{constructor(t,e,i,r,n,o){this.glyphs=t,this.buffer=e,this.bounds=i,this.characterBounds=r,this.textRenderStyle=n,this.textLayoutStyle=o}}},16:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextGeometry=e.QUAD_INDEX_MEMORY_FOOTPRINT=e.QUAD_VERTEX_MEMORY_FOOTPRINT=e.INDICES_PER_QUAD=e.VERTICES_PER_QUAD=e.INDEX_BUFFER_STRIDE=e.VERTEX_BUFFER_STRIDE=e.MAX_CAPACITY=void 0;const r=i(6271),n=i(9365),o=i(3148),s=i(9044),a=i(6280),l=i(5269);e.MAX_CAPACITY=65536,e.VERTEX_BUFFER_STRIDE=16,e.INDEX_BUFFER_STRIDE=1,e.VERTICES_PER_QUAD=4,e.INDICES_PER_QUAD=6,e.QUAD_VERTEX_MEMORY_FOOTPRINT=e.VERTICES_PER_QUAD*e.VERTEX_BUFFER_STRIDE,e.QUAD_INDEX_MEMORY_FOOTPRINT=e.INDICES_PER_QUAD*e.INDEX_BUFFER_STRIDE,e.TextGeometry=class{get drawCount(){return this.m_drawCount}get mesh(){return this.m_mesh}get backgroundMesh(){return this.m_bgMesh}constructor(t,i,c,h,u){this.scene=t,this.m_pickingDataArray=[],this.capacity=Math.min(u,e.MAX_CAPACITY),this.m_currentCapacity=Math.min(h,u),this.m_drawCount=0,this.m_updateOffset=0,this.m_vertexBuffer=new s.InterleavedBuffer(new Float32Array(this.m_currentCapacity*e.QUAD_VERTEX_MEMORY_FOOTPRINT),e.VERTEX_BUFFER_STRIDE),this.m_vertexBuffer.setUsage(r.DynamicDrawUsage),this.m_positionAttribute=new a.InterleavedBufferAttribute(this.m_vertexBuffer,4,0),this.m_uvAttribute=new a.InterleavedBufferAttribute(this.m_vertexBuffer,4,4),this.m_colorAttribute=new a.InterleavedBufferAttribute(this.m_vertexBuffer,4,8),this.m_bgColorAttribute=new a.InterleavedBufferAttribute(this.m_vertexBuffer,4,12),this.m_indexBuffer=new n.BufferAttribute(new Uint32Array(this.m_currentCapacity*e.QUAD_INDEX_MEMORY_FOOTPRINT),e.INDEX_BUFFER_STRIDE),this.m_indexBuffer.setUsage(r.DynamicDrawUsage),this.m_geometry=new o.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 l.Mesh(this.m_geometry,i),this.m_bgMesh=new l.Mesh(this.m_geometry,c),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*e.QUAD_VERTEX_MEMORY_FOOTPRINT,this.m_vertexBuffer.updateRange.count=(this.m_drawCount-this.m_updateOffset)*e.QUAD_VERTEX_MEMORY_FOOTPRINT,this.m_indexBuffer.needsUpdate=!0,this.m_indexBuffer.updateRange.offset=this.m_updateOffset*e.QUAD_INDEX_MEMORY_FOOTPRINT,this.m_indexBuffer.updateRange.count=(this.m_drawCount-this.m_updateOffset)*e.QUAD_INDEX_MEMORY_FOOTPRINT),this.m_updateOffset=this.m_drawCount,this.m_geometry.setDrawRange(0,this.m_drawCount*e.INDICES_PER_QUAD)}add(t,i,r,n,o,s){if(this.m_drawCount>=this.capacity)return!1;if(this.m_drawCount>=this.m_currentCapacity){const t=Math.min(2*this.m_currentCapacity,this.capacity);this.resizeBuffers(t)}const a=this.m_drawCount*e.VERTICES_PER_QUAD,l=this.m_drawCount*e.INDICES_PER_QUAD;for(let l=0;l<e.VERTICES_PER_QUAD;++l){this.m_positionAttribute.setXYZW(a+l,i[l].x,i[l].y,i[l].z,(o?-1:1)*s.rotation);const e=o?(l+1)%2+2*Math.floor(l/2):l;this.m_uvAttribute.setXYZW(a+l,t.dynamicTextureCoordinates[e].x,t.dynamicTextureCoordinates[e].y,r,n),this.m_colorAttribute.setXYZW(a+l,s.color.r,s.color.g,s.color.b,s.opacity),this.m_bgColorAttribute.setXYZW(a+l,s.backgroundColor.r,s.backgroundColor.g,s.backgroundColor.b,s.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(t,i,r,n,o,s,a,l){for(let c=0;c<e.VERTICES_PER_QUAD;++c){const h=i+e.VERTEX_BUFFER_STRIDE*c;t[h]=n[c].x,t[h+1]=n[c].y,t[h+2]=n[c].z,t[h+3]=(a?-1:1)*l.rotation;const u=a?(c+1)%2+2*Math.floor(c/2):c;t[h+4]=r.dynamicTextureCoordinates[u].x,t[h+5]=r.dynamicTextureCoordinates[u].y,t[h+6]=o,t[h+7]=s,t[h+8]=l.color.r,t[h+9]=l.color.g,t[h+10]=l.color.b,t[h+11]=l.opacity,t[h+12]=l.backgroundColor.r,t[h+13]=l.backgroundColor.g,t[h+14]=l.backgroundColor.b,t[h+15]=l.backgroundOpacity}}addTextBufferObject(t,i,r,n,o,s,a,l){if(this.m_drawCount+t.glyphs.length>=this.capacity)return!1;if(this.m_drawCount+t.glyphs.length>=this.m_currentCapacity){const t=Math.min(2*this.m_currentCapacity,this.capacity);this.resizeBuffers(t)}const c=null!=r?r:1,h=null!=n?n:0,u=Math.cos(h),p=Math.sin(h),d=void 0!==i?i.x:0,m=void 0!==i?i.y:0,f=t.buffer,g=f[3]<0?-1:1,y=void 0!==o?o.r:f[8],v=void 0!==o?o.g:f[9],_=void 0!==o?o.b:f[10],b=void 0!==s?s:f[11],x=void 0!==a?a.r:f[12],w=void 0!==a?a.g:f[13],S=void 0!==a?a.b:f[14],T=void 0!==l?l:f[15],E=this.m_drawCount*e.VERTICES_PER_QUAD;for(let i=0;i<t.glyphs.length;++i){const r=i*e.QUAD_VERTEX_MEMORY_FOOTPRINT,n=t.glyphs[i];if(!n.isInCache)return!1;const o=f[r+4]>f[r+e.VERTEX_BUFFER_STRIDE+4],s=f[r+6],a=f[r+7];for(let t=0;t<e.VERTICES_PER_QUAD;++t){const l=f[r+t*e.VERTEX_BUFFER_STRIDE],M=f[r+t*e.VERTEX_BUFFER_STRIDE+1];this.m_positionAttribute.setXYZW(E+i*e.VERTICES_PER_QUAD+t,l*c*u+M*c*-p+d,l*c*p+M*c*u+m,f[r+t*e.VERTEX_BUFFER_STRIDE+2]+0,f[r+t*e.VERTEX_BUFFER_STRIDE+3]+g*h);const A=o?(t+1)%2+2*Math.floor(t/2):t;this.m_uvAttribute.setXYZW(E+i*e.VERTICES_PER_QUAD+t,n.dynamicTextureCoordinates[A].x,n.dynamicTextureCoordinates[A].y,s,(a-s)/c+s),this.m_colorAttribute.setXYZW(E+i*e.VERTICES_PER_QUAD+t,y,v,_,b),this.m_bgColorAttribute.setXYZW(E+i*e.VERTICES_PER_QUAD+t,x,w,S,T)}this.m_indexBuffer.setX((this.m_drawCount+i)*e.INDICES_PER_QUAD,(this.m_drawCount+i)*e.VERTICES_PER_QUAD),this.m_indexBuffer.setX((this.m_drawCount+i)*e.INDICES_PER_QUAD+1,(this.m_drawCount+i)*e.VERTICES_PER_QUAD+1),this.m_indexBuffer.setX((this.m_drawCount+i)*e.INDICES_PER_QUAD+2,(this.m_drawCount+i)*e.VERTICES_PER_QUAD+2),this.m_indexBuffer.setX((this.m_drawCount+i)*e.INDICES_PER_QUAD+3,(this.m_drawCount+i)*e.VERTICES_PER_QUAD+2),this.m_indexBuffer.setX((this.m_drawCount+i)*e.INDICES_PER_QUAD+4,(this.m_drawCount+i)*e.VERTICES_PER_QUAD+1),this.m_indexBuffer.setX((this.m_drawCount+i)*e.INDICES_PER_QUAD+5,(this.m_drawCount+i)*e.VERTICES_PER_QUAD+3)}return this.m_drawCount+=t.glyphs.length,!0}
2addPickingData(t,e,i){return!(this.m_pickingDataArray.length>=this.m_currentCapacity||(this.m_pickingDataArray.push({start:Math.min(t,this.capacity),end:Math.min(e,this.capacity),data:i}),0))}pick(t,i){for(const r of this.m_pickingDataArray){if(void 0===r)return;for(let n=r.start;n<r.end;++n){const o=n*e.VERTICES_PER_QUAD,s=Math.min(this.m_positionAttribute.getX(o+2),this.m_positionAttribute.getX(o+1));if(t.x<s)continue;const a=Math.max(this.m_positionAttribute.getX(o+2),this.m_positionAttribute.getX(o+1));if(t.x>a)continue;const l=Math.min(this.m_positionAttribute.getY(o+2),this.m_positionAttribute.getY(o+1));if(t.y<l)continue;const c=Math.max(this.m_positionAttribute.getY(o+2),this.m_positionAttribute.getY(o+1));if(!(t.y>c)){i(r.data);break}}}}updateMemoryUsage(t){const e=4*this.m_vertexBuffer.count+4*this.m_indexBuffer.count;t.heapSize+=e,t.gpuSize+=e}resizeBuffers(t){this.m_currentCapacity=t;const i=new Float32Array(t*e.QUAD_VERTEX_MEMORY_FOOTPRINT);i.set(this.m_vertexBuffer.array),this.m_vertexBuffer=new s.InterleavedBuffer(i,e.VERTEX_BUFFER_STRIDE),this.m_vertexBuffer.setUsage(r.DynamicDrawUsage),this.m_positionAttribute=new a.InterleavedBufferAttribute(this.m_vertexBuffer,4,0),this.m_uvAttribute=new a.InterleavedBufferAttribute(this.m_vertexBuffer,4,4),this.m_colorAttribute=new a.InterleavedBufferAttribute(this.m_vertexBuffer,4,8),this.m_bgColorAttribute=new a.InterleavedBufferAttribute(this.m_vertexBuffer,4,12);const c=new Uint32Array(t*e.QUAD_INDEX_MEMORY_FOOTPRINT);c.set(this.m_indexBuffer.array),this.m_indexBuffer=new n.BufferAttribute(c,e.INDEX_BUFFER_STRIDE),this.m_indexBuffer.setUsage(r.DynamicDrawUsage),this.m_geometry.dispose(),this.m_geometry=new o.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 l.Mesh(this.m_geometry,this.m_mesh.material),this.m_bgMesh=new l.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:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SdfTextMaterial=e.GlyphCopyMaterial=e.GlyphClearMaterial=void 0;const r=i(6271),n=i(4125),o=i(4085),s=i(6577),a=i(576),l=i(394),c=i(4342);Object.assign(a.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;
2\n float dy = dFdy(rotatedUVs.y) * sdfParams.y;\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 h extends o.RawShaderMaterial{constructor(t){const e=!0===(null==t?void 0:t.rendererCapabilities.isWebGL2),i=t?Object.assign(Object.assign({},t),{glslVersion:e?r.GLSL3:r.GLSL1,vertexShader:e&&t.vertexShader?(0,c.convertVertexShaderToWebGL2)(t.vertexShader):t.vertexShader,fragmentShader:e&&t.fragmentShader?(0,c.convertFragmentShaderToWebGL2)(t.fragmentShader):t.fragmentShader}):void 0;i&&delete i.rendererCapabilities,super(i)}}e.GlyphClearMaterial=class extends h{constructor(t){super(t?{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:t.rendererCapabilities}:void 0)}},e.GlyphCopyMaterial=class extends h{constructor(t){super(t?{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(l.Texture.DEFAULT_IMAGE),page1:new n.Uniform(l.Texture.DEFAULT_IMAGE),page2:new n.Uniform(l.Texture.DEFAULT_IMAGE),page3:new n.Uniform(l.Texture.DEFAULT_IMAGE),page4:new n.Uniform(l.Texture.DEFAULT_IMAGE),page5:new n.Uniform(l.Texture.DEFAULT_IMAGE),page6:new n.Uniform(l.Texture.DEFAULT_IMAGE),page7:new n.Uniform(l.Texture.DEFAULT_IMAGE)},depthTest:!1,depthWrite:!1,rendererCapabilities:t.rendererCapabilities}:void 0)}},e.SdfTextMaterial=class extends h{constructor(t){super(t?{name:"SdfTextMaterial",vertexShader:void 0!==t.vertexSource?t.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!==t.fragmentSource?t.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 }
2",uniforms:{sdfTexture:new n.Uniform(t.texture),sdfParams:new n.Uniform(new s.Vector4(t.textureSize.x,t.textureSize.y,t.size,t.distanceRange))},defines:{MSDF:t.isMsdf?1:0,BG_TEXT:t.isBackground?1:0},depthTest:!0,depthWrite:!1,side:r.FrontSide,transparent:!0,rendererCapabilities:t.rendererCapabilities}:void 0),this.extensions.derivatives=!0}}},1662:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolvePlacementAndAlignment=e.TextLayoutStyle=e.TextRenderStyle=e.DefaultTextStyle=e.vPlacementFromAlignment=e.hPlacementFromAlignment=e.vAlignFromPlacement=e.hAlignFromPlacement=e.WrappingMode=e.HorizontalPlacement=e.VerticalPlacement=e.HorizontalAlignment=e.VerticalAlignment=e.FontVariant=e.FontStyle=e.FontUnit=void 0;const r=i(5971);var n,o,s,a,l,c,h,u,p;!function(t){t[t.Em=0]="Em",t[t.Pixel=1]="Pixel",t[t.Point=2]="Point",t[t.Percent=3]="Percent"}(n=e.FontUnit||(e.FontUnit={})),function(t){t[t.Regular=0]="Regular",t[t.Bold=1]="Bold",t[t.Italic=2]="Italic",t[t.BoldItalic=3]="BoldItalic"}(o=e.FontStyle||(e.FontStyle={})),function(t){t[t.Regular=0]="Regular",t[t.AllCaps=1]="AllCaps",t[t.SmallCaps=2]="SmallCaps"}(s=e.FontVariant||(e.FontVariant={})),function(t){t[t.Above=0]="Above",t[t.Center=-.5]="Center",t[t.Below=-1]="Below"}(a=e.VerticalAlignment||(e.VerticalAlignment={})),function(t){t[t.Left=0]="Left",t[t.Center=-.5]="Center",t[t.Right=-1]="Right"}(l=e.HorizontalAlignment||(e.HorizontalAlignment={})),(p=e.VerticalPlacement||(e.VerticalPlacement={}))[p.Top=0]="Top",p[p.Center=-.5]="Center",p[p.Bottom=-1]="Bottom",(u=e.HorizontalPlacement||(e.HorizontalPlacement={}))[u.Left=-1]="Left",u[u.Center=-.5]="Center",u[u.Right=0]="Right",function(t){t[t.None=0]="None",t[t.Character=1]="Character",t[t.Word=2]="Word"}(c=e.WrappingMode||(e.WrappingMode={})),e.hAlignFromPlacement=function(t){return t},e.vAlignFromPlacement=function(t){return t},e.hPlacementFromAlignment=function(t){return t},e.vPlacementFromAlignment=function(t){return t},function(t){t.DEFAULT_FONT_NAME="",t.DEFAULT_FONT_SIZE={unit:Object.freeze(n.Pixel),size:Object.freeze(16),backgroundSize:Object.freeze(0)},t.DEFAULT_FONT_STYLE=o.Regular,t.DEFAULT_FONT_VARIANT=s.Regular,t.DEFAULT_ROTATION=0,t.DEFAULT_COLOR=new r.Color(0),t.DEFAULT_OPACITY=1,t.DEFAULT_BACKGROUND_COLOR=new r.Color(0),t.DEFAULT_BACKGROUND_OPACITY=0,t.DEFAULT_TRACKING=0,t.DEFAULT_LEADING=0,t.DEFAULT_MAX_LINES=1/0,t.DEFAULT_LINE_WIDTH=1/0,t.DEFAULT_CANVAS_ROTATION=0,t.DEFAULT_LINE_ROTATION=0,t.DEFAULT_WRAPPING_MODE=c.Word,t.DEFAULT_VERTICAL_ALIGNMENT=a.Above,t.DEFAULT_HORIZONTAL_ALIGNMENT=l.Left,t.DEFAULT_PLACEMENTS=[]}(h=e.DefaultTextStyle||(e.DefaultTextStyle={}));class d{constructor(t={}){this.m_params={fontName:void 0!==t.fontName?t.fontName:h.DEFAULT_FONT_NAME,fontSize:void 0!==t.fontSize?Object.assign({},t.fontSize):{unit:h.DEFAULT_FONT_SIZE.unit,size:h.DEFAULT_FONT_SIZE.size,backgroundSize:h.DEFAULT_FONT_SIZE.backgroundSize},fontStyle:void 0!==t.fontStyle?t.fontStyle:h.DEFAULT_FONT_STYLE,fontVariant:void 0!==t.fontVariant?t.fontVariant:h.DEFAULT_FONT_VARIANT,rotation:void 0!==t.rotation?t.rotation:h.DEFAULT_ROTATION,color:void 0!==t.color?t.color.clone():h.DEFAULT_COLOR.clone(),opacity:void 0!==t.opacity?t.opacity:h.DEFAULT_OPACITY,backgroundColor:void 0!==t.backgroundColor?t.backgroundColor.clone():h.DEFAULT_BACKGROUND_COLOR.clone(),backgroundOpacity:void 0!==t.backgroundOpacity?t.backgroundOpacity:h.DEFAULT_BACKGROUND_OPACITY,backgroundImage:t.backgroundImage}}get params(){return this.m_params}set params(t){this.m_params=Object.assign(Object.assign({},this.m_params),t)}get fontName(){return this.m_params.fontName}set fontName(t){this.m_params.fontName=t}get fontSize(){return this.m_params.fontSize}set fontSize(t){this.m_params.fontSize=Object.assign({},t)}get fontStyle(){return this.m_params.fontStyle}set fontStyle(t){this.m_params.fontStyle=t}get fontVariant(){return this.m_params.fontVariant}set fontVariant(t){this.m_params.fontVariant=t}get rotation(){return this.m_params.rotation}set rotation(t){this.m_params.rotation=t}get color(){return this.m_params.color}set color(t){this.m_params.color.copy(t)}get backgroundColor(){return this.m_params.backgroundColor}set backgroundColor(t){this.m_params.backgroundColor.copy(t)}get opacity(){return this.m_params.opacity}set opacity(t){this.m_params.opacity=t}get backgroundOpacity(){return this.m_params.backgroundOpacity}set backgroundOpacity(t){this.m_params.backgroundOpacity=t}get backgroundImage(){return this.m_params.backgroundImage}set backgroundImage(t){this.m_params.backgroundImage=t}clone(t={}){return new d(Object.assign(Object.assign({},this.m_params),t))}copy(t){return this.m_params.fontName=t.fontName,this.m_params.fontSize=Object.assign({},t.fontSize),this.m_params.fontStyle=t.fontStyle,this.m_params.fontVariant=t.fontVariant,this.m_params.rotation=t.rotation,this.m_params.color.copy(t.color),this.m_params.backgroundColor.copy(t.backgroundColor),this.m_params.opacity=t.opacity,this.m_params.backgroundOpacity=t.backgroundOpacity,this.m_params.backgroundImage=t.backgroundImage,this}}e.TextRenderStyle=d;class m{constructor(t={}){const{horizontalAlignment:e,verticalAlignment:i,placements:r}=f(t.horizontalAlignment,t.verticalAlignment,t.placements);this.m_params={tracking:void 0!==t.tracking?t.tracking:h.DEFAULT_TRACKING,leading:void 0!==t.leading?t.leading:h.DEFAULT_LEADING,maxLines:void 0!==t.maxLines?t.maxLines:h.DEFAULT_MAX_LINES,lineWidth:void 0!==t.lineWidth?t.lineWidth:h.DEFAULT_LINE_WIDTH,canvasRotation:void 0!==t.canvasRotation?t.canvasRotation:h.DEFAULT_CANVAS_ROTATION,lineRotation:void 0!==t.lineRotation?t.lineRotation:h.DEFAULT_LINE_ROTATION,wrappingMode:void 0!==t.wrappingMode?t.wrappingMode:h.DEFAULT_WRAPPING_MODE,verticalAlignment:i,horizontalAlignment:e,placements:r}}get params(){return this.m_params}set params(t){this.m_params=Object.assign(Object.assign({},this.m_params),t)}get tracking(){return this.m_params.tracking}set tracking(t){this.m_params.tracking=t}get leading(){return this.m_params.leading}set leading(t){this.m_params.leading=t}get maxLines(){return this.m_params.maxLines}set maxLines(t){this.m_params.maxLines=t}get lineWidth(){return this.m_params.lineWidth}set lineWidth(t){this.m_params.lineWidth=t}get canvasRotation(){return this.m_params.canvasRotation}set canvasRotation(t){this.m_params.canvasRotation=t}get lineRotation(){return this.m_params.lineRotation}set lineRotation(t){this.m_params.lineRotation=t}get wrappingMode(){return this.m_params.wrappingMode}set wrappingMode(t){this.m_params.wrappingMode=t}get verticalAlignment(){return this.m_params.verticalAlignment}set verticalAlignment(t){this.m_params.verticalAlignment=t}get horizontalAlignment(){return this.m_params.horizontalAlignment}set horizontalAlignment(t){this.m_params.horizontalAlignment=t}get placements(){return this.m_params.placements}set placements(t){const{horizontalAlignment:e,verticalAlignment:i,placements:r}=f(this.horizontalAlignment,this.verticalAlignment,t);this.m_params.horizontalAlignment=e,this.m_params.verticalAlignment=i,this.m_params.placements=r}clone(t={}){return new m(Object.assign(Object.assign({},this.m_params),t))}copy(t){return this.params=Object.assign({},t.params),this}}function f(t,e,i){var r;const n=null!==(r=null==i?void 0:i.map(t=>Object.assign({},t)))&&void 0!==r?r:h.DEFAULT_PLACEMENTS.map(t=>Object.assign({},t));return{horizontalAlignment:n.length>0?n[0].h:null!=t?t:h.DEFAULT_HORIZONTAL_ALIGNMENT,verticalAlignment:n.length>0?n[0].v:null!=e?e:h.DEFAULT_VERTICAL_ALIGNMENT,placements:n}}e.TextLayoutStyle=m,e.resolvePlacementAndAlignment=f},5402:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.LineTypesetter=void 0;const r=i(8955),n=i(6815),o=i(16),s=i(1662),a=i(1741),l=i(8533);e.LineTypesetter=class{constructor(){this.m_tempTransform=new r.Matrix3,this.m_tempCorners=[new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3],this.m_tempLineDirection=l.UnicodeUtils.Direction.LTR,this.m_tempRunDirection=l.UnicodeUtils.Direction.LTR,this.m_tempPixelSize=1,this.m_tempPixelBgSize=1,this.m_tempScale=1,this.m_tempSmallCaps=!1}arrangeGlyphs(t){this.m_currentParams=t,this.m_tempLineDirection=a.TypesettingUtils.getDirection(this.m_currentParams.glyphs,0),this.m_tempRunDirection=this.m_tempLineDirection,this.m_tempPixelSize=a.TypesettingUtils.fontSizeAlignmentFactor*a.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(a.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 e=void 0!==this.m_currentParams.globalBounds&&void 0===this.m_currentParams.vertexBuffer,i=this.m_currentParams.position.x,r=this.m_currentParams.glyphs[0].font.metrics.lineHeight+this.m_currentParams.textLayoutStyle.leading;let n=0,o=0,c=0,h=0,u=0,p=0,d=0,m=0,f=!1;for(let t=0;t<this.m_currentParams.glyphs.length&&!(m>this.m_currentParams.textLayoutStyle.maxLines-1);++t){const g=this.m_currentParams.glyphs[t];if(!g.isInCache&&!e)return!1;const y=l.UnicodeUtils.isNewLine(g.codePoint),v=l.UnicodeUtils.isWhiteSpace(g.codePoint);if(f||g.direction!==-this.m_tempLineDirection||(f=!0),l.UnicodeUtils.isPrintable(g.codePoint)&&(u+=(g.advanceX*this.m_tempScale+this.m_currentParams.textLayoutStyle.tracking)*(this.m_tempSmallCaps?a.TypesettingUtils.getSmallCapsScale(this.m_currentParams.glyphs,this.m_currentParams.smallCapsArray,t,this.m_currentParams.textRenderStyle.fontVariant):1)),t===n&&(h=u,p=u,d=u),y||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&&d!==h){if(this.m_currentParams.textLayoutStyle.wrappingMode!==s.WrappingMode.None){let e=o,i=p;this.m_currentParams.textLayoutStyle.wrappingMode===s.WrappingMode.Word&&d!==h&&(e=c,i=d),u=i,t=Math.min(y?n===t?e:t:e,this.m_currentParams.glyphs.length-1)}const e=this.m_tempLineDirection===l.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*e,!this.placeLine(n,t,this.m_tempLineDirection,f))return!1;for(this.m_currentParams.position.y-=r*this.m_tempScale,this.m_currentParams.position.x=i;t!==n&&t+1<this.m_currentParams.glyphs.length&&l.UnicodeUtils.isWhiteSpace(this.m_currentParams.glyphs[t+1].codePoint);)++t;if(n=t+1,n===this.m_currentParams.glyphs.length)break;y&&(this.m_tempLineDirection=a.TypesettingUtils.getDirection(this.m_currentParams.glyphs,n),this.m_tempRunDirection=this.m_tempLineDirection),h=0,u=0,o=n,p=0,c=n,d=0,f=!1,m++}else this.m_currentParams.textLayoutStyle.wrappingMode===s.WrappingMode.None||v||(o=t,p=u,this.m_currentParams.textLayoutStyle.wrappingMode===s.WrappingMode.Word&&t+1<this.m_currentParams.glyphs.length&&(l.UnicodeUtils.isWhiteSpace(this.m_currentParams.glyphs[t+1].codePoint)||l.UnicodeUtils.isNewLine(this.m_currentParams.glyphs[t+1].codePoint))&&(c=t,d=u))}if(m<=this.m_currentParams.textLayoutStyle.maxLines-1&&n<=this.m_currentParams.glyphs.length-1){const t=this.m_tempLineDirection===l.UnicodeUtils.Direction.RTL&&f?1+this.m_currentParam
2s.textLayoutStyle.horizontalAlignment:this.m_currentParams.textLayoutStyle.horizontalAlignment;if(this.m_currentParams.position.setX(this.m_currentParams.position.x+u*t),!this.placeLine(n,this.m_currentParams.glyphs.length-1,this.m_tempLineDirection,f))return!1}if(t.globalBounds&&t.globalBounds.max.x-t.globalBounds.min.x>0&&t.globalBounds.max.y-t.globalBounds.min.y>0){const e=t.globalBounds,i=(.5*this.m_currentParams.fontCatalog.distanceRange-this.m_tempPixelBgSize)*this.m_tempScale;e.min.set(e.min.x+i,e.min.y+i),e.max.set(e.max.x-i,e.max.y-i)}return!0}placeLine(t,e,i,r){if(!r)return this.placeRun(t,e,i);const n=this.m_currentParams.glyphs,o=this.m_currentParams.smallCapsArray,s=this.m_currentParams.textRenderStyle,c=this.m_currentParams.textLayoutStyle,h=this.m_currentParams.position,u=i===l.UnicodeUtils.Direction.RTL,p=h.x;let d=0,m=t;for(let r=t;r<=e;++r){const t=n[r];if(t.direction===-this.m_tempRunDirection){if(u&&(h.x=p+d),!this.placeRun(m,r-1,this.m_tempRunDirection))return!1;u||(h.x=p+d),m=r,this.m_tempRunDirection*=-1}else if(t.direction===l.UnicodeUtils.Direction.Neutral&&this.m_tempRunDirection===-i){let t=r;for(;t+1<n.length&&1!==Math.abs(n[t].direction);)++t;if(n[t].direction!==this.m_tempRunDirection){if(u&&(h.x=p+d),!this.placeRun(m,r-1,this.m_tempRunDirection))return!1;u||(h.x=p+d),m=r,this.m_tempRunDirection*=-1}}d+=(t.advanceX*this.m_tempScale+c.tracking)*(this.m_tempSmallCaps?a.TypesettingUtils.getSmallCapsScale(n,o,r,s.fontVariant):1)*i}if(m<=e){if(u&&(h.x=p+d),!this.placeRun(m,e,this.m_tempRunDirection))return!1;u||(h.x=p+d)}return!0}placeRun(t,e,i){const r=this.m_currentParams.glyphs,n=this.m_currentParams.smallCapsArray,c=this.m_currentParams.fontCatalog,h=this.m_currentParams.textRenderStyle,u=this.m_currentParams.textLayoutStyle,p=this.m_currentParams.position,d=this.m_currentParams.geometry,m=this.m_currentParams.globalBounds,f=this.m_currentParams.individualBounds,g=this.m_currentParams.vertexBuffer,y=i===l.UnicodeUtils.Direction.LTR?t:e,v=i===l.UnicodeUtils.Direction.LTR?e:t;for(let _=y;i===l.UnicodeUtils.Direction.RTL?_>=v:_<=v;_+=i){const y=r[_];if(!l.UnicodeUtils.isPrintable(y.codePoint))continue;if(t!==e&&0!==_&&i===l.UnicodeUtils.Direction.RTL&&y.direction===l.UnicodeUtils.Direction.Weak){let e=_,i=r[e-1];for(;e!==t&&(i.direction===l.UnicodeUtils.Direction.Weak||i.direction===l.UnicodeUtils.Direction.Neutral&&!l.UnicodeUtils.isWhiteSpace(i.codePoint));)--e,i=r[e-1];this.placeRun(Math.max(e,t),_,l.UnicodeUtils.Direction.LTR),_=e;continue}const v=y.font,b=v.metrics,x=h.fontStyle,w=x===s.FontStyle.Bold&&void 0===v.bold||x===s.FontStyle.BoldItalic&&void 0===v.bold&&void 0===v.boldItalic,S=x===s.FontStyle.Italic&&void 0===v.italic||x===s.FontStyle.BoldItalic&&void 0===v.italic&&void 0===v.boldItalic,T=!!this.m_tempSmallCaps&&n[_]&&h.fontVariant===s.FontVariant.SmallCaps,E=T?b.xHeight/b.capHeight:1,M=this.m_tempScale*E,A=((w?.02:0)+(T?.01:0))*(c.size/c.distanceRange),C=a.TypesettingUtils.alignBackgroundWidth(this.m_tempPixelSize,.5*this.m_tempPixelBgSize/(c.distanceRange*Math.max(M,1))),P=l.UnicodeUtils.isRtlMirrored(y.codePoint)&&i===l.UnicodeUtils.Direction.RTL,L=b.lineHeight-b.base-.5*b.distanceRange;a.TypesettingUtils.computeGlyphTransform(this.m_tempTransform,p,M,u.canvasRotation,h.rotation);for(let t=0;t<4;++t){const e=y.positions[t],i=S&&t>1?a.TypesettingUtils.OBLIQUE_OFFSET*b.size:0;this.m_tempCorners[t].set(e.x+i,e.y-L,e.z),this.m_tempCorners[t].applyMatrix3(this.m_tempTransform)}if(void 0===m&&void 0===g){if(!d.add(y,this.m_tempCorners,A,A+C,P,h))return!1}else void 0!==m&&a.TypesettingUtils.updateBounds(this.m_tempCorners,m,f),void 0!==g&&d.addToBuffer(g,_*o.QUAD_VERTEX_MEMORY_FOOTPRINT,y,this.m_tempCorners,A,A+C,P,h);p.set(p.x+(y.advanceX*M+u.tracking)*Math.cos(u.lineRotation),p.y+(y.advanceX*M+u.tracking)*Math.sin(u.lineRotation),p.z)}return!0}}},2516:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PathTypesetter=void 0;const r=i(8955),n=i(5448),o=i(6815),s=i(16),a=i(1662),l=i(1741),c=i(8533);e.PathTypesetter=class{constructor(){this.m_tempTransform=new r.Matrix3,this.m_tempCorners=[new o.Vector3,
2new o.Vector3,new o.Vector3,new o.Vector3],this.m_tempLineDirection=c.UnicodeUtils.Direction.LTR,this.m_tempRunDirection=c.UnicodeUtils.Direction.LTR,this.m_tempPixelSize=1,this.m_tempPixelBgSize=1,this.m_tempScale=1,this.m_tempSmallCaps=!1,this.m_tempPathPosition=new o.Vector3,this.m_tempPathLength=0,this.m_tempPathOffset=0}arrangeGlyphs(t){var e;this.m_currentParams=t,this.m_tempLineDirection=l.TypesettingUtils.getDirection(this.m_currentParams.glyphs,0),this.m_tempRunDirection=this.m_tempLineDirection,this.m_tempPixelSize=l.TypesettingUtils.fontSizeAlignmentFactor*l.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(l.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 r=!1,n=0;for(let t=0;t<this.m_currentParams.glyphs.length;++t){const e=this.m_currentParams.glyphs[t];if(!e.isInCache&&!i)return!1;c.UnicodeUtils.isPrintable(e.codePoint)&&(r||e.direction!==-this.m_tempLineDirection||(r=!0),n+=(e.advanceX*this.m_tempScale+this.m_currentParams.textLayoutStyle.tracking)*(this.m_tempSmallCaps?l.TypesettingUtils.getSmallCapsScale(this.m_currentParams.glyphs,this.m_currentParams.smallCapsArray,t,this.m_currentParams.textRenderStyle.fontVariant):1))}return this.m_tempPathOffset=Math.min(Math.max(-this.m_currentParams.textLayoutStyle.horizontalAlignment+this.m_currentParams.textLayoutStyle.horizontalAlignment*n/this.m_tempPathLength+(null!==(e=this.m_currentParams.horizontalOffset)&&void 0!==e?e:0),0),1),this.placeLine(this.m_tempLineDirection,r)}placeLine(t,e){if(!e)return this.placeRun(0,this.m_currentParams.glyphs.length-1,t);const i=this.m_currentParams.glyphs;let r=0;for(let e=r;e<i.length;++e){const n=i[e];if(n.direction===-this.m_tempRunDirection){if(!this.placeRun(r,e-1,this.m_tempRunDirection))return!1;r=e,this.m_tempRunDirection*=-1}else if(n.direction===c.UnicodeUtils.Direction.Neutral&&this.m_tempRunDirection===-t){let t=e;for(;t+1<i.length&&1!==Math.abs(i[t].direction);)++t;if(i[t].direction!==this.m_tempRunDirection){if(!this.placeRun(r,e-1,this.m_tempRunDirection))return!1;r=e,this.m_tempRunDirection*=-1}}}return!(r<i.length&&!this.placeRun(r,i.length-1,this.m_tempRunDirection))}placeRun(t,e,i){const r=this.m_currentParams.glyphs,o=this.m_currentParams.smallCapsArray,h=this.m_currentParams.fontCatalog,u=this.m_currentParams.textRenderStyle,p=this.m_currentParams.textLayoutStyle,d=this.m_currentParams.position,m=this.m_currentParams.geometry,f=this.m_currentParams.globalBounds,g=this.m_currentParams.individualBounds,y=this.m_currentParams.vertexBuffer,v=this.m_currentParams.path,_=u.rotation,b=p.verticalAlignment*r[0].font.metrics.capHeight*this.m_tempScale,x=i===c.UnicodeUtils.Direction.LTR?t:e,w=i===c.UnicodeUtils.Direction.LTR?e:t;for(let S=x;i===c.UnicodeUtils.Direction.RTL?S>=w:S<=w;S+=i){const x=r[S];if(!c.UnicodeUtils.isPrintable(x.codePoint))continue;if(t!==e&&0!==S&&i===c.UnicodeUtils.Direction.RTL&&x.direction===c.UnicodeUtils.Direction.Weak){let e=S,i=r[e-1];for(;e!==t&&(i.direction===c.UnicodeUtils.Direction.Weak||i.direction===c.UnicodeUtils.Direction.Neutral&&!c.UnicodeUtils.isWhiteSpace(i.codePoint));)--e,i=r[e-1];this.placeRun(Math.max(e,t),S,c.UnicodeUtils.Direction.LTR),S=e;continue}const w=x.font,T=w.metrics,E=u.fontStyle,M=E===a.FontStyle.Bold&&void 0===w.bold||E===a.FontStyle.BoldItalic&&void 0===w.bold&&void 0===w.boldItalic,A=E===a.FontStyle.Italic&&void 0===w.italic||E===a.FontStyle.BoldItalic&&void 0===w.italic&&void 0===w.boldItalic,C=!!this.m_tempSmallCaps&&o[S]&&u.fontVariant===a.FontVariant.SmallCaps,P=C?T.x
2Height/T.capHeight:1,L=this.m_tempScale*P,R=((M?.02:0)+(C?.01:0))*(h.size/h.distanceRange),I=l.TypesettingUtils.alignBackgroundWidth(this.m_tempPixelSize,.5*this.m_tempPixelBgSize/(h.distanceRange*Math.max(L,1))),O=c.UnicodeUtils.isRtlMirrored(x.codePoint)&&i===c.UnicodeUtils.Direction.RTL,D=T.lineHeight-T.base-.5*T.distanceRange,k=v.getPoint(this.m_tempPathOffset);if(null===k)return this.m_currentParams.pathOverflow;const N=v.getTangent(this.m_tempPathOffset),F=new n.Vector2(-N.y,N.x).multiplyScalar(b),U=Math.atan2(N.y,N.x);this.m_tempPathPosition.set(F.x+k.x,F.y+k.y,d.z),u.rotation=_+U,l.TypesettingUtils.computeGlyphTransform(this.m_tempTransform,this.m_tempPathPosition,L,0,u.rotation);for(let t=0;t<4;++t){const e=x.positions[t],i=A&&t>1?l.TypesettingUtils.OBLIQUE_OFFSET*T.size:0;this.m_tempCorners[t].set(e.x+i,e.y-D,e.z),this.m_tempCorners[t].applyMatrix3(this.m_tempTransform),this.m_tempCorners[t].x-=d.x,this.m_tempCorners[t].y-=d.y}if(void 0===f&&void 0===y){if(!m.add(x,this.m_tempCorners,R,R+I,O,u))return!1}else void 0!==f&&l.TypesettingUtils.updateBounds(this.m_tempCorners,f,g),void 0!==y&&m.addToBuffer(y,S*s.QUAD_VERTEX_MEMORY_FOOTPRINT,x,this.m_tempCorners,R,R+I,O,u);u.rotation=_,this.m_tempPathOffset+=(x.advanceX*L+p.tracking)/this.m_tempPathLength}return!0}}},889:(t,e)=>{var i,r;Object.defineProperty(e,"__esModule",{value:!0}),e.ContextualArabicConverter=void 0,function(t){t[t.Initial=0]="Initial",t[t.Medial=1]="Medial",t[t.Final=2]="Final"}(i||(i={})),function(t){t[t.Isolated=0]="Isolated",t[t.Connected=1]="Connected"}(r||(r={}));class n{static get instance(){return void 0===this.m_instance&&(this.m_instance=new n),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]
2),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(t){let e="";for(let n=0;n<t.length;++n){const o=t.charCodeAt(n);if(this.isArabicCharacter(o)){let s=n-1;for(;s>=0&&this.isNeutral(t.charCodeAt(s));--s);let a=s>=0?t.charCodeAt(s):void 0;if(void 0!==a){const t=this.getCharacterMap(a);(void 0===t||void 0===t[i.Initial]&&void 0===t[i.Medial])&&(a=void 0)}let l=n+1;for(;l<t.length&&this.isNeutral(t.charCodeAt(l));++l);let c=l<t.length?t.charCodeAt(l):void 0;if(void 0!==c){const t=this.getCharacterMap(c);(void 0===t||void 0===t[i.Medial]&&void 0===t[i.Final])&&(c=void 0)}if(1604===o&&void 0!==c&&(1570===c||1571===c||1573===c||1575===c)){const t=this.getCombinedCharacterMap(o,c);e+=void 0!==a?String.fromCharCode(t[r.Connected]):String.fromCharCode(t[r.Isolated]),++n;continue}const h=this.getCharacterMap(o);void 0!==a&&void 0!==c&&void 0!==h[i.Medial]?e+=String.fromCharCode(h[i.Medial]):void 0!==a&&void 0!==h[i.Final]?e+=String.fromCharCode(h[i.Final]):void 0!==c&&void 0!==h[i.Initial]?e+=String.fromCharCode(h[i.Initial]):e+=String.fromCharCode(o)}else e+=String.fromCharCode(o)}return e}isArabicCharacter(t){return this.m_singleCharactersMap.has(t)}getCharacterMap(t){return this.m_singleCharactersMap.get(t)}getCombinedCharacterMap(t,e){const i=this.m_combinedCharactersMap.get(t);if(void 0!==i)return i.get(e)}isNeutral(t){for(const e of this.m_neutralCharacters)if(e===t)return!0;return!1}}e.ContextualArabicConverter=n},3461:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createSdfTextMaterial=void 0;const r=i(4420);e.createSdfTextMaterial=function(t){return new r.SdfTextMaterial({texture:t.fontCatalog.texture,textureSize:t.fontCatalog.textureSize,size:t.fontCatalog.size,distanceRange:t.fontCatalog.distanceRange,isMsdf:"msdf"===t.fontCatalog.type,isBackground:!0===t.isBackground,vertexSource:t.vertexSource,fragmentSource:t.fragmentSource,rendererCapabilities:t.rendererCapabilities})}},1741:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypesettingUtils=void 0;const r=i(433),n=i(5448),o=i(1662),s=i(8533);var a;(a=e.TypesettingUtils||(e.TypesettingUtils={})).EM_TO_PX=16,a.PT_TO_PX=1.25,a.OBLIQUE_ANGLE=.174533,a.OBLIQUE_OFFSET=Math.tan(a.OBLIQUE_ANGLE),a.getPixelSize=function(t,e,i){let r=t;switch(e){case o.FontUnit.Em:r*=a.EM_TO_PX;break;case o.FontUnit.Point:r*=a.PT_TO_PX;break;case o.FontUnit.Percent:r*=.01*i}return r},a.getSmallCapsScale=function(t,e,i,r){return e[i]&&r===o.FontVariant.SmallCaps?t[i].font.metrics.xHeight/t[i].font.metrics.capHeight:1},a.getDirection=function(t,e){let i=s.UnicodeUtils.Direction.LTR,r=e;for(;t[r].direction!==s.UnicodeUtils.Direction.LTR&&t[r].direction!==s.UnicodeUtils.Direction.RTL&&r<t.length-1;)++r;return 1===Math.abs(t[r].direction)&&(i=t[r].direction),i},a.computeGlyphTransform=function(t,e,i,r,n){const o=Math.cos(r),s=Math.sin(r),a=Math.cos(n),l=Math.sin(n);t.set(i*a,i*-l,o*e.x-s*e.y,i*l,i*a,s*e.x+o*e.y,0,0,1)},a.updateBounds=function(t,e,i){const o=Math.min(t[0].x,t[1].x,t[2].x,t[3].x),s=Math.max(t[0].x,t[1].x,t[2].x,t[3].x),a=Math.min(t[0].y,t[1].y,t[2].y,t[3].y),l=Math.max(t[0].y,t[1].y,t[2].y,t[3].y);void 0!==i&&(void 0!==i.array[i.offset]?(i.array[i.offset].min.set(o,a),i.array[i.offset].max.set(s,l)):i.array.push(new r.Box2(new n.Vector2(o,a),new n.Vector2(s,l))),++i.offset),e.min.set(Math.min(e.min.x,o),Math.min(e.min.y,a)),e.max.set(Math.max(e.max.x,s),Math.max(e.max.y,l))},a.fontSizeAlignmentFactor=.964,a.alignBackgroundWidth=function(t,e){return 11.5*e/Math.sqrt(t)}},8533:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.UnicodeUtils=void 0,function(t){let e;t.whiteSpaceRanges=[[9,9],[32,32],[5760,5760],[8192,8198],[8200,8202],[8287,12288],[6158,6158],[8203,8205]],t.isWhiteSpace=function(e){for(const i of t.whiteSpaceRanges)if(e>=i[0]&&e<=i[1])return!0;return!1},t.newLineRanges=[[10,13],[133,133],[8232,8233]],t.isNewLine=function(e){for(const i of t.newLineRanges)if(e>=i[0]&&e<=i[1])return!0;return!1},t.nonPrintableRanges=[[0,31],[127,159]],t.isPrintable=function(e){for(const i of t.nonPrintableRanges)if(e>=i[0]&&e<=i[1])return!1;return!0},function(t){t[t.Neutral=0]="Neutral",t[t.Weak=.5]="Weak",t[t.LTR=1]="LTR",t[t.RTL=-1]="RTL"}(e=t.Direction||(t.Direction={})),t.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"],t.neutralBidirectionalRanges=[[32,47],[58,64],[91,96],[123,126]],t.weakBidirectionalRanges=[[48,57],[1632,1641],[1776,1785]],t.getDirection=function(i,r){for(const r of t.weakBidirectionalRanges)if(i>=r[0]&&i<=r[1])return e.Weak;for(const r of t.neutralBidirectionalRanges)if(i>=r[0]&&i<=r[1])return e.Neutral;return void 0!==t.rtlBlocks.find(t=>t===r)?e.RTL:e.LTR},t.rtlMirroredCodePoints=[40,41,60,62,91,93,123,125],t.isRtlMirrored=function(e){return void 0!==t.rtlMirroredCodePoints.find(t=>t===e)}}(e.UnicodeUtils||(e.UnicodeUtils={}))}
2,1984:function(t,e,i){var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(7259),e),n(i(8284),e),n(i(1017),e),n(i(1370),e),n(i(1216),e),n(i(5771),e),n(i(8131),e),n(i(6304),e),n(i(8023),e)},1667:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ColorUtils=void 0;const r=i(5971),n=i(3334),o=i(8263),s=i(797),a=i(7610),l=255,c=new r.Color,h={h:0,s:0,l:0};!function(t){function e(t,e){return(0,n.clamp)(t+(e<0?t:1-t)*e,0,1)}function i(t,e,i){let r;if(a.RGBA.isRGBA(e))r=t.equals(e)===i;else if("string"==typeof e){const n=u.get(e);if(n)r=t.equals(n)===i;else{const n=a.RGBA.parse(e);void 0!==n&&(u.set(e,n),r=t.equals(n)===i)}}return r}t.getHexFromRgba=function(t,e,i,r){return(0,s.assert)(r>=0&&r<=1),l-Math.floor(r*l)<<24^t*l<<16^e*l<<8^i*l},t.getHexFromRgb=function(t,e,i){return(0,s.assert)(t>=0&&t<=1),(0,s.assert)(e>=0&&e<=1),(0,s.assert)(i>=0&&i<=1),t*l<<16^e*l<<8^i*l},t.getHexFromHsl=function(t,e,i){return(0,s.assert)(t>=0&&t<=1),(0,s.assert)(e>=0&&e<=1),(0,s.assert)(i>=0&&i<=1),c.setHSL(t,e,i).getHex()},t.darken=function(t,e){return c.setRGB(t.r,t.g,t.b),c.getHSL(h),h.l=(0,n.clamp)(h.l-e,0,1),c.setHSL(h.h,h.s,h.l),t.r=c.r,t.g=c.g,t.b=c.b,t},t.scaleColor=function(t,i){return c.setRGB(t.r,t.g,t.b),c.getHSL(h),h.s=e(h.s,i.s),h.l=e(h.l,i.l),c.setHSL(h.h,h.s,h.l),t.r=c.r,t.g=c.g,t.b=c.b,t.a=e(t.a,i.a),t},t.getRgbaFromHex=function(t,e=new a.RGBA){return(0,s.assert)(!0,"Wrong hex format"),e.r=(t>>16&l)/l,e.g=(t>>8&l)/l,e.b=(t&l)/l,e.a=(l-(t>>24&l))/l,e},t.hasAlphaInHex=function(t){return(0,s.assert)(!0,"Wrong hex format"),!!(t>>24)},t.getAlphaFromHex=function(t){return(0,s.assert)(!0,"Wrong hex format"),(l-(t>>24)&l)/l},t.removeAlphaFromHex=function(t){return(0,s.assert)(!0,"Wrong hex format"),16777215&t},t.comparePotentiallyRGBA=function(t,e,r){let n;return a.RGBA.isRGBA(t)?n=i(t,e,r):a.RGBA.isRGBA(e)&&(n=i(e,t,r)),n}}(e.ColorUtils||(e.ColorUtils={}));const u=new o.LRUCache(500)},7259:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MapEnv=e.Env=void 0;class i{static isEnv(t){return t instanceof i}lookup(t){}unmap(){return{}}}e.Env=i,e.MapEnv=class extends i{constructor(t,e){super(),this.entries=t,this.parent=e}lookup(t){if(this.entries.hasOwnProperty(t)){const e=this.entries[t];
2if(void 0!==e)return e}return this.parent?this.parent.lookup(t):void 0}unmap(){const t=this.parent?this.parent.unmap():{};for(const e in this.entries)this.entries.hasOwnProperty(e)&&(t[e]=this.entries[e]);return t}}},8284:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.evaluateJsonExpr=void 0;const r=i(7259),n=i(8023);e.evaluateJsonExpr=function(t,e,i){return n.Expr.fromJSON(t,i).evaluate(new r.MapEnv(e),n.ExprScope.Value)}},8023:function(t,e,i){var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),e.InterpolateExpr=e.StepExpr=e.CaseExpr=e.MatchExpr=e.LookupExpr=e.CallExpr=e.HasAttributeExpr=e.ObjectLiteralExpr=e.StringLiteralExpr=e.NumberLiteralExpr=e.BooleanLiteralExpr=e.NullLiteralExpr=e.LiteralExpr=e.VarExpr=e.Expr=e.ExprScope=e.ExprDependencies=void 0;const o=i(5448),s=i(6815),a=i(6577),l=i(2302),c=i(908),h=i(8628),u=i(1017),p=i(1324),d=i(7610),m=i(5771);n(i(7259),e);const f=new l.ExprEvaluator,g=new c.ExprInstantiator;class y{constructor(){this.properties=new Set}}e.ExprDependencies=y;class v{static of(t){const e=new y;return t.accept(this.instance,e),e}visitNullLiteralExpr(t,e){}visitBooleanLiteralExpr(t,e){}visitNumberLiteralExpr(t,e){}visitStringLiteralExpr(t,e){}visitObjectLiteralExpr(t,e){}visitVarExpr(t,e){e.properties.add(t.name)}visitHasAttributeExpr(t,e){e.properties.add(t.name)}visitCallExpr(t,e){switch(t.args.forEach(t=>t.accept(this,e)),t.op){case"dynamic-properties":e.volatile=!0;break;case"feature-state":e.featureState=!0,e.properties.add("$state"),e.properties.add("$id");break;case"id":e.properties.add("$id");break;case"zoom":case"world-ppi-scale":case"world-discrete-ppi-scale":e.properties.add("$zoom");break;case"pixel-world-scale":e.properties.add("$pixelToMeters");break;case"geometry-type":e.properties.add("$geometryType")}}visitLookupExpr(t,e){return this.visitCallExpr(t,e)}visitMatchExpr(t,e){t.value.accept(this,e),t.branches.forEach(([t,i])=>i.accept(this,e)),t.fallback.accept(this,e)}visitCaseExpr(t,e){t.branches.forEach(([t,i])=>{t.accept(this,e),i.accept(this,e)}),t.fallback.accept(this,e)}visitStepExpr(t,e){t.input.accept(this,e),t.defaultValue.accept(this,e),t.stops.forEach(([t,i])=>i.accept(this,e))}visitInterpolateExpr(t,e){t.input.accept(this,e),t.stops.forEach(([t,i])=>i.accept(this,e))}}var _;v.instance=new v,function(t){t[t.Value=0]="Value",t[t.Condition=1]="Condition",t[t.Dynamic=2]="Dynamic"}(_=e.ExprScope||(e.ExprScope={}));class b{static isExpr(t){return t instanceof b}static fromJSON(t,e,i,r){return N(t,void 0!==e?{definitions:e,lockedNames:new Set,cache:null!=i?i:new Map,referencedDefinitions:null!=r?r:new Set}:void 0)}evaluate(t,e=_.Value,i){return this.accept(f,new l.ExprEvaluatorContext(f,t,e,i))}instantiate(t){return this.accept(g,t)}dependencies(){return this.m_dependencies||(this.m_dependencies=v.of(this)),this.m_dependencies}intern(t){return t.add(this)}toJSON(){return(new k).serialize(this)}isDynamic(){return void 0===this.m_isDynamic&&(this.m_isDynamic=this.exprIsDynamic()),this.m_isDynamic}getPoolKey(t=!1){return"E"}}e.Expr=b;class x extends b{constructor(t){super(),this.name=t}accept(t,e){return t.visitVarExpr(this,e)}exprIsDynamic(){return!1}getPoolKey(){return this.name}}e.VarExpr=x;class w extends b{static fromValue(t,e){switch(typeof t){case"boolean":return new T(t);case"number":return new E(t);case"string":return new M(t);case"object":return null===t?S.instance:new A(t,e);default:throw new Error(`failed to create a literal from '${t}'`)}}exprIsDynamic(){return!1}}e.LiteralExpr=w;class S extends w{constructor(){super(),this.value=null}accept(t,e){return t.visitNullLiteralExpr(this,e)}exprIsDynamic(){return!1}getPoolKey(){return"N"}}e.NullLiteralExpr=S,S.instance=new S;class T extends w{constructor(t){super(),this.value=t}accept(t,e){return t.visitBooleanLiteralExpr(this,e)}getPoolKey(){return"B"}}e.BooleanLiteralExpr=T,T.trueInstance=new T(!0),T.falseInstance=new T(!1);class E extends w{constructor(t){super(),this.value=t}accept(t,e){return t.visitNumberLiteralExpr(this,e)}getPoolKey(){return this.value}}e.NumberLiteralExpr=E;class M extends w{constructor(t){super(),this.value=t}get promotedValue(){var t,e,i;return void 0===this.m_promotedValue&&(this.m_promotedValue=null!==(e=null!==(t=d.RGBA.parse(this.value))&&void 0!==t?t:p.Pixels.parse(this.value))&&void 0!==e?e:null),null!==(i=this.m_promotedValue)&&void 0!==i?i:void 0}accept(t,e){return t.visitStringLiteralExpr(this,e)}getPoolKey(){return this.value.length}}e.StringLiteralExpr=M;class A extends w{constructor(t,e){super(),this.value=t,this.id=e}get isArrayLiteral(){return Array.isArray(this.value)}accept(t,e){return t.visitObjectLiteralExpr(this,e)}static get nextID(){return this.m_nextID++}}e.ObjectLiteralExpr=A,A.m_nextID=0;class C extends b{constructor(t){super(),this.name=t}accept(t,e){return t.visitHasAttributeExpr(this,e)}exprIsDynamic(){return!1}getPoolKey(){return this.name}}e.HasAttributeExpr=C;class P extends b{constructor(t,e){super(),this.op=t,this.args=e}get children(){return this.args}accept(t,e){return t.visitCallExpr(this,e)}exprIsDynamic(){var t,e;const i=null!==(t=this.descriptor)&&void 0!==t?t:l.ExprEvaluator.getOperator(this.op);return!!(null===(e=null==i?void 0:i.isDynamicOperator)||void 0===e?void 0:e.call(i,this))||this.args.some(t=>t.isDynamic())}getPoolKey(t=!1){return t?this.args[0].getPoolKey():this.op}}e.CallExpr=P;class L extends P{static parseArray(t,e){const i=t[1];if(void 0===i)throw new Error("missing lookup table in 'lookup' expression");const r=N(i,e);if(!(Array.isArray(i)&&r instanceof A))throw new Error("Invalid lookup table expression for operator 'lookup'. It must be a literal or a ref to one.");const n=r.value;if(!(Array.isArray(n)||n instanceof Map))throw new Error(`Invalid lookup table type (${typeof n}) for operator 'lookup'`);const o=t.slice(2).map(t=>N(t,e));return o.unshift(r),new L(o)}constructor(t){super("lookup",t),this.args=t}accept(t,e){return t.visitLookupExpr(this,e)}}e.LookupExpr=L;class R extends b{static isValidMatchLabel(t){switch(typeof t){case"number":case"string":return!0;case"object":if(!Array.isArray(t)||0===t.length)return!1;const e=typeof t[0];return("number"===e||"string"===e)&&t.every(t=>typeof t===e);default:return!1}}constructor(t,e,i){super(),this.value=t,this.branches=e,this.fallback=i}accept(t,e){return t.visitMatchExpr(this,e)}exprIsDynamic(){return this.value.isDynamic()||this.branches.some(([t,e])=>e.isDynamic())||this.fallback.isDynamic()}getPoolKey(){return this.fallback.getPoolKey()}}e.MatchExpr=R;class I extends b{constructor(t,e){super(),this.branches=t,this.fallback=e}accept(t,e){return t.visitCaseExpr(this,e)}exprIsDynamic(){return this.branches.some(([t,e])=>t.isDynamic()||e.isDynamic())||this.fallback.isDynamic()}getPoolKey(t=!1){return t?this.fallback.getPoolKey():this.branches.length}}e.CaseExpr=I;class O extends b{constructor(t,e,i){super(),this.input=t,this.defaultValue=e,this.stops=i}accept(t,e){return t.visitStepExpr(this,e)}exprIsDynamic(){return this.input.isDynamic()||this.defaultValue.isDynamic()||this.stops.some(([t,e])=>e.isDynamic())}getPoolKey(t=!1){return t?this.defaultValue.getPoolKey():this.stops.length}}e.StepExpr=O;class D extends b{constructor(t,e,i){super(),this.mode=t,this.input=e,this.stops=i}accept(t,e){return t.visitInterpolateExpr(this,e)}exprIsDynamic(){return this.input.isDynamic()||this.stops.some(([t,e])=>e.isDynamic())}getPoolKey(t=!1){return t?this.stops[0][0]:this.stops.length}}e.InterpolateExpr=D;class k{serialize(t){return t.accept(this,void 0)}visitNullLiteralExpr(t,e){return null}visitBooleanLiteralExpr(t,e){return t.value}visitNumberLiteralExpr(t,e){return t.value}visitStringLiteralExpr(t,e){return t.value}visitObjectLiteralExpr(t,e){if(t.value instanceof o.Vector2)return["make-vector",t.value.x,t.value.y];if(t.value instanceof s.Vector3)return["make-vector",t.value.x,t.value.y,t.value.z];if(t.value instanceof a.Vector4)return["make-vector",t.value.x,t.value.y,t.value.z,t.value.w];const i=["literal",t.value];return void 0!==t.id&&(i[2]=t.id),i}visitVarExpr(t,e){return["get",t.name]}visitHasAttributeExpr(t,e){return["has",t.name]}visitCallExpr(t,e){return[t.op,...t.args.map(t=>this.serialize(t))]}visitLookupExpr(t,e){return this.visitCallExpr(t,e)}visitMatchExpr(t,e){const i=[];for(const[e,r]of t.branches)i.push(e,this.serialize(r));return["match",this.serialize(t.value),...i,this.serialize(t.fallback)]}visitCaseExpr(t,e){const i=[];for(const[e,r]of t.branches)i.push(this.serialize(e),this.serialize(r));return["case",...i,this.serialize(t.fallback)]}visitStepExpr(t,e){const i=["step"];return i.push(this.serialize(t.input)),i.push(this.serialize(t.defaultValue)),t.stops.forEach(([t,e])=>{i.push(t),i.push(this.serialize(e))}),i}visitInterpolateExpr(t,e){const i=["interpolate",t.mode];return i.push(this.serialize(t.input)),t.stops.forEach(([t,e])=>{i.push(t),i.push(this.serialize(e))}),i}}function N(t,e){if(Array.isArray(t))return F(t,e);if(null===t)return S.instance;switch(typeof t){case"number":return new E(t);case"string":return new M(t);case"boolean":return new T(t);default:if(d.RGBA.isRGBA(t))return new A(t);throw new Error(`failed to create expression from: ${JSON.stringify(t)}`)}}function F(t,e){const i=t[0];if("string"!=typeof i)throw new Error("expected a builtin function name");switch(i){case"!has":case"!in":return new P("!",[F([i.slice(1),...t.slice(1)])]);case"ref":return function(t,e){if("string"!=typeof t[1])throw new Error("expected the name of an attribute");
2if(void 0===e)throw new Error("ref used with no definitions");const i=t[1];if(e.lockedNames.has(i))throw new Error(`circular reference to '${i}'`);if(!(i in e.definitions))throw new Error(`definition '${i}' not found`);e.referencedDefinitions.add(i);const r=e.cache.get(i);if(void 0!==r)return r;let n,o=e.definitions[i];const s=(0,m.getDefinitionValue)(o);if((0,h.isInterpolatedPropertyDefinition)(s))return b.fromJSON((0,h.interpolatedPropertyDefinitionToJsonExpr)(o));if(!(0,u.isJsonExpr)(s))return b.fromJSON(s);if(o=s,!(0,u.isJsonExpr)(o))throw new Error(`unsupported definition ${i}`);e.lockedNames.add(i);try{n=N(o,e)}finally{e.lockedNames.delete(i)}return e.cache.set(i,n),n.isCached=!0,n}(t,e);case"get":return function(t,e){if(void 0!==t[2])return U("get",t,e);const i=t[1];if("string"!=typeof i)throw new Error("expected the name of an attribute");return new x(i)}(t,e);case"has":return function(t,e){if(void 0!==t[2])return U("has",t,e);const i=t[1];if("string"!=typeof i)throw new Error("expected the name of an attribute");return new C(i)}(t,e);case"literal":return function(t){const e=t[1];if(null===e||"object"!=typeof e)throw new Error("expected an object or array literal");const i=t[2];return new A(e,i)}(t);case"match":return function(t,e){if(t.length<4)throw new Error("not enough arguments");if(!(t.length%2))throw new Error("fallback is missing in 'match' expression");const i=N(t[1],e),r=[];for(let i=2;i<t.length-1;i+=2){const n=t[i];if(!R.isValidMatchLabel(n))throw new Error(`'${JSON.stringify(n)}' is not a valid label for 'match'`);const o=N(t[i+1],e);r.push([n,o])}const n=N(t[t.length-1],e);return new R(i,r,n)}(t,e);case"case":return function(t,e){if(t.length<3)throw new Error("not enough arguments");if(t.length%2)throw new Error("fallback is missing in 'case' expression");const i=[];for(let r=1;r<t.length-1;r+=2){const n=N(t[r],e),o=N(t[r+1],e);i.push([n,o])}const r=N(t[t.length-1],e);return new I(i,r)}(t,e);case"interpolate":return function(t,e){const i=t[1];if(!function(t){if(!Array.isArray(t))return!1;switch(t[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 r=void 0!==t[2]?N(t[2],e):void 0;if(!b.isExpr(r))throw new Error("expected the input of the interpolation");if(3===t.length||!(t.length%2))throw new Error("invalid number of samples");const n=[];for(let i=3;i<t.length-1;i+=2){const r=t[i],o=N(t[i+1],e);n.push([r,o])}return new D(i,r,n)}(t,e);case"step":return function(t,e){if(t.length<2)throw new Error("expected the input of the 'step' operator");if(t.length<3||!(t.length%2))throw new Error("not enough arguments");const i=N(t[1],e),r=N(t[2],e),n=[];for(let i=3;i<t.length;i+=2){const r=t[i],o=N(t[i+1],e);n.push([r,o])}return new O(i,r,n)}(t,e);case"lookup":return L.parseArray(t,e);default:return U(i,t,e)}}function U(t,e,i){return new P(t,e.slice(1).map(t=>N(t,i)))}},2302:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ExprEvaluator=e.ExprEvaluatorContext=void 0;const r=i(5971),n=i(3334),o=i(5448),s=i(6815),a=i(6577),l=i(8023),c=i(6073),h=i(7290),u=i(4672),p=i(8998),d=i(1954),m=i(2181),f=i(202),g=i(4054),y=i(9764),v=i(7029),_=i(3501),b=i(5113),x=i(545),w=i(1324),S=i(7610),T=new Map;function E(t,e){var i,r,n;if(e instanceof l.StringLiteralExpr)return null!==(i=e.promotedValue)&&void 0!==i?i:e.value;const o=t.evaluate(e);return"string"==typeof o&&null!==(n=null!==(r=S.RGBA.parse(o))&&void 0!==r?r:w.Pixels.parse(o))&&void 0!==n?n:o}e.ExprEvaluatorContext=class{constructor(t,e,i,r){this.evaluator=t,this.env=e,this.scope=i,this.cache=r}evaluate(t){var e,i;if(void 0===t)throw new Error("Failed to evaluate expression");const r=null===(e=this.cache)||void 0===e?void 0:e.get(t);if(void 0!==r)return r;const n=t.accept(this.evaluator,this);return null===(i=this.cache)||void 0===i||i.set(t,n),n}wrapValue(t,e){return l.Expr.isExpr(t)?t:l.LiteralExpr.fromValue(t,e)}};
2class M{static defineOperator(t,e){T.set(t,e)}static defineOperators(t){Object.getOwnPropertyNames(t).forEach(e=>{this.defineOperator(e,t[e])})}static getOperator(t){return T.get(t)}visitVarExpr(t,e){const i=e.env.lookup(t.name);return void 0!==i?i:null}visitNullLiteralExpr(t,e){return null}visitBooleanLiteralExpr(t,e){return t.value}visitNumberLiteralExpr(t,e){return t.value}visitStringLiteralExpr(t,e){return t.value}visitObjectLiteralExpr(t,e){return t.value}visitHasAttributeExpr(t,e){return void 0!==e.env.lookup(t.name)}visitMatchExpr(t,e){const i=e.evaluate(t.value);for(const[r,n]of t.branches){if(Array.isArray(r)&&r.includes(i))return e.evaluate(n);if(r===i)return e.evaluate(n)}return e.evaluate(t.fallback)}visitCaseExpr(t,e){if(e.scope===l.ExprScope.Value){const i=t.branches.findIndex(([t,e])=>t.isDynamic());if(-1!==i){let r;for(let n=0;n<t.branches.length;++n){const[o,s]=t.branches[n],a=e.evaluate(o),c=e.evaluate(s);if(n<i&&Boolean(a))return c;if((l.Expr.isExpr(a)||Boolean(a))&&(void 0===r&&(r=[]),null==r||r.push([e.wrapValue(a),e.wrapValue(c)]),!l.Expr.isExpr(a)&&Boolean(a)))return new l.CaseExpr(r,l.LiteralExpr.fromValue(null))}const n=e.evaluate(t.fallback);return void 0===r?n:new l.CaseExpr(r,e.wrapValue(n))}}for(const[i,r]of t.branches)if(e.evaluate(i))return e.evaluate(r);return e.evaluate(t.fallback)}visitCallExpr(t,e){var i;const r=null!==(i=t.descriptor)&&void 0!==i?i:T.get(t.op);if(r){let i;if(t.descriptor=r,e.scope===l.ExprScope.Value&&t.isDynamic()){if(t.descriptor.partialEvaluate)return t.descriptor.partialEvaluate(e,t);const r=t.args.map(t=>e.wrapValue(e.evaluate(t),t.id));if(r.every((e,i)=>e===t.args[i]))return t;i=new l.CallExpr(t.op,r)}else i=r.call(e,t);return i}throw new Error(`undefined operator '${t.op}'`)}visitLookupExpr(t,e){return this.visitCallExpr(t,e)}visitStepExpr(t,e){if(e.scope===l.ExprScope.Value){const i=e.evaluate(t.input),r=e.evaluate(t.defaultValue);
2return new l.StepExpr(e.wrapValue(i),e.wrapValue(r),t.stops.map(([t,i])=>{const r=e.evaluate(i);return[t,e.wrapValue(r)]}))}{const i=e.evaluate(t.input);if("number"!=typeof i)throw new Error(`input '${i}' must be a number`);if(i<t.stops[0][0])return e.evaluate(t.defaultValue);let r=t.stops.findIndex(t=>t[0]>i);return-1===r&&(r=t.stops.length),e.evaluate(t.stops[r-1][1])}}visitInterpolateExpr(t,e){if(e.scope===l.ExprScope.Value){const i=e.evaluate(t.input);return new l.InterpolateExpr(t.mode,e.wrapValue(i),t.stops.map(([t,i])=>{const r=e.evaluate(i);return[t,e.wrapValue(r)]}))}{const i=e.evaluate(t.input);if("number"!=typeof i)throw new Error("input must be a number");if("cubic"===t.mode[0])return function(t,e,i){if(i<e.stops[0][0])return E(t,e.stops[0][1]);if(i>=e.stops[e.stops.length-1][0])return E(t,e.stops[e.stops.length-1][1]);const l=e.stops.findIndex(t=>t[0]>i),c=Math.max(0,l-1),h=0===c?l:c-1,u=l<e.stops.length-1?l+1:l-1,p=e.stops[h][0],d=e.stops[c][0],m=e.stops[l][0],f=.5*(m-d),g=f/(d-p),y=f/(e.stops[u][0]-m),v=(i-d)/(m-d),_=v*v,b=_*v,x=-g*b+2*g*_-g*v,T=(1+g)*b+(-1.5-2*g)*_+(-.5+g)*v+1,M=(-1-y)*b+(1.5+y)*_+.5*v,A=y*b-y*_,C=E(t,e.stops[h][1]),P=E(t,e.stops[c][1]),L=E(t,e.stops[l][1]),R=E(t,e.stops[u][1]);if("number"==typeof C&&"number"==typeof P&&"number"==typeof L&&"number"==typeof R)return x*C+T*P+M*L+A*R;if(C instanceof S.RGBA&&P instanceof S.RGBA&&L instanceof S.RGBA&&R instanceof S.RGBA)return new S.RGBA((0,n.clamp)(x*C.r+T*P.r+M*L.r+A*R.r,0,1),(0,n.clamp)(x*C.g+T*P.g+M*L.g+A*R.g,0,1),(0,n.clamp)(x*C.b+T*P.b+M*L.b+A*R.b,0,1),(0,n.clamp)(x*C.a+T*P.a+M*L.a+A*R.a,0,1));if(C instanceof w.Pixels&&P instanceof w.Pixels&&L instanceof w.Pixels&&R instanceof w.Pixels)return new w.Pixels(x*C.value+T*P.value+M*L.value+A*R.value);if(C instanceof r.Color&&P instanceof r.Color&&L instanceof r.Color&&R instanceof r.Color)return new r.Color(x*C.r+T*P.r+M*L.r+A*R.r,x*C.g+T*P.g+M*L.g+A*R.g,x*C.b+T*P.b+M*L.b+A*R.b);if(C instanceof o.Vector2&&P instanceof o.Vector2&&L instanceof o.Vector2&&R instanceof o.Vector2)return new o.Vector2(x*C.x+T*P.x+M*L.x+A*R.x,x*C.y+T*P.y+M*L.y+A*R.y);if(C instanceof s.Vector3&&P instanceof s.Vector3&&L instanceof s.Vector3&&R instanceof s.Vector3)return new s.Vector3(x*C.x+T*P.x+M*L.x+A*R.x,x*C.y+T*P.y+M*L.y+A*R.y,x*C.z+T*P.z+M*L.z+A*R.z);if(C instanceof a.Vector4&&P instanceof a.Vector4&&L instanceof a.Vector4&&R instanceof a.Vector4)return new a.Vector4(x*C.x+T*P.x+M*L.x+A*R.x,x*C.y+T*P.y+M*L.y+A*R.y,x*C.z+T*P.z+M*L.z+A*R.z,x*C.w+T*P.w+M*L.w+A*R.w);if(Array.isArray(C)&&Array.isArray(P)&&Array.isArray(L)&&Array.isArray(R)){const t=C.length,e=[];for(let i=0;i<t;++i)e[i]=x*C[i]+T*P[i]+M*L[i]+A*R[i];return e}throw new Error("failed to interpolate values")}(e,t,i);const l=t.stops.findIndex(t=>t[0]>i);if(-1===l)return e.evaluate(t.stops[t.stops.length-1][1]);if(0===l)return e.evaluate(t.stops[0][1]);const[c,h]=t.stops[l],[u,p]=t.stops[l-1],d=E(e,p);let m=0;switch(t.mode[0]){case"discrete":return d;case"linear":m=(i-u)/(c-u);break;case"exponential":{const e=t.mode[1];m=1===e?(i-u)/(c-u):(Math.pow(e,i-u)-1)/(Math.pow(e,c-u)-1);break}default:throw new Error(`interpolation mode ${JSON.stringify(t.mode)} is not supported`)}const f=E(e,h);if("number"==typeof d&&"number"==typeof f)return(0,n.lerp)(d,f,m);if(d instanceof S.RGBA&&f instanceof S.RGBA)return d.clone().lerp(f,m);if(d instanceof w.Pixels&&f instanceof w.Pixels)return new w.Pixels((0,n.lerp)(d.value,f.value,m));if(d instanceof r.Color&&f instanceof r.Color)return d.clone().lerp(f,m);if(d instanceof o.Vector2&&f instanceof o.Vector2)return d.clone().lerp(f,m);if(d instanceof s.Vector3&&f instanceof s.Vector3)return d.clone().lerp(f,m);if(d instanceof a.Vector4&&f instanceof a.Vector4)return d.clone().lerp(f,m);if(Array.isArray(d)&&Array.isArray(f)&&d.length===f.length)return d.map((t,e)=>(0,n.lerp)(t,f[e],m));throw new Error(`todo: mix(${JSON.stringify(d)}, ${JSON.stringify(f)}, ${m})`)}}}e.ExprEvaluator=M,M.defineOperators(h.CastOperators),M.defineOperators(p.ComparisonOperators),M.defineOperators(g.MathOperators),M.defineOperators(_.StringOperators),M.defineOperators(u.ColorOperators),M.defineOperators(b.TypeOperators),M.defineOperators(y.MiscOperators),M.defineOperators(m.FlowOperators),M.defineOperators(c.ArrayOperators),M.defineOperators(v.ObjectOperators),M.defineOperators(d.FeatureOperators),M.defineOperators(f.MapOperators),M.defineOperators(x.VectorOperators)},908:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.ExprInstantiator=void 0;const r=i(7259),n=i(8023),o=new r.Env;e.ExprInstantiator=class{visitNullLiteralExpr(t,e){return t}visitBooleanLiteralExpr(t,e){return t}visitNumberLiteralExpr(t,e){return t}visitStringLiteralExpr(t,e){return t}visitObjectLiteralExpr(t,e){return t}visitVarExpr(t,e){if(e.preserve&&e.preserve.has(t.name))return t;const i=e.env.lookup(t.name);return n.LiteralExpr.fromValue(void 0!==i?i:null)}visitHasAttributeExpr(t,e){if(e.preserve&&e.preserve.has(t.name))return t;const i=void 0!==e.env.lookup(t.name);return n.LiteralExpr.fromValue(i)}visitCallExprImpl(t,e,i){const r=t.args.map(t=>t.accept(this,e));return r.some((e,i)=>e!==t.args[i])?i(t.op,r):t}visitCallExpr(t,e){return this.visitCallExprImpl(t,e,(t,e)=>new n.CallExpr(t,e))}visitLookupExpr(t,e){return this.visitCallExprImpl(t,e,(t,e)=>new n.LookupExpr(e))}visitMatchExpr(t,e){const i=t.value.accept(this,e);if(i instanceof n.LiteralExpr){const r=i.value;for(const[i,n]of t.branches){if(Array.isArray(i)&&i.includes(r))return n.accept(this,e);if(i===r)return n.accept(this,e)}return t.fallback.accept(this,e)}let r=t.value!==i;const o=t.branches.map(([t,i])=>{const n=i.accept(this,e);return n!==i&&(r=!0),[t,n]}),s=t.fallback.accept(this,e);return s!==t.fallback&&(r=!0),r?new n.MatchExpr(i,o,s):t}visitCaseExpr(t,e){const i=[];let r=!1;for(const[s,a]of t.branches){const t=s.accept(this,e),l=t.dependencies();if(s.isDynamic()||0!==l.properties.size)t!==s&&(r=!0),i.push([t,a]);else if(Boolean(t.evaluate(o,n.ExprScope.Condition)))return a.accept(this,e)}if(0===i.length)return t.fallback.accept(this,e);i.length!==t.branches.length&&(r=!0),i.forEach(t=>{const i=t[1].accept(this,e);i!==t[1]&&(r=!0),t[1]=i});const s=t.fallback.accept(this,e);return s!==t.fallback&&(r=!0),r?new n.CaseExpr(i,s):t}visitStepExpr(t,e){const i=t.input.accept(this,e),r=t.defaultValue.accept(this,e),o=t.stops.map(([t,i])=>[t,i.accept(this,e)]);return new n.StepExpr(i,r,o)}visitInterpolateExpr(t,e){const i=t.input.accept(this,e),r=t.stops.map(([t,i])=>[t,i.accept(this,e)]);return new n.InterpolateExpr(t.mode,i,r)}}},8797:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ExprPool=e.INTERNED=void 0;const r=i(797),n=i(8023);var o;!function(t){t[t.CALL=0]="CALL",t[t.LOOKUP=1]="LOOKUP"}(o||(o={})),e.INTERNED=Symbol("i");const s=(t,e=!1)=>{var i,r,n,o;let a;return a=t instanceof Object?Array.isArray(t)?s(null!==(i=t[1])&&void 0!==i?i:t[0],e):null!==(o=null!==(n=null===(r=null==t?void 0:t.getPoolKey)||void 0===r?void 0:r.call(t,e))&&void 0!==n?n:null==t?void 0:t.constructor.name.substring(0,3))&&void 0!==o?o:"?":"number"==typeof t?t:String(t).substring(0,3),a};e.ExprPool=class{constructor(){this.m_numberLiterals=new Map,this.m_stringLiterals=new Map,this.m_objectLiteralsByID=new Map,this.m_objectLiterals=[],this.m_arrayLiterals=[],this.m_varExprs=new Map,this.m_hasAttributeExprs=new Map,this.m_matchExprs=[],this.m_caseExprs=new Map,this.m_interpolateExprs=new Map,this.m_stepExprs=[],this.m_callExprs=new Map,this.m_arrays=new Map,this.m_objects=new Map}add(t){return t.accept(this,void 0)}clear(){this.m_numberLiterals.clear(),this.m_stringLiterals.clear(),this.m_objectLiteralsByID.clear(),this.m_objectLiterals.length=0,this.m_arrayLiterals.length=0,this.m_varExprs.clear(),this.m_hasAttributeExprs.clear(),this.m_matchExprs.length=0,this.m_caseExprs.clear(),this.m_interpolateExprs.clear(),this.m_stepExprs.length=0,this.m_callExprs.clear(),this.m_arrays.clear(),this.m_objects.clear()}stats(){const t=new Map;t.set("m_numberLiterals",this.m_numberLiterals.size),t.set("m_stringLiterals",this.m_stringLiterals.size),t.set("m_objectLiteralsByID",this.m_objectLiteralsByID.size),t.set("m_objectLiterals",this.m_objectLiterals.length),t.set("m_arrayLiterals",this.m_arrayLiterals.length),t.set("m_varExprs",this.m_varExprs.size),t.set("m_hasAttributeExprs",this.m_varExprs.size),t.set("m_matchExprs",this.m_matchExprs.length),t.set("m_caseExprs",Array.from(this.m_caseExprs).reduce((t,e)=>Array.from(e[1]).reduce((t,e)=>t+e[1].length,t),0)),t.set("m_interpolateExprs",Array.from(this.m_interpolateExprs).reduce((t,e)=>t+e[1].length,0)),t.set("m_stepExprs",this.m_stepExprs.length),t.set("m_callExprs",Array.from(this.m_callExprs).reduce((t,e)=>Array.from(e[1]).reduce((t,e)=>t+e[1].length,t),0)),t.set("m_arrays",Array.from(this.m_arrays).reduce((t,e)=>Array.from(e[1]).reduce((t,e)=>Array.from(e[1]).reduce((t,e)=>t+e[1].length,t),t),0)),t.set("m_objects",Array.from(this.m_objects).reduce((t,e)=>Array.from(e[1]).reduce((t,e)=>Array.from(e[1]).reduce((t,e)=>t+e[1].length,t),t),0)),t.set("TOTAL interned",Array.from(t).reduce((t,e)=>t+e[1],0)),console.dir(t)}internValue(t,i){if(null==t?void 0:t[e.INTERNED])return t;let r;return r=Array.isArray(t)?this.internArray(t,i):t instanceof n.Expr?t.accept(this,i):null!==t&&t instanceof Object?this.internObject(t):t,r}internArray(t,i){if(t[e.INTERNED])return t;const r=this.m_arrays;let n=t.length,o=r.get(n);o||r.set(n,o=new Map);let a=s(t[0]),l=o.get(a);l||o.set(a,l=new Map);const c=a;a=n<2?s(t[0],!0):s(t[1]),a===c&&(a=s(t[0],!0));let h=l.get(a);h||l.set(a,h=[]);let u=0;for(const e of t)t[u++]=this.internValue(e);for(const e of h){for(u=n;u--&&e[u]===t[u];);if(u<0)return e}return h.push(t),t[e.INTERNED]=!0,t}internObject(t,i){var r,n;if(t[e.INTERNED])return t;const o=this.m_objects,s=Object.keys(t);let a=s.length,l=o.get(a);l||o.set(a,l=new Map),a=s[0];let c=l.get(a);c||l.set(a,c=new Map);let h=t[a];if(h instanceof Object)for(const t in h){h=h[t];break}a=h instanceof Object?null!==(n=null===(r=null==h?void 0:h.getPoolKey)||void 0===r?void 0:r.call(h))&&void 0!==n?n:h.constructor.name:h;let u=c.get(a);u||c.set(a,u=[]);for(const e of s)t[e]=this.internValue(t[e]);for(const e of u){let i=0;for(const r of s){if(e[r]!==t[r])break;i++}if(i===a)return e}return u.push(t),t[e.INTERNED]=!0,t}visitNullLiteralExpr(t,e){return n.NullLiteralExpr.instance}visitBooleanLiteralExpr(t,e){return t.value?n.BooleanLiteralExpr.trueInstance:n.BooleanLiteralExpr.falseInstance}visitNumberLiteralExpr(t,e){var i;const r=this.m_numberLiterals,n=t.value;return null!==(i=r.get(n))&&void 0!==i?i:(r.set(n,t),t)}visitStringLiteralExpr(t,e){var i;
2const r=this.m_stringLiterals,n=t.value;return null!==(i=r.get(n))&&void 0!==i?i:(r.set(n,t),t)}visitObjectLiteralExpr(t,e){let i;const o=t.id;if(void 0!==o){if(i=this.m_objectLiteralsByID.get(o),!i){const e=this.internValue(t.value);i=new n.ObjectLiteralExpr(e,o),this.m_objectLiteralsByID.set(o,i)}}else{(0,r.assert)(!1,"ObjectLiteralExpr without id");const e=t.isArrayLiteral?this.m_arrayLiterals:this.m_objectLiterals;if(e.includes(t))i=t;else{const r=this.internValue(t.value);for(const t of e)if(t.value===r){i=t;break}i||(i=new n.ObjectLiteralExpr(r),e.push(i))}}return i}visitVarExpr(t,e){var i;const r=this.m_varExprs,n=t.name;return null!==(i=r.get(n))&&void 0!==i?i:(r.set(n,t),t)}visitHasAttributeExpr(t,e){var i;const r=this.m_hasAttributeExprs,n=t.name;return null!==(i=r.get(n))&&void 0!==i?i:(r.set(n,t),t)}visitMatchExpr(t,e){const i=this.m_matchExprs;if(i.includes(t))return t;const r=t.value.accept(this,e),o=this.internArray(t.branches,e),s=t.fallback.accept(this,e);for(const t of i)if(t.value===r&&t.branches===o&&t.fallback===s)return t;const a=new n.MatchExpr(r,o,s);return i.push(a),a}visitCaseExpr(t,e){const i=this.m_caseExprs;let r=t.branches.length,o=i.get(r);o||i.set(r,o=new Map),r=t.branches[0][0].getPoolKey();let s=o.get(r);if(s){if(s.includes(t))return t}else o.set(r,s=[]);const a=this.internArray(t.branches),l=t.fallback.accept(this,e);for(const t of s)if(t.branches===a&&t.fallback===l)return t;const c=new n.CaseExpr(a,l);return s.push(c),c}visitCallExprImpl(t,e,i){if(t.isCached)return t;const r=this.m_callExprs;let a=t.op,l=r.get(a);l||r.set(a,l=new Map),a=s(t.args[0]);let c=l.get(a);c||l.set(a,c=[]);const h=this.internArray(t.args);for(const t of c)if(t.args===h)return t;const u=i===o.CALL?new n.CallExpr(t.op,h):new n.LookupExpr(h);return t.descriptor&&(u.descriptor=t.descriptor),c.push(u),u}visitCallExpr(t,e){return this.visitCallExprImpl(t,e,o.CALL)}visitLookupExpr(t,e){return this.visitCallExprImpl(t,e,o.LOOKUP)}visitStepExpr(t,e){const i=this.m_stepExprs;if(i.includes(t))return t;const r=t.input.accept(this,e),o=t.defaultValue.accept(this,e),s=this.internArray(t.stops);for(const t of i)if(t.input===r&&t.defaultValue===o&&t.stops===s)return t;const a=new n.StepExpr(r,o,s);return i.push(a),a}visitInterpolateExpr(t,e){const i=this.m_interpolateExprs,r=t.stops.length*(t.stops[0][0]+3);let o=i.get(r);if(o){if(o.includes(t))return t}else i.set(r,o=[]);const s=this.internArray(t.mode),a=t.input.accept(this,e),l=this.internArray(t.stops);for(const t of o)if(t.mode===s&&t.input===a&&t.stops===l)return t;const c=new n.InterpolateExpr(s,a,l);return o.push(c),c}}},8628:(t,e)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.interpolatedPropertyDefinitionToJsonExpr=e.isInterpolatedPropertyDefinition=e.InterpolationMode=void 0,(i=e.InterpolationMode||(e.InterpolationMode={}))[i.Discrete=0]="Discrete",i[i.Linear=1]="Linear",i[i.Cubic=2]="Cub
2ic",i[i.Exponential=3]="Exponential",e.isInterpolatedPropertyDefinition=function(t){return!!(t&&void 0===t.interpolationMode&&Array.isArray(t.values)&&t.values.length>0&&void 0!==t.values[0]&&Array.isArray(t.zoomLevels)&&t.zoomLevels.length>0&&void 0!==t.zoomLevels[0]&&t.values.length===t.zoomLevels.length)},e.interpolatedPropertyDefinitionToJsonExpr=function(t){if(void 0===t.interpolation||"Discrete"===t.interpolation){const e=["step",["zoom"],t.values[0]];for(let i=1;i<t.zoomLevels.length;++i)e.push(t.zoomLevels[i],t.values[i]);return e}const e=["interpolate"];switch(t.interpolation){case"Linear":e.push(["linear"]);break;case"Cubic":e.push(["cubic"]);break;case"Exponential":e.push(["exponential",void 0!==t.exponent?t.exponent:2]);break;default:throw new Error(`interpolation mode '${t.interpolation}' is not supported`)}e.push(["zoom"]);for(let i=0;i<t.zoomLevels.length;++i)e.push(t.zoomLevels[i],t.values[i]);return e}},1017:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isJsonExpr=void 0,e.isJsonExpr=function(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]}},1324:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Pixels=void 0;const i=/^((?=\.\d|\d)(?:\d+)?(?:\.?\d*))px$/;class r{static parse(t){const e=i.exec(t);if(null!==e)return new r(Number(e[1]))}constructor(t){this.value=t}toJSON(){return`${this.value}px`}}e.Pixels=r},7610:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RGBA=void 0;const r=i(3334),n=i(6577),o=i(1667),s=i(6331);class a{static parse(t){const e=(0,s.parseStringEncodedColor)(t);
2if(void 0!==e)return o.ColorUtils.getRgbaFromHex(e)}static isRGBA(t){return t instanceof a}constructor(t=1,e=1,i=1,r=1,n=!0){this.r=t,this.g=e,this.b=i,this.a=r,this.isRGBA=n}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}equals(t){return this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a}clone(){return new a(this.r,this.g,this.b,this.a)}fromVector(t){return this.r=t.x,this.g=t.y,this.b=t.z,this.a=t.w,this}toVector(t){return t||(t=new n.Vector4),t.set(this.r,this.g,this.b,this.a),t}fromHex(t){return o.ColorUtils.getRgbaFromHex(t,this),this}getHex(){return o.ColorUtils.getHexFromRgba(this.r,this.g,this.b,this.a)}lerp(t,e){return this.r=(0,r.lerp)(this.r,t.r,e),this.g=(0,r.lerp)(this.g,t.g,e),this.b=(0,r.lerp)(this.b,t.b,e),this.a=(0,r.lerp)(this.a,t.a,e),this}toJSON(){return`rgba(${255*this.r|0}, ${255*this.g|0}, ${255*this.b|0}, ${this.a})`}}e.RGBA=a},6331:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parseStringEncodedColor=e.parseStringEncodedNumeral=e.StringEncodedNumeralFormatMaxSize=e.StringEncodedNumeralFormats=e.StringEncodedColorFormats=e.StringEncodedMetricFormats=e.StringEncodedNumeralType=void 0;const r=i(6925),n=i(797),o=i(1667);var s;!function(t){t[t.Meters=0]="Meters",t[t.Pixels=1]="Pixels",t[t.Hex=2]="Hex"}(s=e.StringEncodedNumeralType||(e.StringEncodedNumeralType={}));const a={type:s.Meters,size:1,regExp:/^((?=\.\d|\d)(?:\d+)?(?:\.?\d*))m$/,decoder:(t,e)=>{const i=a.regExp.exec(t);return!!i&&void 0!==(e[0]=Number(i[1]))}},l={type:s.Pixels,size:1,mask:1,regExp:/^((?=\.\d|\d)(?:\d+)?(?:\.?\d*))px$/,decoder:(t,e)=>{const i=l.regExp.exec(t);return null!==i&&(e[0]=Number(i[1]),!0)}},c={type:s.Hex,size:4,regExp:/^\#((?:[0-9A-Fa-f][0-9A-Fa-f]){4}|[0-9A-Fa-f]{4})$/,decoder:(t,e)=>{const i=c.regExp.exec(t);if(null===i)return!1;const r=i[1],o=r.length;return(0,n.assert)(4===o||8===o,"Matched incorrect hex color format"),4===o?(e[0]=parseInt(r.charAt(0)+r.charAt(0),16)/255,e[1]=parseInt(r.charAt(1)+r.charAt(1),16)/255,e[2]=parseInt(r.charAt(2)+r.charAt(2),16)/255,e[3]=4===o?parseInt(r.charAt(3)+r.charAt(3),16)/255:1):8===o&&(e[0]=parseInt(r.charAt(0)+r.charAt(1),16)/255,e[1]=parseInt(r.charAt(2)+r.charAt(3),16)/255,e[2]=parseInt(r.charAt(4)+r.charAt(5),16)/255,e[3]=8===o?parseInt(r.charAt(6)+r.charAt(7),16)/255:1),!0}};e.StringEncodedMetricFormats=[a,l];const h=e.StringEncodedMetricFormats.reduce((t,e)=>Math.max(t,e.size),0);e.StringEncodedColorFormats=[c];const u=e.StringEncodedColorFormats.reduce((t,e)=>Math.max(t,e.size),0);e.StringEncodedNumeralFormats=[...e.StringEncodedMetricFormats,...e.StringEncodedColorFormats],e.StringEncodedNumeralFormatMaxSize=Math.max(u,h);const p=new Array(e.StringEncodedNumeralFormatMaxSize);function d(t,e,i=1){const n=e.find(e=>!!e.decoder(t,p));if(void 0===n){const e=(0,r.parseCSSColor)(t);return Array.isArray(e)&&!e.some(t=>isNaN(t))?o.ColorUtils.getHexFromRgba(e[0]/255,e[1]/255,e[2]/255,e[3]):void 0}switch(null==n?void 0:n.type){case s.Pixels:return p[0]*i;case s.Hex:return o.ColorUtils.getHexFromRgba(p[0],p[1],p[2],p[3]);default:return p[0]}}e.parseStringEncodedNumeral=function(t,i=1){return d(t,e.StringEncodedNumeralFormats,i)},e.parseStringEncodedColor=function(t){return d(t,e.StringEncodedColorFormats)}},1370:(t,e)=>{var i,r,n;Object.defineProperty(e,"__esModule",{value:!0}),e.isTextureBuffer=e.PlacementToken=e.transientToPickability=e.Pickability=e.TextureCoordinateType=void 0,(n=e.TextureCoordinateType||(e.TextureCoordinateType={})).TileSpace="tile-space",n.EquirectangularSpace="equirectangular-space",n.FeatureSpace="feature-space",function(t){t.onlyVisible="only-visible",t.transient="transient",t.all="all"}(i=e.Pickability||(e.Pickability={})),e.transientToPickability=function(t){let e=i.onlyVisible;return null!=t&&(e="string"==typeof t?t:!0===t?i.transient:i.onlyVisible),e},(r=e.PlacementToken||(e.PlacementToken={})).TopLeft="TL",r.Top="T",r.TopRight="TR",r.Right="R",r.BottomRight="BR",r.Bottom="B",r.BottomLeft="BL",r.Left="L",r.Center="C",r.NorthWest="NW",r.North="N",r.NorthEast="NE",r.East="E",r.SouthEast="SE",r.South="S",r.SouthWest="SW",r.West="W",e.isTextureBuffer=function(t){return t&&t.buffer&&"string"==typeof t.type}}
2,1216:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.setTechniqueRenderOrderOrPriority=e.addBuffersToTransferList=e.textureCoordinateType=e.supportsTextures=e.needsVertexNormals=e.isLabelRejectionLineTechnique=e.isTextTechnique=e.isTerrainTechnique=e.isStandardTechnique=e.isExtrudedPolygonTechnique=e.isPolygonTechnique=e.isStandardExtrudedLineTechnique=e.isBasicExtrudedLineTechnique=e.isExtrudedLineTechnique=e.isSegmentsTechnique=e.isSpecialDashesLineTechnique=e.isRasterTechnique=e.isSolidLineTechnique=e.isLineTechnique=e.isLineMarkerTechnique=e.isIconTextTechnique=e.isSquaresTechnique=e.isCirclesTechnique=e.TRANSPARENCY_PROPERTY_KEYS=e.TEXTURE_PROPERTY_KEYS=void 0;const r=i(1370);function n(t){return"labeled-icon"===t.name}function o(t){return"line-marker"===t.name}function s(t){return"solid-line"===t.name||"dashed-line"===t.name}function a(t){return"extruded-line"===t.name}function l(t){return a(t)&&"standard"===t.shading}function c(t){return"polygon"===t.name}function h(t){return"extruded-polygon"===t.name}function u(t){return"standard"===t.name}function p(t){return"terrain"===t.name}function d(t){return"text"===t.name}function m(t){return c(t)||u(t)||h(t)||p(t)||s(t)}e.TEXTURE_PROPERTY_KEYS=["map","normalMap","displacementMap","roughnessMap","emissiveMap","alphaMap","metalnessMap","bumpMap","dash-image"],e.TRANSPARENCY_PROPERTY_KEYS=["opacity","transparent"],e.isCirclesTechnique=function(t){return"circles"===t.name},e.isSquaresTechnique=function(t){return"squares"===t.name},e.isIconTextTechnique=n,e.isLineMarkerTechnique=o,e.isLineTechnique=function(t){return"line"===t.name},e.isSolidLineTechnique=s,e.isRasterTechnique=function(t){return"raster"===t.name},e.isSpecialDashesLineTechnique=function(t){return("solid-line"===t.name||"dashed-line"===t.name)&&void 0!==t.dashes&&"Square"!==t.dashes},e.isSegmentsTechnique=function(t){return"segments"===t.name},e.isExtrudedLineTechnique=a,e.isBasicExtrudedLineTechnique=function(t){return a(t)&&"basic"===t.shading},e.isStandardExtrudedLineTechnique=l,e.isPolygonTechnique=c,e.isExtrudedPolygonTechnique=h,e.isStandardTechnique=u,e.isTerrainTechnique=p,e.isTextTechnique=d,e.isLabelRejectionLineTechnique=function(t){return"label-rejection-line"===t.name},e.needsVertexNormals=function(t){return h(t)||c(t)||u(t)||p(t)||l(t)},e.supportsTextures=m,e.textureCoordinateType=function(t){return m(t)?t.textureCoordinateType:void 0},e.addBuffersToTransferList=function(t,i){if(u(t)||h(t)||p(t))for(const n of e.TEXTURE_PROPERTY_KEYS){const e=t[n];(0,r.isTextureBuffer)(e)&&e.buffer instanceof ArrayBuffer&&i.push(e.buffer)}},e.setTechniqueRenderOrderOrPriority=function(t,e,i){if(d(t)||n(t)||o(t)){if(i&&"string"==typeof t._category){const e=i.indexOf(t._category);-1!==e&&(t.priority=i.length-e)}}else if(e&&void 0!==t._layer){const i=i=>{const r=null==e?void 0:e.findIndex(e=>e.layer===t._layer&&e.category===i);return void 0!==r&&-1!==r?10*(r+1):void 0};if("string"==typeof t._category){const e=i(t._category);void 0!==e&&(t.renderOrder=e)}}}},5771:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isConditionalExtendsEntry=e.isDirectionalLight=e.isAmbientLight=e.getStyles=e.isStylesDictionary=e.isJsonExprReference=e.getDefinitionValue=e.isVerboseDefinition=void 0;const r=i(1017);function n(t){return void 0!==(null==t?void 0:t.value)}function o(t){return void 0!==t&&!Array.isArray(t)}e.isVerboseDefinition=n,e.getDefinitionValue=function(t){return n(t)?t.value:t},e.isJsonExprReference=function(t){return Array.isArray(t)&&2===t.length&&"ref"===t[0]&&"string"==typeof t[1]},e.isStylesDictionary=o,e.getStyles=function(t){return void 0===t?[]:o(t)?function(t){const e=[];for(const i in t)t[i].forEach(t=>{void 0===t.layer&&(t.layer=i),e.push(t)});return e}(t):t},e.isAmbientLight=function(t){return"ambient"===t.type},e.isDirectionalLight=function(t){return"directional"===t.type},e.isConditionalExtendsEntry=function(t){return void 0!==t&&(0,r.isJsonExpr)(t.when)&&/^(object|string)$/.test(typeof t.value)}},8131:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ThemeVisitor=void 0;const r=i(1017),n=i(5771);e.ThemeVisitor=class{constructor(t){this.theme=t}visitStyles(t){const e=e=>!(0,r.isJsonExpr)(e)&&!!t(e);if(void 0!==this.theme.styles)for(const t of(0,n.getStyles)(this.theme.styles))if(e(t))return!0;return!1}}},797:(t,e)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.assert=void 0,e.assert=function(t,e){}},6304:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getPropertyValue=void 0;const r=i(8023),n=i(1324),o=i(7610),s=i(6331);e.getPropertyValue=function(t,e,i){var a,l,c;if(r.Expr.isExpr(t)){let s=t.evaluate(e,r.ExprScope.Dynamic,i);return"string"==typeof s&&(s=null!==(l=null!==(a=o.RGBA.parse(s))&&void 0!==a?a:n.Pixels.parse(s))&&void 0!==l?l:s),s instanceof o.RGBA?s.getHex():s instanceof n.Pixels?s.value*(null!==(c=Number(e.lookup("$pixelToMeters")))&&void 0!==c?c:1):s}if(null==t)return null;if("string"!=typeof t)return t;{const i=e.lookup("$pixelToMeters")||1,r=(0,s.parseStringEncodedNumeral)(t,i);return void 0!==r?r:t}}},6073:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ArrayOperators=void 0;const r=i(8023),n=["boolean","number","string"];function o(t,e){if(!(t instanceof r.StringLiteralExpr&&n.includes(t.value)))throw new Error(`expected "boolean", "number" or "string" instead of '${JSON.str
2ingify(t)}'`);const i=t.value;e.forEach((t,e)=>{if(typeof t!==i)throw new Error(`expected array element at index ${e} to have type '${i}'`)})}function s(t,e){const i=t.evaluate(e);if(!Array.isArray(i))throw new Error(`'${i}' is not an array`);return i}const a={array:{call:(t,e)=>{switch(e.args.length){case 0:throw new Error("not enough arguments");case 1:return s(t,e.args[0]);case 2:{const i=s(t,e.args[1]);return o(e.args[0],i),i}case 3:{const i=s(t,e.args[2]);return function(t,e){if(!(t instanceof r.NumberLiteralExpr))throw new Error("missing expected number of elements");const i=t.value;if(e.length!==i)throw new Error(`the array must have ${i} element(s)`)}(e.args[1],i),o(e.args[0],i),i}default:throw new Error("too many arguments")}}},"make-array":{call:(t,e)=>{if(0===e.args.length)throw new Error("not enough arguments");return[...e.args.map(e=>t.evaluate(e))]}},at:{call:(t,e)=>{const i=e.args,r=t.evaluate(i[0]);if("number"!=typeof r)throw new Error("expected the index of the element to retrieve");const n=t.evaluate(i[1]);if(!Array.isArray(n))throw new Error("expected an array");return r>=0&&r<n.length?n[r]:null}},slice:{call:(t,e)=>{if(e.args.length<2)throw new Error("not enough arguments");const i=t.evaluate(e.args[0]);if("string"!=typeof i&&!Array.isArray(i))throw new Error("input must be a string or an array");const r=t.evaluate(e.args[1]);if("number"!=typeof r)throw new Error("expected an index");let n;if(e.args.length>2&&(n=t.evaluate(e.args[2]),"number"!=typeof n))throw new Error("expected an index");return i.slice(r,n)}}};e.ArrayOperators=a},7290:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CastOperators=void 0;const i={"to-boolean":{call:(t,e)=>Boolean(t.evaluate(e.args[0]))},"to-string":{call:(t,e)=>String(t.evaluate(e.args[0]))},"to-number":{call:(t,e)=>{for(const i of e.args){const e=Number(t.evaluate(i));if(!isNaN(e))return e}throw new Error("cannot convert the value to a number")}}};e.CastOperators=i},4672:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ColorOperators=void 0;const r=i(3334),n=i(1667),o=i(7610),s=i(6331),a={alpha:{call:(t,e)=>{let i=t.evaluate(e.args[0]);return"string"==typeof i&&(i=(0,s.parseStringEncodedColor)(i)),"number"==typeof i?n.ColorUtils.getAlphaFromHex(i):1}},rgba:{call:(t,e)=>{const i=t.evaluate(e.args[0]),o=t.evaluate(e.args[1]),s=t.evaluate(e.args[2]),a=t.evaluate(e.args[3]);if("number"==typeof i&&"number"==typeof o&&"number"==typeof s&&"number"==typeof a&&i>=0&&o>=0&&s>=0&&a>=0&&a<=1)return function(t,e,i,o){return n.ColorUtils.getHexFromRgba((0,r.clamp)(t,0,255)/255,(0,r.clamp)(e,0,255)/255,(0,r.clamp)(i,0,255)/255,(0,r.clamp)(o,0,1))}(i,o,s,a);throw new Error(`unknown color 'rgba(${i},${o},${s},${a})'`)}},rgb:{call:(t,e)=>{const i=t.evaluate(e.args[0]),o=t.evaluate(e.args[1]),s=t.evaluate(e.args[2]);if("number"==typeof i&&"number"==typeof o&&"number"==typeof s&&i>=0&&o>=0&&s>=0)return function(t,e,i){return n.ColorUtils.getHexFromRgb((0,r.clamp)(t,0,255)/255,(0,r.clamp)(e,0,255)/255,(0,r.clamp)(i,0,255)/255)}(i,o,s);throw new Error(`unknown color 'rgb(${i},${o},${s})'`)}},hsl:{call:(t,e)=>{const i=t.evaluate(e.args[0]),o=t.evaluate(e.args[1]),s=t.evaluate(e.args[2]);if("number"==typeof i&&"number"==typeof o&&"number"==typeof s&&i>=0&&o>=0&&s>=0)return function(t,e,i){return n.ColorUtils.getHexFromHsl((0,r.euclideanModulo)(t,360)/360,(0,r.clamp)(e,0,100)/100,(0,r.clamp)(i,0,100)/100)}(i,o,s);throw new Error(`unknown color 'hsl(${i},${o}%,${s}%)'`)}},"to-color":{call:(t,e)=>h(t.evaluate(e.args[0]))},darken:{call:(t,e)=>{const i=h(t.evaluate(e.args[0])),r=t.evaluate(e.args[1]);if(Number(r)!==r)throw new Error(`invalid darken amount '${r}'`);return n.ColorUtils.darken(i.clone(),r)}},"scale-color":{call:(t,e)=>{const i=e.args,r=i.length,o=h(t.evaluate(i[0]));l.h=l.s=l.l=l.a=0;for(let e=1;e<r;){const r=t.evaluate(i[e++]);if(!c.test(r))throw new Error(`invalid component "${r}"`);const n=t.evaluate(i[e++]);if(n!==Number(n))throw new Error(`invalid factor "${n}"`);l[r]=n}return n.ColorUtils.scaleColor(o.clone(),l)}}},l={h:0,s:0,l:0,a:0},c=/^[sla]$/;function h(t){const e=t;return o.RGBA.isRGBA(t)?t:(null==e?void 0:e.isRGBA)?new o.RGBA(e.r,e.g,e.b,e.a):n.ColorUtils.getRgbaFromHex(function(t){if("string"==typeof t){const e=(0,s.parseStringEncodedColor)(t);
2if(void 0!==e)return e}throw new Error(`unknown color '${t}'`)}(t))}e.ColorOperators=a},8998:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ComparisonOperators=void 0;const r=i(1667),n=i(8023);function o(t,e,i=!1){const r=t.evaluate(e.args[0]),n=t.evaluate(e.args[1]),o=typeof r;if(("number"!==o&&"string"!==o||o!==typeof n)&&i)throw new Error(`invalid operands '${r}' and '${n}' for operator '${e.op}'`);switch(e.op){case"<":return r<n;case">":return r>n;case"<=":return r<=n;case">=":return r>=n;default:throw new Error(`invalid comparison operator '${e.op}'`)}}function s(t,e,i=!1){if("number"!=typeof t||isNaN(t)){if(i)throw new Error(`invalid operand '${t}' for operator '${e}'`);return NaN}return t}const a={"!":{call:(t,e)=>!t.evaluate(e.args[0])},"==":{call:(t,e)=>{var i;const n=t.evaluate(e.args[0]),o=t.evaluate(e.args[1]);return null!==(i=r.ColorUtils.comparePotentiallyRGBA(n,o,!0))&&void 0!==i?i:n===o}},"!=":{call:(t,e)=>{var i;const n=t.evaluate(e.args[0]),o=t.evaluate(e.args[1]);return null!==(i=r.ColorUtils.comparePotentiallyRGBA(n,o,!1))&&void 0!==i?i:n!==o}},"<":{call:(t,e)=>o(t,e)},">":{call:(t,e)=>o(t,e)},"<=":{call:(t,e)=>o(t,e)},">=":{call:(t,e)=>o(t,e)},"inside-range":{call:(t,e)=>{const i=e.args;let r,o,a,l,c;i[1]instanceof n.ObjectLiteralExpr&&i[1].isArrayLiteral?(r=i[1].value,a=2,o=0,l=0,c=!0):(r=i,a=3,o=1,l=1,c=!1);let h=r.length,u=!1;if(h>=a&&h%2===l){const n=s(t.evaluate(i[0]),e.op);for(isNaN(n)&&(u=null);!1===u&&h>o;){const i=s(c?r[--h]:t.evaluate(r[--h]),e.op),o=s(c?r[--h]:t.evaluate(r[--h]),e.op);u=isNaN(o)||isNaN(i)?null:n>=o&&n<i}}else u=null;return u}}};e.ComparisonOperators=a},1954:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureOperators=void 0;const r=i(7259),n=i(8023),o={"geometry-type":{call:(t,e)=>{switch(t.env.lookup("$geometryType")){case"point":return"Point";case"line":return"LineString";case"polygon":return"Polygon";default:return null}}},"feature-state":{isDynamicOperator:()=>!0,call:(t,e)=>{var i,o;if(t.scope!==n.ExprScope.Dynamic)throw new Error("feature-state cannot be used in this context");const s=t.evaluate(e.args[0]);if("string"!=typeof s)throw new Error("expected the name of the property of the feature state");const a=t.env.lookup("$state");return r.Env.isEnv(a)?null!==(i=a.lookup(s))&&void 0!==i?i:null:a instanceof Map&&null!==(o=a.get(s))&&void 0!==o?o:null}},id:{call:(t,e)=>{var i;return null!==(i=t.env.lookup("$id"))&&void 0!==i?i:null}}};e.FeatureOperators=o},2181:(t,e)=>{function i(t,e,i){switch(e){case"boolean":case"number":case"string":for(const r of i){const i=t.evaluate(r);if(typeof i===e)return i}throw new Error(`expected a '${e}'`);default:throw new Error(`invalid type '${e}'`)}}Object.defineProperty(e,"__esModule",{value:!0}),e.FlowOperators=void 0;const r={all:{call:(t,e)=>{for(const i of e.args)if(!t.evaluate(i))return!1;return!0}},any:{call:(t,e)=>{for(const i of e.args)if(t.evaluate(i))return!0;return!1}},none:{call:(t,e)=>{for(const i of e.args)if(t.evaluate(i))return!1;return!0}},boolean:{call:(t,e)=>i(t,"boolean",e.args)},number:{call:(t,e)=>i(t,"number",e.args)},string:{call:(t,e)=>i(t,"string",e.args)}};e.FlowOperators=r},202:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MapOperators=void 0;const r=i(8023),n={"ppi-scale":{call:(t,e)=>t.evaluate(e.args[0])*(e.args[1]?t.evaluate(e.args[1]):1)},"world-ppi-scale":{isDynamicOperator:()=>!0,call:(t,e)=>{const i=t.evaluate(e.args[0]),r=e.args[1]?t.evaluate(e.args[1]):1,n=t.env.lookup("$zoom");return i*(Math.pow(2,17)/Math.pow(2,n))*r}},"world-discrete-ppi-scale":{isDynamicOperator:()=>!0,call:(t,e)=>{const i=t.evaluate(e.args[0]),r=t.env.lookup("$zoom");return i*(40075016.68557849/(256*Math.pow(2,Math.floor(r))))}},"pixel-world-scale":{isDynamicOperator:()=>!0,call:(t,e)=>t.evaluate(e.args[0])*(t.env.lookup("$pixelToMeters")||1)},ppi:{call:t=>{const e=t.env.lookup("$ppi");return"number"==typeof e?e:72}},zoom:{isDynamicOperator:()=>!0,call:(t,e)=>{var i;return t.scope===r.ExprScope.Value?e:null!==(i=t.env.lookup("$zoom"))&&void 0!==i?i:null}}};e.MapOperators=n},4054:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.MathOperators=void 0;const r=i(3334),n=i(5448),o=i(6815),s=i(6577),a={"^":{call:(t,e)=>{const i=t.evaluate(e.args[0]),r=t.evaluate(e.args[1]);if("number"!=typeof i||"number"!=typeof r)throw new Error(`invalid operands '${typeof i}' and '${typeof r}' for operator '^'`);return Math.pow(i,r)}},"-":{call:(t,e)=>{if(1===e.args.length){const i=t.evaluate(e.args[0]);if("number"!=typeof i)throw new Error(`ìnvalid operand '${typeof i} for operator '-'`);return-i}const i=t.evaluate(e.args[0]),r=t.evaluate(e.args[1]);if("number"!=typeof i||"number"!=typeof r)throw new Error(`invalid operands '${typeof i}' and '${typeof r}' for operator '-'`);return i-r}},"/":{call:(t,e)=>{const i=t.evaluate(e.args[0]),r=t.evaluate(e.args[1]);if("number"!=typeof i||"number"!=typeof r)throw new Error(`invalid operands '${typeof i}' and '${typeof r}' for operator '/'`);return i/r}},"%":{call:(t,e)=>{const i=t.evaluate(e.args[0]),r=t.evaluate(e.args[1]);if("number"!=typeof i||"number"!=typeof r)throw new Error(`invalid operands '${typeof i}' and '${typeof r}' for operator '%'`);return i%r}},"+":{call:(t,e)=>e.args.reduce((e,i)=>Number(e)+Number(t.evaluate(i)),0)},"*":{call:(t,e)=>{const i=t.evaluate(e.args[0]),r=t.evaluate(e.args[1]),a="number"==typeof i,l="number"==typeof r;let c;if(a&&l)c=i*r;else if(l&&(i instanceof n.Vector2||i instanceof o.Vector3||i instanceof s.Vector4))c=i.clone().multiplyScalar(r);else{if(!a||!(r instanceof n.Vector2||r instanceof o.Vector3||r instanceof s.Vector4))throw new Error(`invalid operands '${typeof i}' and '${typeof r}' for operator '*'`);c=r.clone().multiplyScalar(i)}return c}},abs:{call:(t,e)=>{const i=t.evaluate(e.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'abs'`);return Math.abs(i)}},acos:{call:(t,e)=>{const i=t.evaluate(e.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'acos'`);return Math.acos(i)}},asin:{call:(t,e)=>{const i=t.evaluate(e.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'asin'`);return Math.asin(i)}},atan:{call:(t,e)=>{const i=t.evaluate(e.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'atan'`);return Math.atan(i)}},ceil:{call:(t,e)=>{const i=t.evaluate(e.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'ceil'`);return Math.ceil(i)}},cos:{call:(t,e)=>{const i=t.evaluate(e.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:(t,e)=>{const i=t.evaluate(e.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'floor'`);return Math.floor(i)}},ln:{call:(t,e)=>{const i=t.evaluate(e.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'ln'`);return Math.log(i)}},ln2:{call:(t,e)=>{const i=t.evaluate(e.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'ln2'`);return Math.log2(i)}},log10:{call:(t,e)=>{const i=t.evaluate(e.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'log10'`);return Math.log10(i)}},max:{call:(t,e)=>Math.max(...e.args.map(e=>Number(t.evaluate(e))))},min:{call:(t,e)=>Math.min(...e.args.map(e=>Number(t.evaluate(e))))},clamp:{call:(t,e)=>{const i=t.evaluate(e.args[0]),n=t.evaluate(e.args[1]),o=t.evaluate(e.args[2]);if("number"!=typeof i||"number"!=typeof n||"number"!=typeof o)throw new Error(`invalid operands '${i}', ${n}, ${o} for operator 'clamp'`);return(0,r.clamp)(i,n,o)}},pi:{call:()=>Math.PI}
2,round:{call:(t,e)=>{const i=t.evaluate(e.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'round'`);return Math.round(i)}},sin:{call:(t,e)=>{const i=t.evaluate(e.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'sin'`);return Math.sin(i)}},sqrt:{call:(t,e)=>{const i=t.evaluate(e.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'sqrt'`);return Math.sqrt(i)}},tan:{call:(t,e)=>{const i=t.evaluate(e.args[0]);if("number"!=typeof i)throw new Error(`invalid operand '${i}' for operator 'tan'`);return Math.tan(i)}}};e.MathOperators=a},9764:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MiscOperators=void 0;const r=i(797),n=i(8023);function o(t){return t.join("&")}function s(t,e){return t+"="+JSON.stringify(e)}function a(t,e=0){if(e>=t.length)return[];const i=a(t,e+1),r=i.length;for(let n=0;n<r;n+=1)i.push([...i[n],t[e]]);return i.push([t[e]]),i}function l(t,e){const i=t.args.slice(1),r=[];for(let t=0;t<i.length;t+=2){const n=e.evaluate(i[t+1]);if(null===n)continue;const o=e.evaluate(i[t]);r.push(s(o,n))}return r.sort().reverse(),function(t){t.sort((t,e)=>e.length-t.length);const e=t.map(t=>o(t));return e.push(""),e}(a(r))}const c={length:{call:(t,e)=>{const i=t.evaluate(e.args[0]);if(Array.isArray(i)||"string"==typeof i)return i.length;throw new Error(`invalid operand '${i}' for operator 'length'`)}},coalesce:{call:(t,e)=>{for(const i of e.args){const e=t.evaluate(i);if(null!==e)return e}return null}},lookup:{call:(t,e)=>{(0,r.assert)(e.args.length>0,"missing lookup table");const i=l(e,t);let a=t.evaluate(e.args[0]);if((0,r.assert)(Array.isArray(a)||a instanceof Map,"wrong lookup table type"),Array.isArray(a)){a=function(t){const e=new Map;for(const i of t){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 t=o(Object.getOwnPropertyNames(i.keys).sort().map(t=>s(t,i.keys[t])));e.set(t,i.attributes)}return e}(a);const t=new n.ObjectLiteralExpr(a,e.args[0].id);e.args[0]=t}return function(t,e){for(const i of t){const t=e.get(i);if(t)return t}return null}(i,a)}},trace:{call:(t,e)=>{const i=[];for(const r of e.args)i.push(t.evaluate(r));return console.error("trace: ",...i),i[0]}}};e.MiscOperators=c},7029:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ObjectOperators=void 0;const r=i(7259),n=i(8023),o=Object.prototype.hasOwnProperty;var s;function a(t,e,i){var n;const a=t.evaluate(e[0]);if("string"!=typeof a)throw new Error("expected the name of an attribute");const l=t.evaluate(e[1]);if(l&&"object"==typeof l){if(r.Env.isEnv(l)){const t=null!==(n=l.lookup(a))&&void 0!==n?n:null;return i===s.get?t:null!==t}if(o.call(l,a))return i!==s.get||l[a]}return i===s.get&&null}!function(t){t[t.get=0]="get",t[t.has=1]="has"}(s||(s={}));const l={in:{call:(t,e)=>{const i=t.evaluate(e.args[0]),r=t.evaluate(e.args[1]);return("string"==typeof i&&"string"==typeof r||!!Array.isArray(r))&&r.includes(i)}},get:{call:(t,e)=>a(t,e.args,s.get)},has:{call:(t,e)=>a(t,e.args,s.has)},"dynamic-properties":{isDynamicOperator:()=>!0,call:(t,e)=>t.scope===n.ExprScope.Dynamic?t.env:e}};e.ObjectOperators=l},3501:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StringOperators=void 0;const i={concat:{call:(t,e)=>"".concat(...e.args.map(e=>String(t.evaluate(e))))},downcase:{call:(t,e)=>String(t.evaluate(e.args[0])).toLocaleLowerCase()},upcase:{call:(t,e)=>String(t.evaluate(e.args[0])).toLocaleUpperCase()},"regex-replace":{call:(t,e)=>{const i=t.evaluate(e.args[0]),r=t.evaluate(e.args[1]),n=t.evaluate(e.args[2]);return"string"==typeof i&&"string"==typeof r&&"string"==typeof n?i.replace(new RegExp(r,"g"),n):i}},"~=":{call:(t,e)=>{const i=t.evaluate(e.args[0]),r=t.evaluate(e.args[1]);return"string"==typeof i&&"string"==typeof r&&i.includes(r)}},"^=":{call:(t,e)=>{const i=t.evaluate(e.args[0]),r=t.evaluate(e.args[1]);return"string"==typeof i&&"string"==typeof r&&i.startsWith(r)}},"$=":{call:(t,e)=>
2{const i=t.evaluate(e.args[0]),r=t.evaluate(e.args[1]);return"string"==typeof i&&"string"==typeof r&&i.endsWith(r)}},split:{call:(t,e)=>{const i=t.evaluate(e.args[0]),r=t.evaluate(e.args[1]);if("string"==typeof i&&"string"==typeof r)return i.split(r);throw new Error(`expected '${i}' and '${r}' to be a string`)}}};e.StringOperators=i},5113:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeOperators=void 0,e.TypeOperators={typeof:{call:(t,e)=>typeof t.evaluate(e.args[0])}}},545:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VectorOperators=void 0;const r=i(5448),n=i(6815),o=i(6577),s=i(8023);function a(t,e,i){let s;switch(i){case"vector2":s=r.Vector2;break;case"vector3":s=n.Vector3;break;case"vector4":s=o.Vector4}for(const i of e.args){const e=t.evaluate(i);if(e instanceof s)return e}throw new Error(`expected a "${i}"`)}function l(t,e,i){let s,a;switch(i){case"vector2":s=r.Vector2,a=2;break;case"vector3":s=n.Vector3,a=3;break;case"vector4":s=o.Vector4,a=4}for(const i of e.args){const e=t.evaluate(i);if(e instanceof s)return e;if(Array.isArray(e)&&e.length===a&&e.every(t=>"number"==typeof t))return(new s).fromArray(e)}throw new Error(`expected a "${i}"`)}const c={"make-vector":{call:(t,e)=>{if(void 0!==e._value)return e._value;if(e.args.length<2)throw new Error("not enough arguments");if(e.args.length>4)throw new Error("too many arguments");const i=e.args.map(e=>t.evaluate(e));let a;switch(i.forEach((t,e)=>{if("number"!=typeof t)throw new Error(`expected vector component at index ${e} to have type "number"`)}),i.length){case 2:a=(new r.Vector2).fromArray(i);break;case 3:a=(new n.Vector3).fromArray(i);break;case 4:a=(new o.Vector4).fromArray(i);break;default:throw new Error("too many arguments")}return e.args.every(t=>t instanceof s.NumberLiteralExpr)&&(e._value=a),a}},vector2:{call:(t,e)=>a(t,e,"vector2")},vector3:{call:(t,e)=>a(t,e,"vector3")},vector4:{call:(t,e)=>a(t,e,"vector4")},"to-vector2":{call:(t,e)=>l(t,e,"vector2")},"to-vector3":{call:(t,e)=>l(t,e,"vector3")},"to-vector4":{call:(t,e)=>l(t,e,"vector4")}};e.VectorOperators=c},3209:function(t,e,i){var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(9047),e)},6766:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DeferredPromise=void 0,e.DeferredPromise=class{constructor(t){this.executor=t,this.promise=new Promise((t,e)=>{this.resolveFunc=t,this.rejectFunc=e})}exec(){this.executor().then(t=>this.resolveFunc(t)).catch(t=>this.rejectFunc(t))}}},9047:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TransferManager=void 0;const r=i(6766);class n{static instance(){return n.defaultInstance}static async fetchRepeatedly(t,e,i,r,o){try{if(!(e<i))throw new Error("Max number of retries reached");{const n=await t(r,o);if(200===n.status||204===n.status)return n;if(n.status>=400&&n.status<500){e=i;const t=await n.text();throw new Error(t)}}}catch(t){if(t.hasOwnProperty("isCancelled")||"AbortError"===t.name||e>=i)throw t}return await n.waitFor(n.retryTimeout*e).then(()=>n.fetchRepeatedly(t,e+1,i,r,o))}static waitFor(t){return new Promise(e=>setTimeout(e,t))}constructor(t=fetch,e=5){this.fetchFunction=t,this.maxRetries=e,this.activeDownloadCount=0,this.downloadQueue=new Array,this.activeDownloads=new Map}downloadJson(t,e){return this.downloadAs(t=>t.json(),t,e)}downloadArrayBuffer(t,e){return this.download(t,e).then(t=>t.arrayBuffer())}download(t,e){if(this.activeDownloadCount>=n.maxParallelDownloads){const i=new r.DeferredPromise(()=>this.doDownload(t,e));return this.downloadQueue.push(i),i.promise}return this.doDownload(t,e)}async doDownload(t,e){try{++this.activeDownloadCount;const i=await n.fetchRepeatedly(this.fetchFunction,0,this.maxRetries,t,e);return this.onDownloadDone(),i}catch(t){throw this.onDownloadDone(),t}}onDownloadDone(){--this.activeDownloadCount,this.execDeferredDownload()}execDeferredDownload(){const t=this.downloadQueue.pop();void 0!==t&&t.exec()}downloadAs(t,e,i){const r=e,n=this.activeDownloads.get(r);if(void 0!==n)return Promise.resolve(n);const o=this.download(e,i).then(e=>{if(this.activeDownloads.delete(r),e.ok)return t(e);throw new Error(JSON.stringify(e))}).catch(t=>{throw this.activeDownloads.delete(r),t});return this.activeDownloads.set(r,o),o}}e.TransferManager=n,n.retryTimeout=500,n.maxParallelDownloads=16,n.defaultInstance=new n}
2,6463:function(t,e,i){var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(4992),e),n(i(5337),e),n(i(197),e),n(i(9172),e),n(i(5200),e),n(i(8154),e),n(i(9246),e),n(i(5681),e),n(i(7314),e),n(i(4954),e),n(i(173),e),n(i(34),e),n(i(7250),e),n(i(5177),e),n(i(4713),e),n(i(9276),e),n(i(5704),e),n(i(7427),e),n(i(9206),e)},4342:function(t,e,i){var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(6463),e),n(i(5323),e)},7427:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5681:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},7314:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ContextLogger=void 0,e.ContextLogger=class{constructor(t,e){this.m_logger=t,this.headerMessage=e,this.context=[],this.m_headerLogged=!1,this.warn=this.createLogMethod("warn"),this.info=this.createLogMethod("info"),this.error=this.createLogMethod("error")}pushAttr(t){this.context.push(`${this.context.length>0?".":""}${t}`)}pushIndex(t){this.context.push(`[${t}]`)}pop(){this.context.pop()}createLogMethod(t){return(e,...i)=>{this.m_headerLogged||(this.m_logger.info(this.headerMessage),this.m_headerLogged=!0),this.m_logger[t](`${this.context.join("")}: ${e}`,...i)}}}},4992:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DOMUtils=void 0,function(t){function e(t){return t.substring(0,2)}t.getBrowserLanguages=function(){if(void 0!==navigator.languages&&navigator.languages.length>0){const t=[];for(const i of navigator.languages)t.push(e(i));return t}if(void 0!==navigator.language)return[e(navigator.language)]}}(e.DOMUtils||(e.DOMUtils={}))},9276:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.chainCallbacks=void 0,e.chainCallbacks=function(t,e){return function(...i){return t&&t.apply(this,i),e.apply(this,i)}}},9206:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertFragmentShaderToWebGL2=e.convertVertexShaderToWebGL2=void 0,e.convertVertexShaderToWebGL2=function(t){return["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+t},e.convertFragmentShaderToWebGL2=function(t){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"+t}},5337:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GroupedPriorityList=e.PriorityListGroup=void 0;class i{constructor(t,e,i=new Array){this.priority=t,this.zOrder=e,this.elements=i}}e.PriorityListGroup=i,e.GroupedPriorityList=class{constructor(){this.groups=new Map}getGroupKey(t){return`${t.priority}_${t.zOrder}`}add(t){this.getGroup(t).elements.push(t)}clear(){this.groups.clear()}forEachElement(t){this.forEachGroup(e=>{e.elements.forEach(t)})}forEachGroup(t){for(const[,e]of this.groups)t(e)}count(){let t=0;for(const[,e]of this.groups)t+=e.elements.length;return t}findGroup(t){return this.groups.get(t)}getGroup(t){const e=this.getGroupKey(t);let r=this.findGroup(e);return void 0===r&&(r=new i(t.priority,t.zOrder),this.groups.set(e,r)),r}}},4015:(t,e)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.ConsoleChannel=void 0,e.ConsoleChannel=class{error(t,...e){console.error(t,...e)}debug(t,...e){console.debug(t,...e)}info(t,...e){console.info(t,...e)}log(t,...e){console.log(t,...e)}trace(t,...e){console.trace(t,...e)}warn(t,...e){console.warn(t,...e)}}},3140:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6781:(t,e)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.LoggerOptions=e.LogLevel=void 0,(i=e.LogLevel||(e.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",e.LoggerOptions=class{}},8648:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Logger=void 0;const r=i(6781);e.Logger=class{constructor(t,e,i){this.name=t,this.m_channel=e,this.enabled=!0,this.level=r.LogLevel.Trace,void 0!==i&&this.update(i)}error(t,...e){this.enabled&&this.level<=r.LogLevel.Error&&this.m_channel.error(this.prefix,t,...e)}debug(t,...e){this.enabled&&this.level<=r.LogLevel.Debug&&this.m_channel.debug(this.prefix,t,...e)}info(t,...e){this.enabled&&this.level<=r.LogLevel.Info&&this.m_channel.info(this.prefix,t,...e)}log(t,...e){this.enabled&&this.level<=r.LogLevel.Log&&this.m_channel.log(this.prefix,t,...e)}trace(t,...e){this.enabled&&this.level<=r.LogLevel.Trace&&this.m_channel.trace(this.prefix,t,...e)}warn(t,...e){this.enabled&&this.level<=r.LogLevel.Warn&&this.m_channel.warn(this.prefix,t,...e)}update(t){this.enabled=void 0===t.enabled?this.enabled:t.enabled,this.level=void 0===t.level?this.level:t.level}get prefix(){return this.name+":"}}},6562:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LoggerManager=void 0;const r=i(2531);e.LoggerManager=class{static get instance(){return this.m_instance||(this.m_instance=new r.LoggerManagerImpl)}}},2531:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LoggerManagerImpl=void 0;const r=i(4015),n=i(8648),o=i(7698);e.LoggerManagerImpl=class{constructor(){this.m_loggers=[],this.channel="undefined"==typeof self||void 0!==self.document?new r.ConsoleChannel:new o.WorkerChannel}getLoggerNames(){return this.m_loggers.map(t=>t.name)}getLogger(t){return this.m_loggers.find(e=>e.name===t)}create(t,e={}){void 0!==this.m_levelSetForAll&&(void 0===e.level||e.level<this.m_levelSetForAll)&&(e.level=this.m_levelSetForAll);const i=new n.Logger(t,this.channel,e);return this.m_loggers.push(i),i}dispose(t){const e=this.m_loggers.indexOf(t);if(e<0)throw new Error(`Cannot unregister "${t}" : no such logger registered.`);this.m_loggers.splice(e,1)}updateAll(t){for(const e of this.m_loggers)e.update(t)}update(t,e){for(const i of this.m_loggers)i.name===t&&i.update(e)}enableAll(t){for(const e of this.m_loggers)e.enabled=t}enable(t,e){this.update(t,{enabled:e})}setLogLevelForAll(t){this.m_levelSetForAll=t;for(const e of this.m_loggers)e.level=t}setLogLevel(t,e){this.update(t,{level:e})}setChannel(t){this.channel=t}}},3069:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MultiChannel=void 0,e.MultiChannel=class{constructor(...t){this.channels=[],this.channels=t}error(t,...e){for(const i of this.channels)i.error(t,...e)}debug(t,...e){for(const i of this.channels)i.debug(t,...e)}info(t,...e){for(const i of this.channels)i.info(t,...e)}log(t,...e){for(const i of this.channels)i.log(t,...e)}trace(t,...e){for(const i of this.channels)i.trace(t,...e)}warn(t,...e){for(const i of this.channels)i.warn(t,...e)}}},7698:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerChannel=e.WORKERCHANNEL_MSG_TYPE=void 0;const r=i(6781);e.WORKERCHANNEL_MSG_TYPE="worker-channel-message",e.WorkerChannel=class{error(t,...i){const n={message:[t,...i],type:e.WORKERCHANNEL_MSG_TYPE,level:r.LogLevel.Error};self.postMessage(n)}debug(t,...i){const n={message:[t,...i],type:e.WORKERCHANNEL_MSG_TYPE,level:r.LogLevel.Debug};self.postMessage(n)}info(t,...i){const n={message:[t,...i],type:e.WORKERCHANNEL_MSG_TYPE,level:r.LogLevel.Info};self.postMessage(n)}log(t,...i){const n={message:[t,...i],type:e.WORKERCHANNEL_MSG_TYPE,level:r.LogLevel.Log};self.postMessage(n)}trace(t,...i){const n={message:[t,...i],type:e.WORKERCHANNEL_MSG_TYPE,level:r.LogLevel.Trace};self.postMessage(n)}warn(t,...i){const n={message:[t,...i],type:e.WORKERCHANNEL_MSG_TYPE,level:r.LogLevel.Warn};self.postMessage(n)}}}
2,197:function(t,e,i){var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(4015),e),n(i(3140),e),n(i(6781),e),n(i(8648),e),n(i(6562),e),n(i(3069),e),n(i(7698),e)},9172:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Math2D=void 0,function(t){function e(t,e,i,r){return(t-i)*(t-i)+(e-r)*(e-r)}t.Box=class{constructor(t=0,e=0,i=0,r=0){this.x=t,this.y=e,this.w=i,this.h=r}set(t,e,i,r){this.x=t,this.y=e,this.w=i,this.h=r}copy(t){this.x=t.x,this.y=t.y,this.w=t.w,this.h=t.h}contains(t,e){return this.x<=t&&this.x+this.w>=t&&this.y<=e&&this.y+this.h>=e}containsBox(t){const e=t.x+t.w,i=t.y+t.h;return this.contains(t.x,t.y)&&this.contains(e,t.y)&&this.contains(t.x,i)&&this.contains(e,i)}intersects(t){return this.x<=t.x+t.w&&this.x+this.w>=t.x&&this.y<=t.y+t.h&&this.y+this.h>=t.y}},t.distSquared=e,t.computeSquaredLineLength=function(t){let e=0;const i=t.length-4;for(let r=0;r<i;r+=3){const i=t[r+3]-t[r],n=t[r+4]-t[r+1];e+=i*i+n*n}return e},t.distToSegmentSquared=function(t,i,r,n,o,s){const a=e(r,n,o,s);if(0===a)return e(t,i,r,n);let l=((t-r)*(o-r)+(i-n)*(s-n))/a;return l=Math.max(0,Math.min(1,l)),e(t,i,r+l*(o-r),n+l*(s-n))},t.intersectLineAndCircle=function(t,e,i,r,n,o=0,s=0){const a=i-t,l=r-e,c=a*a+l*l,h=t*r-i*e-l*o+a*s,u=n*n*c-h*h;if(u<-1e-10)return;const p=h*l,d=-h*a;if(u<1e-10)return{x1:o+p/c,y1:s+d/c};const m=Math.sqrt(u),f=(l<0?-1:1)*a*m,g=Math.abs(l)*m;return{x1:o+(p+f)/c,y1:s+(d+g)/c,x2:o+(p-f)/c,y2:s+(d-g)/c}},t.intersectLines=function(t,e,i,r,n,o,s,a,l={x:0,y:0}){const c=(t-i)*(o-a)-(e-r)*(n-s);if(0===c)return;const h=((t*r-e*i)*(n-s)-(t-i)*(n*a-o*s))/c,u=((t*r-e*i)*(o-a)-(e-r)*(n*a-o*s))/c;return l.x=h,l.y=u,l}}(e.Math2D||(e.Math2D={}))},5200:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MathUtils=void 0,function(t){function e(t,e,i){return t<e?e:t>i?i:t}t.clamp=e,t.smoothStep=function(t,i,r){return(r=e((r-t)/(i-t),0,1))*r*(3-2*r)},t.smootherStep=function(t,i,r){return(r=e((r-t)/(i-t),0,1))*r*r*(r*(6*r-15)+10)},t.map=function(t,e,i,r,n){return(t-e)*(n-r)/(i-e)+r},t.min2=function(t,e){let i;return void 0!==t&&(i=t),void 0!==e&&(i=void 0===i?e:Math.min(i,e)),i},t.max2=function(t,e){let i;return void 0!==t&&(i=t),void 0!==e&&(i=void 0===i?e:Math.max(i,e)),i},t.isWithinBounds=function(t,e,i){return!(void 0!==e&&t<e||void 0!==i&&t>i)},t.easeInOutCubic=function(t,e,i){return t+(e-t)*(i<.5?4*i*i*i:(i-1)*(2*i-2)*(2*i-2)+1)}}(e.MathUtils||(e.MathUtils={}))},8154:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.applyMixinsWithoutProperties=e.applyMixins=void 0,e.applyMixins=function(t,e){e.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(i=>{t.prototype[i]=e.prototype[i]})})},e.applyMixinsWithoutProperties=function(t,e){e.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(i=>{const r=Object.getOwnPropertyDescriptor(e.prototype,i);void 0!==r&&void 0===r.get&&"constructor"!==i&&(t.prototype[i]=e.prototype[i])})})}},173:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.pick=e.cloneDeep=void 0,e.cloneDeep=function(t){const e=new Map,i=function t(i){if(null===i)return null;if("object"==typeof i){const r=e.get(i);if(void 0!==r)return r;if(Array.isArray(i)){const r=[];e.set(i,r),r.length=i.length;for(let e=0;e<r.length;++e)r[e]=t(i[e]);return r}if(i instanceof Date){const t=new Date(i.getTime());return e.set(i,t),t}if(i instanceof RegExp){const t=new RegExp(i.source,i.flags);return e.set(i,t),t}if(i.constructor!==Object)throw new Error("cloneDeep doesn't support objects with custom prototypes");{const r={};e.set(i,r);for(const e in i)i.hasOwnProperty(e)&&(r[e]=t(i[e]));return r}}return i}(t);return e.clear(),i},e.pick=function(t,e){const i={};for(const r of e)t.hasOwnProperty(r)&&(i[r]=t[r]);return i}},34:(t,e)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.getOptionValue=void 0,e.getOptionValue=function(...t){for(const e of t)if(null!=e)return e}},4954:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.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()}}e.PerformanceTimer=i,i.instance=new i,i.nowFunc=i.getNowFunc()},5704:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.sampleBilinear=void 0,e.sampleBilinear=function(t,e,i,r,n){const o=e-1,s=i-1,a=r*o,l=Math.floor(a),c=n*s,h=Math.floor(c),u=h*e+l,p=l<o?u+1:u,d=h<s?u+e:u,m=l<o?d+1:d,f=t[u],g=t[p],y=t[d],v=t[m],_=Number.isInteger(a)?0:a-l,b=1-_,x=Number.isInteger(c)?0:c-h,w=1-x;return f*b*w+g*_*w+y*b*x+v*_*x}},7250:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TaskQueue=void 0,e.TaskQueue=class{constructor(t){var e;this.m_options=t,this.m_taskLists=new Map,null===(e=this.m_options.groups)||void 0===e||e.forEach(t=>{this.m_taskLists.set(t,[])}),this.m_options.prioSortFn&&(this.sort=this.m_options.prioSortFn)}update(t){if(void 0===t)this.m_taskLists.forEach(t=>{this.updateTaskList(t)});else{const e=this.getTaskList(t);e&&this.updateTaskList(e)}}add(t){var e;if(this.m_taskLists.has(t.group)){const i=this.m_taskLists.get(t.group);if(!(null==i?void 0:i.includes(t)))return null===(e=this.m_taskLists.get(t.group))||void 0===e||e.push(t),!0}return!1}remove(t){var e,i;if(this.m_taskLists.has(t.group)){const r=null===(e=this.m_taskLists.get(t.group))||void 0===e?void 0:e.indexOf(t);if(-1!==r)return null===(i=this.m_taskLists.get(t.group))||void 0===i||i.splice(r,1),!0}return!1}numItemsLeft(t){var e,i;let r=0;return void 0===t?this.m_taskLists.forEach(t=>{r+=t.length}):r+=null!==(i=null===(e=this.getTaskList(t))||void 0===e?void 0:e.length)&&void 0!==i?i:0,r}processNext(t,e,i=1){if(!this.getTaskList(t)||this.numItemsLeft(t)<=0)return!1;for(let r=0;r<i&&this.numItemsLeft(t)>0;r++){const i=this.pull(t,!0);void 0!==i&&(!e||(null==e?void 0:e(i))?i.execute():this.add(i))}return!0}clear(){this.m_taskLists.clear()}pull(t,e=!1){var i,r;let n;return this.getTaskList(t)&&(n=null===(i=this.getTaskList(t))||void 0===i?void 0:i.pop(),e&&n&&(null===(r=n.isExpired)||void 0===r?void 0:r.call(n)))?this.pull(t,e):n}sort(t,e){return e.getPriority()-t.getPriority()}getTaskList(t){return this.m_taskLists.get(t)}updateTaskList(t){var e;for(let i=0;i<t.length;i++){const r=t[i];(null===(e=null==r?void 0:r.isExpired)||void 0===e?void 0:e.call(r))&&(t.splice(i,1),i--)}t.sort(this.sort)}}},5177:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5323:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getAppBaseUrl=void 0;const r=i(4713);e.getAppBaseUrl=function(){return"undefined"==typeof window?`file://${process.cwd()}/`:(0,r.baseUrl)(window.location.href)}},4713:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getUrlHostAndProtocol=e.getUrlOrigin=e.baseUrl=e.resolveReferenceUri=void 0,e.resolveReferenceUri=function(t,e){return i.test(e)?e:e.startsWith("/")?n(t)+e:(e.startsWith("./")&&(e=e.substr(2)),r(t)+e)};const i=new RegExp("^(((?:[a-z]+:)?//)|(file:/)|(data:))","i");function r(t){if(void 0===t)return"./";let e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),e=t.indexOf("?"),-1!==e&&(t=t.slice(0,e)),e=t.lastIndexOf("/"),-1===e?"./":t.substring(0,e+1)}function n(t){if(void 0===t)return"";const e=o(t);return"file:"===e.protocol?"file://":e.host&&e.protocol?e.protocol+"//"+e.host:e.host?"//"+e.host:e.protocol?e.protocol+"//":""}function o(t){const e=new RegExp(/^(?:([a-z]+:))?\/\/([^\/]*)/,"i"),i=t.match(e);if(!i)throw new Error(`getUrlHostAndProtocol: unable to parse URL '${t}'`);return{protocol:i[1],host:i[2]}}e.baseUrl=r,e.getUrlOrigin=n,e.getUrlHostAndProtocol=o},9246:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assertExists=e.assert=void 0,e.assert=function(t,e){},e.assertExists=function(t,e){return t}},2972:function(t,e,i){var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}
2:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i(7458),e),n(i(3436),e),n(i(9959),e),n(i(6822),e),n(i(3123),e),n(i(5591),e)},9287:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.computeLineAnchorPoints=e.MAX_SEARCH_DEPTH=void 0;const r=i(6815),n=new r.Vector3,o=new r.Vector3;e.MAX_SEARCH_DEPTH=3,e.computeLineAnchorPoints=function(t,i){if(t.count<2)return(new Float64Array).buffer;const r=function(t){const e=[];let i=0;for(let r=0;r<t.count-1;++r)i+=n.fromBufferAttribute(t,r).distanceTo(o.fromBufferAttribute(t,r+1)),e.push(i);return e}(t);if(r[r.length-1]<=Number.EPSILON)return(new Float64Array).buffer;const s=function(t,i,r){const s=[],a=t[t.length-1],l=Math.min(e.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 p=0;for(let e=0;e<h;e++){const i=1===h?a/2:e*u;let l=t.length-1;for(;l!==p;){const e=Math.floor((l+p)/2);i>=t[e]?p=e+1:l=e}const c=t[p],d=1-(c-i)/(c-(0===p?0:t[p-1])),m=n.fromBufferAttribute(r,p).lerp(o.fromBufferAttribute(r,p+1),d);s.push(...m.toArray())}return s}(r,i,t);return new Float64Array(s).buffer}},9252:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DecodeInfo=void 0;const r=i(2754),n=i(6815),o=i(2616);e.DecodeInfo=class{constructor(t,e,i=0){this.targetProjection=t,this.tileKey=e,this.storageLevelOffset=i,this.projectedBoundingBox=new o.OrientedBox3,this.tileBounds=new r.Box3,this.tileSize=new n.Vector3,this.center=new n.Vector3,this.geoBox=this.tilingScheme.getGeoBox(e),this.targetProjection.projectBox(this.geoBox,this.projectedBoundingBox),this.projectedBoundingBox.getCenter(this.center),this.tilingScheme.getWorldBox(e,this.tileBounds),this.tileBounds.getSize(this.tileSize),this.tileSizeOnScreen=256*Math.pow(2,-this.storageLevelOffset),this.columnCount=o.webMercatorTilingScheme.subdivisionScheme.getLevelDimensionX(this.tileKey.level),this.rowCount=o.webMercatorTilingScheme.subdivisionScheme.getLevelDimensionY(this.tileKey.level)}get tilingScheme(){return o.webMercatorTilingScheme}get sourceProjection(){return this.tilingScheme.projection}}},5591:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GeoJsonDataProvider=void 0;const r=i(8152),n=i(2344),o=i(8449),s=i(4342),a=i(9959),l=s.LoggerManager.instance.create("GeoJsonDataProvider"),c="invalidated";let h=!1;class u extends o.DataProvider{constructor(t,e,i){var r;super(),this.name=t,this.input=e,this.m_registered=!1,this.m_tiler=null!==(r=null==i?void 0:i.tiler)&&void 0!==r?r:n.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(t){throw r.WorkerServiceProtocol.isUnknownServiceError(t)&&!h&&(l.info("Unable to start GeoJson tiler service in worker. Use 'OmvTilerService.start();' in decoder script."),h=!0),t}await this.m_tiler.registerIndex(this.name,this.input),this.m_registered=!0}updateInput(t){this.input=t,this.m_tiler.updateIndex(this.name,this.input),this.dispatchEvent({type:c})}ready(){return this.m_registered}async getTile(t){return await this.m_tiler.getTile(this.name,t)}onDidInvalidate(t){return this.addEventListener(c,t),()=>this.removeEventListener(c,t)}dispose(){this.m_tiler.dispose()}}e.GeoJsonDataProvider=u},7458:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ComposedDataFilter=void 0,e.ComposedDataFilter=class{constructor(t){this.filters=t}wantsLayer(t,e){return this.filters.reduce((i,r)=>i&&r.wantsLayer(t,e),!0)}wantsPointFeature(t,e,i){return this.filters.reduce((r,n)=>r&&n.wantsPointFeature(t,e,i),!0)}wantsLineFeature(t,e,i){return this.filters.reduce((r,n)=>r&&n.wantsLineFeature(t,e,i),!0)}wantsPolygonFeature(t,e,i){return this.filters.reduce((r,n)=>r&&n.wantsPolygonFeature(t,e,i),!0)}}},6822:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OmvDebugLabelsTile=void 0;const r=i(6271),n=i(9365),o=i(3148),s=i(6307),a=i(977),l=i(5971),c=i(6815),h=i(4760),u=i(5269),p=i(8152),d=i(2344),m=i(507),f=i(5912),g=i(2002),y=i(5823),v=i(1984),_=new s.LineBasicMaterial({color:0,linewidth:1,depthTest:!1,depthFunc:r.NeverDepth}),b=new a.MeshBasicMaterial({color:16711680,depthTest:!1,depthFunc:r.NeverDepth});new a.MeshBasicMaterial({color:16711680,depthTest:!1,depthFunc:r.NeverDepth}).wireframe=!0,new a.MeshBasicMaterial({color:8421631,depthTest:!1,depthFunc:r.NeverDepth}).wireframe=!0;const x=new a.MeshBasicMaterial({color:0,depthTest:!1,depthFunc:r.NeverDepth}),w=new a.MeshBasicMaterial({color:255,depthTest:!1,depthFunc:r.NeverDepth,opacity:.75,transparent:!0}),S=new a.MeshBasicMaterial({color:10514432,depthTest:!1,depthFunc:r.NeverDepth,opacity:.75,transparent:!0}),T=new y.TextRenderStyle,E=new y.TextLayoutStyle;T.fontSize={unit:y.FontUnit.Point,size:9,backgroundSize:0},T.opacity=.75,T.backgroundOpacity=.75,T.color=new l.Color(.8,.2,.2);const M=Number.MAX_SAFE_INTEGER;class A{constructor(){this.geometry=new o.BufferGeometry,this.indices=new Array,this.positions=new Array}}function C(t,e,i,r,n){n.positions.push(t,e-r,i),n.positions.push(t+r,e,i),n.positions.push(t,e+r,i),n.positions.push(t-r,e,i);const o=n.positions.length/3;n.indices.push(o-4),n.indices.push(o-3),n.indices.push(o-2),n.indices.push(o-4),n.indices.push(o-2),n.indices.push(o-1)}function P(t,e,i=0,r){if(e.indices.length>0){e.geometry.addGroup(0,e.indices.length,0),e.geometry.setAttribute("position",new n.BufferAttribute(new Float32Array(e.positions),3)),e.geometry.setIndex(new n.BufferAttribute(new Uint32Array(e.indices),1));const o=r(e.geometry);
2o.renderOrder=M-i,t.push(o)}}class L extends d.Tile{constructor(t,e){super(t,e)}loadingFinished(){var t,e,i,r;const n=m.debugContext.getValue("DEBUG_TEXT_PATHS"),o=m.debugContext.getValue("DEBUG_TEXT_PATHS_FULL"),s=m.debugContext.getValue("DEBUG_TEXT_POIS_FULL"),a=m.debugContext.getValue("DEBUG_TEXT_LINE_MARKER");if(!(n||o||a)||void 0===this.decodedTile)return;const M=f.TileGeometryCreator.instance,L=this.decodedTile,R=new Map,I=m.debugContext.getValue("DEBUG_TEXT_PATHS.FILTER.TEXT"),O=m.debugContext.getValue("DEBUG_TEXT_PATHS.FILTER.INDEX"),D=this.mapView.env;void 0!==L.textPathGeometries&&(this.preparedTextPaths=M.prepareTextPaths(L.textPathGeometries,L));const k=this.center.x,N=this.center.y,F=this.center.z,U=this.mapView.pixelToWorld,z=this.computeWorldOffsetX();let j=0;if(this.iconTextGroups.count()>0){const t=new A,e=new A,i=[];this.iconTextGroups.forEachElement(r=>{if(r.type!==g.IconTextType.LineMarker&&r.type!==g.IconTextType.PointIconText)return;const n=r.type===g.IconTextType.LineMarker?e:t,o=5*U,l=(t,e,l)=>{if(C(t,e,l,o,n),s||a){const n=.5*o,s=`${r.text} [${j}]`,a=new d.IconText(y.ContextualArabicConverter.instance.convert(s),new c.Vector3(t+z+k+n,e+N+n,l+F),T,E,d.IconText.HIGHEST_PRIORITY,d.IconText.HIGHEST_Z_ORDER,0,0);a.textMinZoomLevel=0,a.mayOverlap=!0,a.reserveSpace=!1,a.alwaysOnTop=!0,a.ignoreDistance=!0,a.priority=d.IconText.HIGHEST_PRIORITY,a._isDebug=!0,i.push(a)}j++};if(void 0!==r.path&&Array.isArray(r.path))for(let t=0;t<r.path.length;t++){const e=r.path[t];l(e.x-k,e.y-N,10+e.z+5*t-F)}else s&&l(r.position.x-k,r.position.y-N,5-F)});for(const t of i)this.addIconText(t);P(this.objects,t,0,t=>new u.Mesh(t,w)),P(this.objects,e,0,t=>new u.Mesh(t,S))}if(void 0!==this.preparedTextPaths){const s=new A,a=new A,m=new A;let f=0;for(const h of this.preparedTextPaths){const u=L.techniques[h.technique];if(!(0,v.isTextTechnique)(u)||void 0!==h._isDebug)continue;void 0!==u.color&&R.set(h.technique,new l.Color((0,p.getPropertyValue)(u.color,D))),f=s.positions.length/3;const g=h.text,_=this.preparedTextPaths.indexOf(h);if((!I||g&&g.includes(I))&&(void 0===O||O===_)){for(let l=0;l<h.path.length;l+=3){const f=l/3,v=h.path[l]-k,_=h.path[l+1]-N,b=10+h.path[l+2]+l/3-F;n&&s.positions.push(v,_,b);const x=0===l&&n;if((o||x)&&(C(v,_,b,U*(x?6:4),x?a:m),o)){const n=null!==(t=u.xOffset)&&void 0!==t?t:0,o=null!==(e=u.yOffset)&&void 0!==e?e:0,s=u.minZoomLevel,a=f%5==0?g+":"+f:Number(f).toString(),l=new d.IconText(y.ContextualArabicConverter.instance.convert(a),new c.Vector3(v+z+k,_+N,b+F),T,E,(0,p.getPropertyValue)(null!==(i=u.priority)&&void 0!==i?i:0,D),(0,p.getPropertyValue)(null!==(r=u.zOrder)&&void 0!==r?r:0,D),n,o);l.textMinZoomLevel=(0,p.getPropertyValue)(s,D),l.mayOverlap=!0,l.reserveSpace=!1,l.alwaysOnTop=!0,l.ignoreDistance=!0,l.priority=d.IconText.HIGHEST_PRIORITY,l.zOrder=d.IconText.HIGHEST_Z_ORDER,this.addIconText(l)}}const l=h.path.length/3;for(let t=0;t<l;++t)t>0&&s.indices.push(f+t),t+1<l&&s.indices.push(f+t)}}P(this.objects,s,-2,t=>new h.LineSegments(t,_)),P(this.objects,a,0,t=>new u.Mesh(t,b)),P(this.objects,m,-1,t=>new u.Mesh(t,x))}}}e.OmvDebugLabelsTile=L},9959:(t,e)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.GEOJSON_TILER_SERVICE_TYPE=e.VECTOR_TILE_DECODER_SERVICE_TYPE=e.OmvGeometryType=void 0,(i=e.OmvGeometryType||(e.OmvGeometryType={}))[i.UNKNOWN=0]="UNKNOWN",i[i.POINT=1]="POINT",i[i.LINESTRING=2]="LINESTRING",i[i.POLYGON=3]="POLYGON",e.VECTOR_TILE_DECODER_SERVICE_TYPE="vector-tile-decoder",e.GEOJSON_TILER_SERVICE_TYPE="geojson-tiler"},7305:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OmvPoliticalViewFeatureModifier=void 0,e.OmvPoliticalViewFeatureModifier=class{constructor(t){this.m_countryCode=t}doProcessPointFeature(t,e,i){return this.processFeature(t,e)}doProcessLineFeature(t,e,i){return this.processFeature(t,e)}doProcessPolygonFeature(t,e,i){return!0}rewriteEnvironment(t,e){this.isPoliticalViewLayer(t)&&this.updateEnvironment(e,this.m_countryCode,"kind")}updateEnvironment(t,e,i){const r=this.getAlternativePov(t,e,i);void 0!==r&&(t.entries[i]=r)}getAlternativePov(t,e,i){const r=e,n=t.lookup(`${i}:${r}`);return"string"==typeof n&&n.length>0?n:void 0}isPoliticalViewLayer(t){return"boundaries"===t||"places"===t}processFeature(t,e){let i=!1;if(this.isPoliticalViewLayer(t)){const r=Object.keys(e.unmap()).filter(t=>t.includes("kind:")).length>0,n=!!e.lookup(`kind:${this.m_countryCode}`),o=!!e.lookup("kind"),s=Boolean(this.m_countryCode);i=!s&&!o&&r||s&&(!o&&r&&!n||o&&n),!i&&s&&n&&this.rewriteEnvironment(t,e)}return!i}}},3123:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.OmvRestClient=e.AuthenticationTypeAccessToken=e.AuthenticationTypeTomTomV1=e.AuthenticationTypeBearer=e.AuthenticationMethod=e.APIFormat=void 0;const r=i(8449),n=i(3209),o=i(4342).LoggerManager.instance.create("OmvRestClient");var s,a;!function(t){t[t.HereV1=0]="HereV1",t[t.MapboxV4=1]="MapboxV4",t[t.XYZMVT=2]="XYZMVT",t[t.XYZJson=3]="XYZJson",t[t.XYZOMV=4]="XYZOMV",t[t.TomtomV1=5]="TomtomV1",t[t.XYZSpace=6]="XYZSpace"}(s=e.APIFormat||(e.APIFormat={})),function(t){t[t.QueryString=0]="QueryString",t[t.AuthorizationHeader=1]="AuthorizationHeader"}(a=e.AuthenticationMethod||(e.AuthenticationMethod={})),e.AuthenticationTypeBearer={method:a.AuthorizationHeader,name:"Bearer"},e.AuthenticationTypeTomTomV1={method:a.QueryString,name:"key"},e.AuthenticationTypeAccessToken={method:a.QueryString,name:"access_token"};class l extends r.DataProvider{constructor(t){super(),this.params=t,this.downloadManager=void 0===t.downloadManager?n.TransferManager.instance():t.downloadManager,this.urlParams=void 0===t.urlParams?{}:t.urlParams}async connect(){}ready(){return!0}async getTile(t,e){const i={signal:e};let r=this.dataUrl(t);const n=await this.getActualAuthenticationCode();return r=this.applyAuthCode(r,i,n),r=this.addQueryParams(r,this.urlParams),this.params.apiFormat===s.XYZJson?await this.downloadManager.downloadJson(r,i):await this.downloadManager.downloadArrayBuffer(r,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 e.AuthenticationTypeBearer;switch(this.params.apiFormat){case s.HereV1:return e.AuthenticationTypeBearer;case s.MapboxV4:case s.XYZOMV:case s.XYZMVT:case s.XYZSpace:case s.XYZJson:return e.AuthenticationTypeAccessToken;case s.TomtomV1:return e.AuthenticationTypeTomTomV1;default:return void o.warn(`#getDefaultAuthMethod: Not supported API format: ${this.params.apiFormat}`)}}applyAuthCode(t,e,i){var r,n,o;if(void 0===i)return t;const s=null!==(r=this.params.authenticationMethod)&&void 0!==r?r:this.getDefaultAuthMethod();if(void 0===s)return t;if(s.method===a.AuthorizationHeader){void 0===e.headers&&(e.headers=new Headers);const t=null!==(n=s.name)&&void 0!==n?n:"Bearer";e.headers.append("Authorization",`${t} ${i}`)}else if(s.method===a.QueryString){const e={};e[null!==(o=s.name)&&void 0!==o?o:"access_token"]=i,t=this.addQueryParams(t,e)}return t}dataUrl(t){if(void 0!==this.params.url)return this.params.url.replace("{x}",String(t.column)).replace("{y}",String(t.row)).replace("{z}",String(t.level));let e=[`/${t.level}`,t.column,t.row].join(this.params.apiFormat===s.XYZSpace||this.params.apiFormat===s.XYZJson?"_":"/");switch(this.params.apiFormat){case s.HereV1:case s.XYZOMV:e+="/omv";break;case s.MapboxV4:case s.XYZMVT:e+=".mvt";break;case s.XYZJson:break;case s.XYZSpace:e+=".mvt";break;case s.TomtomV1:e+=".pbf";break;default:o.warn(`Not supported API format: ${this.params.apiFormat}`)}return this.params.baseUrl+e}addQueryParams(t,e){let i="",r=t.includes("?")?"&":"?";for(const t in e)e.hasOwnProperty(t)&&(i+=`${r}${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`,"?"===r&&(r="&"));return t+i}}e.OmvRestClient=l},6441:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.webMercatorTile2TargetTile=e.webMercatorTile2TargetWorld=e.world2tile=e.tile2world=e.createWorldTileTransformationCookie=e.tile2lat=e.lat2tile=e.isArrayBufferLike=void 0;const r=i(6815),n=i(2616);function o(t,e){return Math.round((1-Math.log(Math.tan(t*Math.PI/180)+1/Math.cos(t*Math.PI/180))/Math.PI)/2*Math.pow(2,e))}function s(t,e){const{north:i,west:r}=e.geoBox,n=Math.log2(t),s=Math.pow(2,e.tileKey.level+n);return{extents:t,scale:s,top:o(i,e.tileKey.level+n),left:Math.round((r+180)/360*s)}}function a(t,e,i,r=!1,o){void 0!==e.worldTileProjectionCookie&&e.worldTileProjectionCookie.extents===t||(e.worldTileProjectionCookie=s(t,e));const{top:a,left:l,scale:c}=e.worldTileProjectionCookie,h=n.EarthConstants.EQUATORIAL_CIRCUMFERENCE;
2return o.x=(l+i.x)/c*h,o.y=(a+(r?-i.y:i.y))/c*h,o.z=(0,n.isVector3Like)(i)?i.z:0,o}function l(t,e,i,o,s,l=!1){a(t,e,i,l,o),e.targetProjection.reprojectPoint(n.webMercatorProjection,o,o),i instanceof r.Vector3&&s&&(o.z*=e.targetProjection.getScaleFactor(o))}e.isArrayBufferLike=function(t){return"undefined"!=typeof SharedArrayBuffer?t instanceof ArrayBuffer||t instanceof SharedArrayBuffer:t instanceof ArrayBuffer},e.lat2tile=o,e.tile2lat=function(t,e){const i=Math.PI-2*Math.PI*t/Math.pow(2,e);return 180/Math.PI*Math.atan(.5*(Math.exp(i)-Math.exp(-i)))},e.createWorldTileTransformationCookie=s,e.tile2world=a,e.world2tile=function(t,e,i,r=!1,o){void 0!==e.worldTileProjectionCookie&&e.worldTileProjectionCookie.extents===t||(e.worldTileProjectionCookie=s(t,e));const{top:a,left:l,scale:c}=e.worldTileProjectionCookie,h=n.EarthConstants.EQUATORIAL_CIRCUMFERENCE;return o.x=Math.round(i.x/h*c-l),o.y=Math.round((r?-1:1)*(i.y/h*c-a)),(0,n.isVector3Like)(o)&&(o.z=i.z),o},e.webMercatorTile2TargetWorld=l,e.webMercatorTile2TargetTile=function(t,e,i,r,n,o=!1){l(t,e,i,r,n,o),r.sub(e.center)}},627:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Ring=void 0;const r=i(9776);e.Ring=class{constructor(t,e,i=4096,n=!1){if(this.points=t,this.textureCoords=e,this.extents=i,this.hasClipInfo=n,void 0!==e&&e.length!==t.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!==e&&(this.vertexStride=this.vertexStride+2),this.area=r.ShapeUtils.area(this.points),this.winding=this.area<0}toArray(t=[],e=0){var i;return this.points.forEach((i,r)=>i.toArray(t,e+this.vertexStride*r)),null===(i=this.textureCoords)||void 0===i||i.forEach((i,r)=>i.toArray(t,e+this.vertexStride*r+2)),t}isProperEdge(t){const e=this.extents,i=(t+1)%this.points.length,r=this.points[t],n=this.points[i];if(this.hasClipInfo){if(r.x!==n.x&&r.y!==n.y)return!0;if(r.x%this.extents!=0&&r.y%this.extents!=0)return!0;if(n.x%this.extents!=0&&n.y%this.extents!=0)return!0;const t=!0===r.isClipped,e=!0===n.isClipped;return!t&&!e}return!(r.x<=0&&n.x<=0||r.x>=e&&n.x>=e||r.y<=0&&n.y<=0||r.y>=e&&n.y>=e)}}},1140:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VectorTileDataEmitter=void 0;const r=i(6782),n=i(9365),o=i(3148),s=i(9776),a=i(2754),l=i(5971),c=i(414),h=i(3334),u=i(5448),p=i(6815),d=i(8152),m=i(3561),f=i(2982),g=i(6525),y=i(6189),v=i(2616),_=i(4388),b=i(3711),x=i(5033),w=i(1984),S=i(4342),T=i(9287),E=i(6441),M=i(627),A=S.LoggerManager.instance.create("OmvDecodedTileEmitter"),C=new p.Vector3,P=new p.Vector3,L=new p.Vector3,R=new p.Vector3,I=new u.Vector2,O=new u.Vector2,D=new p.Vector3,k=new p.Vector3,N=new p.Vector3,F=new u.Vector2,U=new u.Vector2,z=new u.Vector2,j=new p.Vector3,B=new p.Vector3,V=new p.Vector3,G=new p.Vector3,H=new p.Vector3,q=new c.Line3,W=Math.PI/8;function X(t,e,i="index"){const r=e>65535?"uint32":"uint16";return{itemCount:1,name:i,buffer:("uint32"===r?new Uint32Array(t):new Uint16Array(t)).buffer,type:r}}class Y{constructor(t){this.type=t,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.textBackgroundImageTextures=[],this.featureStarts=[],this.edgeFeatureStarts=[],this.objInfos=[],this.offsetDirections=[]}addText(t){let e=this.stringCatalog.indexOf(t);return e<0&&(e=this.stringCatalog.length,this.stringCatalog.push(t)),e}}var K;!function(t){t[t.Simple=0]="Simple",t[t.Complex=1]="Complex"}(K||(K={}));const Z=new l.Color;e.VectorTileDataEmitter=class{constructor(t,e,i={}){var r,n,o;this.m_decodeInfo=t,this.m_styleSetEvaluator=e,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!==(r=i.gatherFeatureAttributes)&&void 0!==r&&r,this.m_options.skipShortLabels=null===(n=i.skipShortLabels)||void 0===n||n,this.m_options.enableElevationOverlay=null!==(o=i.enableElevationOverlay)&&void 0!==o&&o}get projection(){return this.m_decodeInfo.targetProjection}get center(){return this.m_decodeInfo.center}
2processPointFeature(t,e,i,r,n){var o;const s=r.env;this.processFeatureCommon(s);const{tileKey:a,columnCount:l,rowCount:c}=this.m_decodeInfo,h=a.column+1<l?e-1:e,u=a.row+1<c?e-1:e,p=i.filter(t=>t.x>=0&&t.x<=h&&t.y>=0&&t.y<=u);if(0!==p.length)for(const t of n){if(void 0===t)continue;const i=t._index,n=this.findOrCreateMeshBuffers(i,d.GeometryType.Point);if(void 0===n)continue;const{positions:a,texts:l,imageTextures:c,textBackgroundImageTextures:h,objInfos:u,offsetDirections:f}=n,g=(0,w.isTextTechnique)(t)||(0,w.isIconTextTechnique)(t);let y,_;const b=(0,w.isIconTextTechnique)(t);if(b){const e=t;y=(0,m.evaluateTechniqueAttr)(r,e.imageTexture),void 0!==e["background-image"]&&(_=(0,m.evaluateTechniqueAttr)(r,e["background-image"]))}const x=(0,d.scaleHeight)(r,t,this.m_decodeInfo.tileKey.level),S=(0,d.getFeatureId)(s.entries);for(const i of p){if(g){const e=t,i=(0,d.getFeatureText)(r,e,this.m_options.languages);void 0!==i?l.push(n.addText(i)):l.push(-1)}g?(0,E.webMercatorTile2TargetWorld)(e,this.m_decodeInfo,i,D,x):(0,E.webMercatorTile2TargetTile)(e,this.m_decodeInfo,i,D,x);const p=this.projection.type===v.ProjectionType.Planar?D.z:i.z;p>this.m_maxGeometryHeight?this.m_maxGeometryHeight=p:p<this.m_minGeometryHeight&&(this.m_minGeometryHeight=p),a.push(D.x,D.y,D.z),u.push(this.m_options.gatherFeatureAttributes?s.entries:S),f.push(null!==(o=s.lookup("offset_direction"))&&void 0!==o?o:0),b&&(void 0===y?c.push(-1):c.push(n.addText(y)),void 0===_?h.push(-1):h.push(n.addText(_)))}}}processLineFeature(t,e,i,r,o){var s;const a=r.env;this.processFeatureCommon(a);const l=[],c=[],h=[],u=[],f=this.m_decodeInfo.projectedBoundingBox;let g;const y=2*f.extents.x,v=2*f.extents.y,_=Math.max(y,v);let x,M;const C=void 0!==i[0].untiledPositions,P=!1;let L=!1,R=!1;for(const t of o)if(void 0!==t){if(x){const e=this.getTextureCoordinateType(t);(0,S.assert)(void 0===e||M===e)}else x=this.getComputeTexCoordsFunc(t),M=this.getTextureCoordinateType(t);L=L||(0,w.isSpecialDashesLineTechnique)(t),R=R||!L}for(const t of i){const i=[];let r=0;if(C&&(this.m_decodeInfo.targetProjection.projectPoint(t.untiledPositions[0],k),t.untiledPositions.forEach(t=>{this.m_decodeInfo.targetProjection.projectPoint(t,D),r+=D.distanceTo(k),k.copy(D),this.m_decodeInfo.targetProjection.projectPoint(t.normalized(),D),i.push(D.x,D.y,D.z,r)})),L){g=[];let n=0;const o=t.positions.length;if(o>1){let s=0;for(let a=0;a<o-1;a++){const o=[],l=[],p=[],d=[],m=t.positions[a],f=t.positions[a+1];if((0,E.webMercatorTile2TargetWorld)(e,this.m_decodeInfo,m,D,P),l.push(D.x,D.y,D.z),(0,E.webMercatorTile2TargetWorld)(e,this.m_decodeInfo,f,N,P),l.push(N.x,N.y,N.z),x&&(x(m,e).toArray(p,p.length),x(f,e).toArray(p,p.length)),C){let t=this.findRelativePositionInLine(D,i)/r;d.push(t),t=this.findRelativePositionInLine(N,i)/r,d.push(t)}else{d.push(s);const t=D.distanceTo(N);n+=t,s+=t,d.push(s)}D.sub(this.m_decodeInfo.center),o.push(D.x,D.y,D.z),N.sub(this.m_decodeInfo.center),o.push(N.x,N.y,N.z),g.push(o),c.push(l),h.push(p),u.push(d)}}if(!C&&n>0)for(const t of u)t.forEach((e,i)=>{t[i]=e/n})}if(R){const n=[],o=[],s=[],a=[];t.positions.forEach(t=>{if((0,E.webMercatorTile2TargetWorld)(e,this.m_decodeInfo,t,D,P),o.push(D.x,D.y,D.z),x&&x(t,e).toArray(s,s.length),C){const t=this.findRelativePositionInLine(D,i)/r;a.push(t)}D.sub(this.m_decodeInfo.center),n.push(D.x,D.y,D.z)}),l.push(n),c.push(o),h.push(s),u.push(a)}}const I=this.m_decodeInfo.tileKey.level>=11;for(const t of o){if(void 0===t)continue;const e=t._index,i=t.name;if((0,w.isLineTechnique)(t)||(0,w.isSolidLineTechnique)(t)){const i=(0,w.isLineTechnique)(t)?this.m_simpleLines:this.m_solidLines,n=(0,w.isLineTechnique)(t)?K.Simple:K.Complex;L&&((0,S.assert)(void 0!==g,"OmvDecodedTileEmitter#processLineFeature: Internal error - No localLineSegments"),this.applyLineTechnique(i,t,e,n,a.entries,g,r,this.getTextureCoordinateType(t)?h:void 0,u)),l.length>0&&this.applyLineTechnique(i,t,e,n,a.entries,l,r,this.getTextureCoordinateType(t)?h:void 0,C?u:void 0)}else if((0,w.isTextTechnique)(t)||(0,w.isIconTextTechnique)(t)||(0,w.isLineMarkerTechnique)(t)){const i=t,o=(0,d.getFeatureText)(r,i,this.m_options.languages);if(void 0===o&&!(0,w.isIconTextTechnique)(t)&&!(0,w.isLineMarkerTechnique)(t))continue;if((0,w.isTextTechnique)(t)){let t=[];if(this.m_options.skipShortLabels){const e=_/this.m_decodeInfo.tileSizeOnScreen,i=5*String(o).length*e*.5,r=i*i;t=this.splitJaggyLines(c,r,W)}else t=c;if(0===t.length)continue;for(const i of t){const t=S.Math2D.computeSquaredLineLength(i);this.m_textPathGeometries.push({technique:e,path:i,pathLengthSqr:t,text:String(o),objInfos:this.m_options.gatherFeatureAttributes?a.entries:(0,d.getFeatureId)(a.entries)})}}else{const i=t,l=(0,m.evaluateTechniqueAttr)(r,i.imageTexture),h=Math.max(Number.EPSILON,null!==(s=(0,m.evaluateTechniqueAttr)(r,i["anchor-point-density"]))&&void 0!==s?s:20),u=this.m_decodeInfo.projectedBoundingBox.extents,p=2*Math.min(u.x,u.y)/h,f=new n.BufferAttribute(new Float64Array,3);for(const t of c)f.array=t,f.count=t.length/f.itemSize,this.m_iconTextGeometries.push({technique:e,positions:{name:"position",type:"float",buffer:(0,T.computeLineAnchorPoints)(f,p),itemCount:f.itemSize},texts:[0],stringCatalog:[o,l],imageTextures:[1],objInfos:this.m_options.gatherFeatureAttributes?[a.entries]:[(0,d.getFeatureId)(a.entries)]})}}else if((0,w.isLabelRejectionLineTechnique)(t))for(const t of c){const e=[];for(let i=0;i<t.length;i+=3)e.push((new p.Vector3).fromArray(t,i));this.m_pathGeometries.push({path:e})}else if((0,w.isExtrudedLineTechnique)(t)){const i=this.findOrCreateMeshBuffers(e,d.GeometryType.ExtrudedLine);if(void 0===i)continue;const{positions:n,indices:o,groups:s,featureStarts:c,objInfos:h}=i,u=o.length,p=(0,m.evaluateTechniqueAttr)(r,t.width);if(void 0===p)continue;const f=(0,m.evaluateTechniqueAttr)(r,t.cap,"Circle"),g=I&&"Circle"===f;l.forEach(t=>{(0,b.triangulateLine)(t,p,n,o,g),c.push(u),h.push(this.m_options.gatherFeatureAttributes?a.entries:(0,d.getFeatureId)(a.entries))});const y=o.length-u;s.push({start:u,count:y,technique:e})}else A.warn(`OmvDecodedTileEmitter#processLineFeature: Invalid line technique\n ${i} for layer: ${a.entries.$layer} `)}}processPolygonFeature(t,e,i,r,n){const o=r.env;this.processFeatureCommon(o);const l=!1;
2n.forEach(t=>{if(void 0===t)return;const n=t._index;if(void 0===n)throw new Error("OmvDecodedTileEmitter#processPolygonFeature: Internal error - No technique index");let c;const h=o.lookup("bbox");if(Array.isArray(h)){const[t,e,i,r]=h,n=new v.GeoBox(new v.GeoCoordinates(e,t),new v.GeoCoordinates(r,i));c=new a.Box3,v.webMercatorProjection.projectBox(n,c)}const u=[],p=(0,w.isExtrudedPolygonTechnique)(t),d=(0,w.isPolygonTechnique)(t),m=(0,w.isStandardTechnique)(t),g=p||d||m,y=this.getComputeTexCoordsFunc(t,c),_=g&&!p;for(const t of i){const i=[];for(let r=0;r<t.rings.length;r++){const n=0===r;let o=t.rings[r];_&&o.some(t=>t.x<0||t.x>e||t.y<0||t.y>e)&&(o=(0,f.clipPolygon)(o,e));const a=s.ShapeUtils.area(o);if(n&&0===a)break;if(0!==a){let t;void 0!==y&&(t=o.map(t=>y(t,e))),i.push(new M.Ring(o,t,e,_))}}i.length>0&&u.push(i)}const b=(0,w.isSolidLineTechnique)(t)||(0,w.isLineTechnique)(t);if(g)this.applyPolygonTechnique(u,t,n,r,e);else if(b){const i="line"===t.name?this.m_simpleLines:this.m_solidLines,s="line"===t.name?K.Simple:K.Complex,a=(0,w.isSpecialDashesLineTechnique)(t);u.forEach(c=>{const h=[],u=a?[]:void 0;c.forEach(t=>{const i=t.points.length;let r=[],n=0,o=0,s=a?[]:void 0;for(let c=0;c<i;++c){a&&r.length>0&&(r=[],s=[]);const p=(c+1)%i,d=t.points[c],m=t.points[p],f=t.isProperEdge(c);if(f||0===r.length){if(f&&0===r.length&&((0,E.webMercatorTile2TargetTile)(e,this.m_decodeInfo,I.copy(d),D,l),r.push(D.x,D.y,D.z),a)){(0,E.webMercatorTile2TargetTile)(e,this.m_decodeInfo,I.copy(m),N,l),r.push(N.x,N.y,N.z),s.push(o);const t=D.distanceTo(N);n+=t,o+=t,s.push(o)}}else h.push(r),r=[];f&&!a&&((0,E.webMercatorTile2TargetTile)(e,this.m_decodeInfo,I.copy(m),D,l),r.push(D.x,D.y,D.z)),a&&r.length>0&&n>0&&(s.forEach((t,e)=>{s[e]=t/n}),h.push(r),u.push(s))}!a&&r.length>0&&h.push(r)}),0!==h.length&&this.applyLineTechnique(i,t,n,s,o.entries,h,r,void 0,u)})}})}getDecodedTile(){this.createGeometries(),this.processSimpleLines(this.m_simpleLines),this.processLines(this.m_solidLines);const t={techniques:this.m_styleSetEvaluator.decodedTechniques,geometries:this.m_geometries,decodeTime:void 0};return this.m_textGeometries.length>0&&(t.textGeometries=this.m_textGeometries),this.m_iconTextGeometries.length>0&&(t.iconTextGeometries=this.m_iconTextGeometries),this.m_textPathGeometries.length>0&&(t.textPathGeometries=this.m_textPathGeometries),this.m_pathGeometries.length>0&&(t.pathGeometries=this.m_pathGeometries),0!==this.m_sources.length&&(t.copyrightHolderIds=this.m_sources),t.maxGeometryHeight=this.m_maxGeometryHeight,t.minGeometryHeight=this.m_minGeometryHeight,t}splitJaggyLines(t,e,i){const r=[],n=(t,e,i)=>{let r=Number.MAX_SAFE_INTEGER,n=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;for(let a=e;a<i;a+=3){const e=t[a],i=t[a+1];e<r&&(r=e),e>n&&(n=e),i<o&&(o=i),i>s&&(s=i)}return(n-r)*(n-r)+(s-o)*(s-o)},o=t.slice();for(;o.length>0;){const t=o.pop();if(void 0===t||t.length<6)continue;let s=-1;for(let e=0;e<t.length-3;e+=3){F.set(t[e],t[e+1]),U.set(t[e+3],t[e+4]);const r=U.sub(F).normalize();if(e>0){const t=Math.atan2(z.x*r.y-r.x*z.y,r.dot(z));if(Math.abs(t)>i){s=e;break}}z.set(r.x,r.y)}if(s>0){const i=n(t,0,s+3),a=n(t,s,t.length);i>e&&r.push(t.slice(0,s+3)),a>e&&o.push(t.slice(s))}else n(t,0,t.length)>e&&r.push(t)}return r}getTextureCoordinateType(t){return((0,w.isPolygonTechnique)(t)||(0,w.isSolidLineTechnique)(t)||(0,w.isExtrudedPolygonTechnique)(t))&&this.m_options.enableElevationOverlay?w.TextureCoordinateType.TileSpace:(0,w.textureCoordinateType)(t)}getComputeTexCoordsFunc(t,e){switch(this.getTextureCoordinateType(t)){case w.TextureCoordinateType.TileSpace:return(t,e)=>{const i=t.clone().divideScalar(e);return i.y=1-i.y,i};case w.TextureCoordinateType.EquirectangularSpace:return(t,e)=>{const i=(0,E.tile2world)(e,this.m_decodeInfo,t,!1,k),r=v.normalizedEquirectangularProjection.reprojectPoint(v.webMercatorProjection,i);return new u.Vector2(r.x,r.y)};case w.TextureCoordinateType.FeatureSpace:if(!e)return;return(t,i)=>{const r=(0,E.tile2world)(i,this.m_decodeInfo,t,!1,k),n=new u.Vector2(r.x,r.y);return e&&(n.x-=e.min.x,n.y-=e.min.y,n.x/=e.max.x-e.min.x,n.y/=e.max.y-e.min.y),n.y=1-n.y,n};default:return}}applyLineTechnique(t,e,i,r=K.Complex,n,o,s,a,l){let c;const h=t.find(t=>t.technique===i),u=void 0!==a;if(void 0===h){c=new _.LineGroup(u,void 0,r===K.Simple);const e={type:r===K.Complex?d.GeometryType.SolidLine:d.GeometryType.Line,technique:i,lines:c};this.m_options.gatherFeatureAttributes&&(e.objInfos=[n],e.featureStarts=[0]),t.push(e)}else c=h.lines,this.m_options.gatherFeatureAttributes&&h.objInfos&&h.featureStarts&&(h.objInfos.push(n),h.featureStarts.push(c.indices.length));let p=0;o.forEach(t=>{c.add(this.m_decodeInfo.center,t,this.projection,l?l[p]:void 0,a?a[p]:void 0),p++})}applyPolygonTechnique(t,e,i,s,a){var l,c;if(0===t.length)return;const u=(0,w.isExtrudedPolygonTechnique)(e),p=u?d.GeometryType.ExtrudedPolygon:d.GeometryType.Polygon,f=this.findOrCreateMeshBuffers(i,p);if(void 0===f)return;const _=e,b=e,T=!0===_.boundaryWalls,M=(0,w.isPolygonTechnique)(e),N=this.getTextureCoordinateType(e);let F=(0,m.evaluateTechniqueAttr)(s,_.height),U=(0,m.evaluateTechniqueAttr)(s,_.floorHeight);if(void 0===F){const t=s.env.lookup("height"),e=(0,m.evaluateTechniqueAttr)(s,_.defaultHeight);F=void 0!==t?t:void 0!==e?e:0}if(void 0===U){const t=s.env.lookup("min_height");U=void 0===t||M?0:t}F=Math.max(U+x.ExtrusionFeatureDefs.MIN_BUILDING_HEIGHT,F);const z=this.m_decodeInfo.tileKey.level,j=u&&(0,d.scaleHeight)(s,_,z);this.m_decodeInfo.tileBounds.getCenter(C);const{positions:B,normals:V,textureCoordinates:G,colors:H,extrusionAxis:q,indices:W,edgeIndices:Y,groups:K}=f,$=this.m_decodeInfo.targetProjection.type===v.ProjectionType.Spherical,J=u?null!==(l=_.lineWidth)&&void 0!==l?l:0:M&&null!==(c=b.lineWidth)&&void 0!==c?c:0,Q="number"!=typeof J||J>0;let tt;if((0,w.isExtrudedPolygonTechnique)(e)&&(0,S.getOptionValue)(e.vertexColors,!1)){let t=(0,m.evaluateTechniqueAttr)(s,e.color);
2if(void 0===t){const e=s.env.lookup("color");this.isColorStringValid(e)&&(t=String(e))}void 0===t&&(t=(0,m.evaluateTechniqueAttr)(s,e.defaultColor,0)),void 0===t&&(t=0),Z.set(t),tt=Z}for(const e of t){const l=W.length,c=Y.length,p=[],d=B.length/3,m=e[0],b=m.vertexStride,x=b+2;for(let t=0;t<m.points.length;++t){const e=m.points[t];p.push(e.x,-e.y),void 0!==m.textureCoords&&p.push(m.textureCoords[t].x,m.textureCoords[t].y);const i=(t+1)%m.points.length,r=m.isProperEdge(t);p.push(r?i:-1,T||r?i:-1)}const w=[];let S=1;for(;S<e.length;){const t=p.length/x;w.push(t);const i=e[S++];for(let e=0;e<i.points.length;++e){const r=(e+1)%i.points.length,n=i.points[e];p.push(n.x,-n.y),void 0!==i.textureCoords&&p.push(i.textureCoords[e].x,i.textureCoords[e].y);const o=i.isProperEdge(e);p.push(o?t+r:-1,T||o?t+r:-1)}}try{const t=r.Earcut.triangulate(p,w,x),e=p.length/x;if($){const e=new o.BufferGeometry,i=[],r=[],s=[],l=[];for(let t=0;t<p.length;t+=x){const e=(0,E.tile2world)(a,this.m_decodeInfo,I.set(p[t],p[t+1]),!0,k);i.push(e.x,e.y,0),void 0!==N&&r.push(p[t+2],p[t+3]),s.push(p[t+b]),l.push(p[t+b+1])}const c=new n.BufferAttribute(new Float32Array(i),3);let u;e.setAttribute("position",c),void 0!==N&&(u=new n.BufferAttribute(new Float32Array(r),2),e.setAttribute("uv",u));const d=new n.BufferAttribute(new Float32Array(s),1);e.setAttribute("edge",d);const m=new n.BufferAttribute(new Float32Array(l),1);e.setAttribute("wall",d);const f=X(t,c.count-1),_="uint32"===f.type?new n.Uint32BufferAttribute(f.buffer,1):new n.Uint16BufferAttribute(f.buffer,1);e.setIndex(_);const w=this.m_decodeInfo.tileKey.level;if(w>=3&&w<9){const t=Math.pow(2,9-w),{geoBox:i}=this.m_decodeInfo;new g.EdgeLengthGeometrySubdivisionModifier(t,i,g.SubdivisionMode.NoDiagonals,v.webMercatorProjection).modify(e)}new y.SphericalGeometrySubdivisionModifier((0,h.degToRad)(10),v.webMercatorProjection).modify(e),p.length=0,t.length=0;for(let t=0;t<c.array.length;t+=3){const e=(0,E.world2tile)(a,this.m_decodeInfo,D.set(c.array[t],c.array[t+1],0),!0,O);p.push(e.x,e.y),void 0!==N&&(p.push(u.array[t/3*2]),p.push(u.array[t/3*2+1])),p.push(d.array[t/3]),p.push(m.array[t/3])}const S=e.getIndex();null!==S&&t.push(...S.array)}P.set(0,0,1);for(let t=0;t<p.length;t+=x){(0,E.webMercatorTile2TargetWorld)(a,this.m_decodeInfo,I.set(p[t],p[t+1]),D,!1,!0);const e=j?this.m_decodeInfo.targetProjection.getScaleFactor(D):1;this.m_maxGeometryHeight=Math.max(this.m_maxGeometryHeight,e*F),this.m_minGeometryHeight=Math.min(this.m_minGeometryHeight,e*F),$&&P.set(D.x,D.y,D.z).normalize(),D.sub(this.center),L.copy(P).multiplyScalar(U*e),B.push(D.x+L.x,D.y+L.y,D.z+L.z),void 0!==N&&G.push(p[t+2],p[t+3]),this.m_options.enableElevationOverlay&&V.push(...P.toArray()),u&&(R.copy(P).multiplyScalar(F*e),B.push(D.x+R.x,D.y+R.y,D.z+R.z),q.push(0,0,0,0,R.x-L.x,R.y-L.y,R.z-L.z,1),void 0!==N&&G.push(p[t+2],p[t+3]),this.m_options.enableElevationOverlay&&V.push(...P.toArray()),void 0!==tt&&H.push(tt.r,tt.g,tt.b,tt.r,tt.g,tt.b))}for(let e=0;e<t.length;e+=3)if(u){const i=d+2*t[e+0]+1,r=d+2*t[e+1]+1,n=d+2*t[e+2]+1;W.push(i,r,n)}else{const i=d+t[e+0],r=d+t[e+1],n=d+t[e+2];W.push(i,r,n)}Q&&this.addEdges(d,e,x,b,B,p,Y,u,_.footprint,_.maxSlope),u&&this.addWalls(d,e,x,b,p,W)}catch(t){A.error("cannot triangulate geometry",t)}this.m_options.gatherFeatureAttributes&&(f.objInfos.push(s.env.entries),f.featureStarts.push(l),f.edgeFeatureStarts.push(c));const M=W.length-l;M>0&&K.push({start:l,count:M,technique:i})}}createGeometries(){this.m_meshBuffers.forEach((t,e)=>{if(0===t.positions.length)return;if(!this.m_styleSetEvaluator.techniques||this.m_styleSetEvaluator.techniques.length<=e)throw new Error("Invalid technique index");const i=this.m_styleSetEvaluator.techniques[e];if(void 0===i)return;if(t.texts.length>0){const r={positions:{name:"position",type:"float",buffer:new Float64Array(t.positions).buffer,itemCount:3},texts:t.texts,technique:e,stringCatalog:t.stringCatalog,objInfos:t.objInfos};if((0,w.isTextTechnique)(i))this.m_textGeometries.push(r);else{(0,S.assert)((0,w.isIconTextTechnique)(i));const e=r;
2e.imageTextures=t.imageTextures,e.textBackgroundImageTextures=t.textBackgroundImageTextures,e.offsetDirections=t.offsetDirections,this.m_iconTextGeometries.push(e)}return}const r=new Float32Array(t.positions);0===t.groups.length&&t.groups.push({start:0,count:r.length/3,technique:e});const n=[{name:"position",buffer:r.buffer,itemCount:3,type:"float"}],o={type:t.type,vertexAttributes:n,groups:t.groups};if(t.normals.length>0){const e=new Float32Array(t.normals);(0,S.assert)(e.length===r.length,"length of normals buffer is different than the length of the position buffer"),n.push({name:"normal",buffer:e.buffer,itemCount:3,type:"float"})}if(t.colors.length>0){const e=new Float32Array(t.colors);(0,S.assert)(e.length===r.length,"length of colors buffer is different than the length of the position buffer"),n.push({name:"color",buffer:e.buffer,itemCount:3,type:"float"})}const s=t.positions.length/3;if(t.textureCoordinates.length>0){const e=t.textureCoordinates.length/2;(0,S.assert)(e===s,"length of textureCoordinates buffer is different than the length of theposition buffer");const i=new Float32Array(t.textureCoordinates);n.push({name:"uv",buffer:i.buffer,itemCount:2,type:"float"})}if(t.extrusionAxis.length>0){const e=new Float32Array(t.extrusionAxis);(0,S.assert)(e.length/4==r.length/3,"length of extrusionAxis buffer is different than the length of the position buffer"),n.push({name:"extrusionAxis",buffer:e.buffer,itemCount:4,type:"float"})}t.indices.length>0&&(o.index=X(t.indices,s-1)),t.edgeIndices.length>0&&(o.edgeIndex=X(t.edgeIndices,s-1,"edgeIndex")),o.featureStarts=t.featureStarts,o.edgeFeatureStarts=t.edgeFeatureStarts,o.objInfos=t.objInfos,this.m_geometries.push(o)})}processLines(t){t.forEach(t=>{const{vertices:e,indices:i}=t.lines,r=t.technique,n=new Float32Array(e).buffer,o=X(i,e.length/t.lines.stride-1),s={type:"float",stride:t.lines.stride,buffer:n,attributes:t.lines.vertexAttributes},a={type:d.GeometryType.SolidLine,index:o,interleavedVertexAttributes:[s],groups:[{start:0,count:i.length,technique:r}],vertexAttributes:[],featureStarts:t.featureStarts,objInfos:t.objInfos};this.m_geometries.push(a)})}processSimpleLines(t){t.forEach(t=>{const{vertices:e,indices:i}=t.lines,r=t.technique,n={buffer:new Float32Array(e).buffer,itemCount:3,type:"float",name:"position"},o={type:d.GeometryType.Line,index:X(i,e.length/n.itemCount-1),vertexAttributes:[n],groups:[{start:0,count:i.length,technique:r}],featureStarts:t.featureStarts,objInfos:t.objInfos};this.m_geometries.push(o)})}findOrCreateMeshBuffers(t,e){let i=this.m_meshBuffers.get(t);return void 0!==i?i.type!==e?void A.error(`MeshBuffer has been created with wrong type "${d.GeometryType[e]}"\n instead of "${d.GeometryType[i.type]}"`):i:(i=new Y(e),this.m_meshBuffers.set(t,i),i)}processFeatureCommon(t){const e=t.lookup("source");"string"==typeof e&&""!==e&&(this.m_sources.includes(e)||this.m_sources.push(e))}isColorStringValid(t){return"string"==typeof t&&t.length>0}addEdges(t,e,i,r,n,o,s,a,l,c){const h=new p.Vector3,u=new p.Vector3;let d,m,f=0,g=0;for(;f<e;){for(;f!==d;){void 0===d&&(d=f),f<e&&(g=Math.max(g,f));const p=o[f*i+r];if(p<0)break;if(a)if(!0===l&&s.push(t+2*f,t+2*p),s.push(t+2*f+1,t+2*p+1),void 0!==c){if(void 0!==m){const e=3*(t+2*m),i=3*(t+2*f),r=3*(t+2*p);h.set(n[i]-n[e],n[i+1]-n[e+1],n[i+2]-n[e+2]).normalize(),u.set(n[r]-n[i],n[r+1]-n[i+1],n[r+2]-n[i+2]).normalize(),h.dot(u)<=c&&s.push(t+2*f,t+2*f+1)}}else s.push(t+2*f,t+2*f+1);else s.push(t+f,t+p);m=f,f=p}f=g+1,d=void 0,m=void 0}}addWalls(t,e,i,r,n,o){let s,a=0,l=0;for(;a<e;){for(;a!==s;){void 0===s&&(s=a),a<e&&(l=Math.max(l,a));const c=n[a*i+r+1];if(c<0)break;o.push(t+2*a,t+2*a+1,t+2*c+1,t+2*c+1,t+2*c,t+2*a),a=c}a=l+1,s=void 0}}findRelativePositionInLine(t,e){let i=1/0,r=0;for(let n=0;n<e.length;n+=4){q.set(j.set(e[n],e[n+1],e[n+2]),B.set(e[n+4],e[n+5],e[n+6])),q.closestPointToPoint(t,!0,V);const o=V.distanceTo(t);o<i&&(G.copy(V),H.copy(j),i=o,r=e[n+3])}return r+G.distanceTo(H)}}},3436:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VectorTileDataSource=void 0;const r=i(8152),n=i(2616),o=i(2344),s=i(8449),a=i(4342),l=i(9959),c=i(3123),h=a.LoggerManager.instance.create("VectorTileDataSource");function u(t){var e;if(t.dataProvider)return t.dataProvider;if(null!==(e=t.baseUrl)&&void 0!==e?e:t.url)return new c.OmvRestClient(t);throw new Error("OmvDataSource: missing url, baseUrl or dataProvider params")}let p=!1;const d="https://vector.hereapi.com/v2/vectortiles/base/mc",m={baseUrl:d,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([[d,m]]);class g extends s.TileDataSource{constructor(t){var e,i,r,h,p,m,g;super(null!==(e=t.tileFactory)&&void 0!==e?e:new s.TileFactory(o.Tile),Object.assign({layerNames:null!==(i=t.layerNames)&&void 0!==i?i:["omv"],concurrentDecoderServiceName:null!==(r=t.concurrentDecoderServiceName)&&void 0!==r?r:l.VECTOR_TILE_DECODER_SERVICE_TYPE,minDataLevel:null!==(h=t.minDataLevel)&&void 0!==h?h:1,maxDataLevel:null!==(p=t.maxDataLevel)&&void 0!==p?p:17,storageLevelOffset:null!==(m=t.storageLevelOffset)&&void 0!==m?m:-1},function(t){var e;if(void 0===t.dataProvider&&void 0===t.url){const i=null!==(e=t.baseUrl)&&void 0!==e?e:d,r=Object.assign(Object.assign({},f.get(i)),t);return Object.assign(Object.assign({},r),{tilingScheme:n.webMercatorTilingScheme,dataProvider:new c.OmvRestClient(r)})}return Object.assign(Object.assign({},t),{tilingScheme:n.webMercatorTilingScheme,dataProvider:u(t)})}(t))),this.m_params=t,this.cacheable=!0,this.addGroundPlane=void 0===t.addGroundPlane||!0===t.addGroundPlane;let y=t.roundUpCoordinatesIfNeeded;void 0===y&&(null==t?void 0:t.baseUrl)===d&&(y=!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=t.storageLevelOffset)&&void 0!==g?g:-1,enableElevationOverlay:!0===this.m_params.enableElevationOverlay,roundUpCoordinatesIfNeeded:y},this.maxGeometryHeight=(0,a.getOptionValue)(t.maxGeometryHeight,n.EarthConstants.MAX_BUILDING_HEIGHT),this.minGeometryHeight=(0,a.getOptionValue)(t.minGeometryHeight,0)}async connect(){try{await super.connect()}catch(t){throw t.message&&r.WorkerServiceProtocol.isUnknownServiceError(t)&&!p&&(h.info("Unable to create decoder service in worker. Use 'OmvTileDecoderService.start();' in decoder script."),p=!0),"string"==typeof t?new Error(t):t}this.configureDecoder(void 0,this.m_decoderOptions)}shouldPreloadTiles(){return!0}setPoliticalView(t){t=null==t?void 0:t.toLowerCase(),this.m_decoderOptions.politicalView!==t&&(this.m_decoderOptions.politicalView=t,this.configureDecoder(void 0,{politicalView:void 0!==t?t:""}))}get storageLevelOffset(){return super.storageLevelOffset}set storageLevelOffset(t){super.storageLevelOffset=t,this.m_decoderOptions.storageLevelOffset=this.storageLevelOffset,this.configureDecoder(void 0,{storageLevelOffset:this.storageLevelOffset})}setEnableElevationOverlay(t){this.m_decoderOptions.enableElevationOverlay!==t&&(this.m_decoderOptions.enableElevationOverlay=t,this.configureDecoder(void 0,{enableElevationOverlay:t}))}configureDecoder(t,e){this.clearCache(),this.decoder.configure(t,e),this.isDetached()||this.mapView.markTilesDirty(this)}}e.VectorTileDataSource=g},1503:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.VectorTileDecoderService=e.VectorTileDecoder=e.VectorTileDataProcessor=void 0;const r=i(7769),n=i(2626),o=i(4342),s=i(5156),a=i(2926),l=i(4585),c=i(9252),h=i(9959),u=i(1140),p=o.LoggerManager.instance.create("VectorTileDecoder",{enabled:!1});class d{constructor(t,e,i,r,n={}){var o,s;this.m_tileKey=t,this.m_projection=e,this.m_styleSetEvaluator=i,this.m_dataAdapter=r,this.m_options=n,n.storageLevelOffset=null!==(o=n.storageLevelOffset)&&void 0!==o?o:0,n.showMissingTechniques=null!==(s=n.showMissingTechniques)&&void 0!==s&&s}getDecodedTile(t){this.m_styleSetEvaluator.resetTechniques();const e=new c.DecodeInfo(this.m_projection,this.m_tileKey,this.m_options.storageLevelOffset);return this.m_decodedTileEmitter=new u.VectorTileDataEmitter(e,this.m_styleSetEvaluator,this.m_options),this.m_dataAdapter.process(t,e,this),this.m_decodedTileEmitter.getDecodedTile()}processPointFeature(t,e,i,r,n){(0,o.assert)(void 0!==this.m_decodedTileEmitter),this.processFeature(t,e,i,"point",r,n,this.m_decodedTileEmitter.processPointFeature)}processLineFeature(t,e,i,r,n){(0,o.assert)(void 0!==this.m_decodedTileEmitter),this.processFeature(t,e,i,"line",r,n,this.m_decodedTileEmitter.processLineFeature)}processPolygonFeature(t,e,i,r,n){(0,o.assert)(void 0!==this.m_decodedTileEmitter),this.processFeature(t,e,i,"polygon",r,n,this.m_decodedTileEmitter.processPolygonFeature)}processFeature(t,e,i,r,n,o,s){const a=this.createMapEnv(n,o,t,r),l=this.m_styleSetEvaluator.getMatchingTechniques(a,t,r);if(0===l.length)return void(this.m_options.showMissingTechniques&&p.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,[t,e,i,c,l])}createMapEnv(t,e,i,n){const o=this.m_tileKey.level;return new r.MapEnv(Object.assign(Object.assign({$layer:i,$id:null!=e?e:null,$level:o,$zoom:Math.max(0,o-this.m_options.storageLevelOffset),$geometryType:n},this.getLocalizedNames(t)),t))}getLocalizedNames(t){var e,i;const[r,n]=null!==(i=null===(e=this.m_options.languages)||void 0===e?void 0:e.map(e=>t[`name:${e}`]))&&void 0!==i?i:[];return{"$localized-name":null!=r?r:t.name,"$secondary-localized-name":n}}}e.VectorTileDataProcessor=d;class m extends n.ThemedTileDecoder{constructor(t){super(),this.m_dataAdapter=t,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(t,e,i,r){const n=o.PerformanceTimer.now();if(!this.m_dataAdapter&&(this.m_dataAdapter=this.findDefaultDataAdapter(t),!this.m_dataAdapter))return Promise.reject(new Error("Unsupported data format."));const s=this.m_dataAdapter;if((0,o.assert)(s.canProcess(t)),this.m_options.changed){if(s instanceof l.OmvDataAdapter){const t=this.m_options.map;s.configure(t)}this.m_options.changed=!1}const a=new d(e,r,i,s,this.m_options.map).getDecodedTile(t);return a.decodeTime=o.PerformanceTimer.now()-n,Promise.resolve(a)}configure(t,e){super.configure(t,e),this.m_options.map=Object.assign(Object.assign(Object.assign({},this.m_options.map),t),e),this.m_options.changed=!0}findDefaultDataAdapter(t){for(const e of this.m_defaultDataAdapters)if(e.canProcess(t))return e}}e.VectorTileDecoder=m,e.VectorTileDecoderService=class{static start(){n.WorkerServiceManager.getInstance().register({serviceType:h.VECTOR_TILE_DECODER_SERVICE_TYPE,factory:t=>n.TileDecoderService.start(t,new m)})}}},2926:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GeoJsonVtDataAdapter=void 0;const r=i(9776),n=i(5448),o=i(6815),s=i(2616),a=i(6441),l=4096;var c;!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon"}(c||(c={}));const h=new o.Vector3;e.GeoJsonVtDataAdapter=class{canProcess(t){if((0,a.isArrayBufferLike)(t))return!1;const e=t;return void 0!==e.features&&void 0!==e.source&&void 0!==e.x&&void 0!==e.y&&void 0!==e.z}
2process(t,e,i){for(const u of t.features)switch(u.type){case c.Point:for(const e of u.geometry){const r=e[0],n=e[1],s=new o.Vector3(r,n,0);i.processPointFeature(t.layer,l,[s],u.tags,u.id)}break;case c.LineString:{const r=u.geometry;let o;const c=[];r.forEach(t=>{const e=null==o?void 0:o.positions[o.positions.length-1],[i,r]=t[0];if((null==e?void 0:e.x)===i&&(null==e?void 0:e.y)===r)for(let e=1;e<t.length;++e){const[i,r]=t[e];null==o||o.positions.push(new n.Vector2(i,r))}else{const e=t.map(([t,e])=>new n.Vector2(t,e));c.push({positions:e}),o=c[c.length-1]}}),c.forEach(t=>{t.untiledPositions=t.positions.map(t=>((0,a.tile2world)(l,e,t,!1,h),s.webMercatorProjection.unprojectPoint(h)))}),i.processLineFeature(t.layer,l,c,u.tags,u.id);break}case c.Polygon:{const e=[];let o;for(const t of u.geometry){const i=[];for(const[e,r]of t){const t=new n.Vector2(e,r);i.push(t)}r.ShapeUtils.area(i)>0&&(o={rings:[]},e.push(o)),null==o||o.rings.push(i)}i.processPolygonFeature(t.layer,l,e,u.tags,u.id);break}case c.Unknown:}}}},5156:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GeoJsonDataAdapter=void 0;const r=i(9776),n=i(5448),o=i(6815),s=i(6112),a=i(2616),l=i(6441),c=4096,h=new o.Vector3;function u(t,e,i){return a.webMercatorProjection.projectPoint(a.GeoCoordinates.fromGeoPoint(t),h),(0,l.world2tile)(c,e,h,!1,i)}function p(t,e){return{untiledPositions:t.map(t=>a.GeoCoordinates.fromGeoPoint(t)),positions:t.map(t=>u(t,e,new n.Vector2))}}function d(t,e){return"LineString"===t.type?[p(t.coordinates,e)]:t.coordinates.map(t=>p(t,e))}function m(t,e){return{rings:t.map((t,i)=>{const n=0===i,{positions:o}=p(t,e),s=r.ShapeUtils.area(o)>0;return(n&&!s||!n&&s)&&o.reverse(),o})}}function f(t,e){return"Polygon"===t.type?[m(t.coordinates,e)]:t.coordinates.map(t=>m(t,e))}function g(t,e){return"Point"===t.type?[u(t.coordinates,e,new o.Vector3)]:t.coordinates.map(t=>u(t,e,new o.Vector3))}e.GeoJsonDataAdapter=class{canProcess(t){return t&&"FeatureCollection"===t.type&&Array.isArray(t.features)}
2process(t,e,i,r="geojson"){if(Array.isArray(t.features)&&0!==t.features.length)for(const n of t.features)switch(n.geometry.type){case"LineString":case"MultiLineString":{let t=d(n.geometry,e);const o=[],a=100;t.forEach(t=>{(0,s.clipLineString)(t.positions,-a,-a,c+a,c+a).forEach(t=>{o.push({positions:t})})}),t=o,t.length>0&&i.processLineFeature(r,c,o,n.properties,n.id);break}case"Polygon":case"MultiPolygon":{const t=f(n.geometry,e);i.processPolygonFeature(r,c,t,n.properties,n.id);break}case"Point":case"MultiPoint":{const t=g(n.geometry,e);i.processPointFeature(r,c,t,n.properties,n.id);break}}}}},9607:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GeometryCommands=e.FeatureAttributes=e.visitOmvLayer=e.visitOmv=e.isClosePathCommand=e.isLineToCommand=e.isMoveToCommand=e.CommandKind=void 0;const r=i(5448),n=i(3577);var o;function s(t,e){if((!e.visitLayer||e.visitLayer(t))&&t.features)for(const i of t.features)switch(i.type){case n.com.mapbox.pb.Tile.GeomType.UNKNOWN:break;case n.com.mapbox.pb.Tile.GeomType.POINT:e.visitPointFeature&&e.visitPointFeature(i);break;case n.com.mapbox.pb.Tile.GeomType.LINESTRING:e.visitLineFeature&&e.visitLineFeature(i);break;case n.com.mapbox.pb.Tile.GeomType.POLYGON:e.visitPolygonFeature&&e.visitPolygonFeature(i)}e.endVisitLayer&&e.endVisitLayer(t)}!function(t){t[t.MoveTo=1]="MoveTo",t[t.LineTo=2]="LineTo",t[t.ClosePath=7]="ClosePath"}(o=e.CommandKind||(e.CommandKind={})),e.isMoveToCommand=function(t){return t.kind===o.MoveTo},e.isLineToCommand=function(t){return t.kind===o.LineTo},e.isClosePathCommand=function(t){return t.kind===o.ClosePath},e.visitOmv=function(t,e){if(t.layers)for(const i of t.layers)e.visitLayer&&!e.visitLayer(i)||s(i,e),e.endVisitLayer&&e.endVisitLayer(i)},e.visitOmvLayer=s,e.FeatureAttributes=class{accept(t,e,i){const{keys:r,values:n}=t,o=e.tags;if(o&&r&&n)for(let t=0;t<o.length;t+=2){const e=r[o[t]],s=n[o[t+1]];if(!i.visitAttribute(e,s))break}}},e.GeometryCommands=class{accept(t,e){if(!t)return;const i=t.length;let n=0,s=0;const a=[],l=[],c=[];for(let h=0;h<i;){const i=7&t[h],u=t[h]>>3;if(++h,i===o.MoveTo||i===o.LineTo)for(let o=0;o<u;++o){const o=t[h++],u=t[h++];n+=o>>1^-(1&o),s+=u>>1^-(1&u),"Polygon"===e.type&&(a.push(n),l.push(s));const p=new r.Vector2(n,s);c.push({kind:i,position:p})}else{for(const t of c)e.visitCommand(t);e.visitCommand({kind:i}),a.length=0,l.length=0,c.length=0}}if(c.length>0)for(const t of c)e.visitCommand(t)}}},4585:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OmvDataAdapter=e.asGeometryType=void 0;const r=i(5133),n=i(9776),o=i(6815),s=i(7769),a=i(4342),l=i(9959),c=i(7305),h=i(6441),u=i(9607),p=i(3577),d=["stringValue","floatValue","doubleValue","intValue","uintValue","sintValue","boolValue"],m=a.LoggerManager.instance.create("OmvDataAdapter",{enabled:!1}),f=r.fromNumber(Number.MAX_SAFE_INTEGER,!0),g=r.fromNumber(Number.MIN_SAFE_INTEGER,!1);function y(t,e,i){if(void 0!==e.id&&null!==e.id)return e.id;if(t.hasOwnProperty("id")){const e=t.id;if("number"==typeof e)return e;if(e)return void 0!==i&&e.greaterThan(Number.MAX_SAFE_INTEGER)&&i.error("Invalid ID: Larger than largest available Number in feature: ",t),e.toNumber()}}function v(t){if(void 0===t)return l.OmvGeometryType.UNKNOWN;switch(t.type){case p.com.mapbox.pb.Tile.GeomType.UNKNOWN:return l.OmvGeometryType.UNKNOWN;case p.com.mapbox.pb.Tile.GeomType.POINT:return l.OmvGeometryType.POINT;case p.com.mapbox.pb.Tile.GeomType.LINESTRING:return l.OmvGeometryType.LINESTRING;
2case p.com.mapbox.pb.Tile.GeomType.POLYGON:return l.OmvGeometryType.POLYGON;default:return l.OmvGeometryType.UNKNOWN}}function _(t,e){t.forEach(t=>{t.x===e-1&&(t.x=e)})}e.asGeometryType=v,e.OmvDataAdapter=class{constructor(){this.m_geometryCommands=new u.GeometryCommands,this.m_roundUpCoordinatesIfNeeded=!1}configure(t){var e;const i=t.politicalView;this.m_dataFilter=void 0,this.m_featureModifiers=[new c.OmvPoliticalViewFeatureModifier(null!=i?i:"")],this.m_roundUpCoordinatesIfNeeded=null!==(e=t.roundUpCoordinatesIfNeeded)&&void 0!==e&&e}canProcess(t){return(0,h.isArrayBufferLike)(t)}process(t,e,i){const{tileKey:r}=e,n=new Uint8Array(t),o=p.com.mapbox.pb.Tile.decode(n);this.m_tileKey=r,this.m_processor=i,(0,u.visitOmv)(o,this)}visitLayer(t){this.m_layer=t;const e=this.m_tileKey.level,i=t.name;return!(void 0!==this.m_dataFilter&&!this.m_dataFilter.wantsLayer(i,e))}visitPointFeature(t){var e;if(void 0===t.geometry)return;const i=this.filterAndModifyFeature(t,"doProcessPointFeature","wantsPointFeature");if(!i)return;const r=this.m_layer.name,n=null!==(e=this.m_layer.extent)&&void 0!==e?e:4096,s=[];this.m_geometryCommands.accept(t.geometry,{type:"Point",visitCommand:t=>{(0,u.isMoveToCommand)(t)&&s.push(new o.Vector3(t.position.x,t.position.y,0))}}),0!==s.length&&this.m_processor.processPointFeature(r,n,s,i,y(t,i,m))}visitLineFeature(t){var e;if(void 0===t.geometry)return;const i=this.filterAndModifyFeature(t,"doProcessLineFeature","wantsLineFeature");if(!i)return;const r=this.m_layer.name,n=null!==(e=this.m_layer.extent)&&void 0!==e?e:4096,o=[];let s;this.m_geometryCommands.accept(t.geometry,{type:"Line",visitCommand:t=>{(0,u.isMoveToCommand)(t)?(s=[t.position],o.push({positions:s})):(0,u.isLineToCommand)(t)&&s.push(t.position)}}),0!==o.length&&(this.mustRoundUpCoordinates&&function(t,e){t.forEach(t=>_(t.positions,e))}
2(o,n),this.m_processor.processLineFeature(r,n,o,i,y(t,i,m)))}visitPolygonFeature(t){var e;if(void 0===t.geometry)return;const i=this.filterAndModifyFeature(t,"doProcessPolygonFeature","wantsPolygonFeature");if(!i)return;const r=this.m_layer.name,o=null!==(e=this.m_layer.extent)&&void 0!==e?e:4096,s=[];let a,l,c;this.m_geometryCommands.accept(t.geometry,{type:"Polygon",visitCommand:t=>{if((0,u.isMoveToCommand)(t))l=[t.position];else if((0,u.isLineToCommand)(t))l.push(t.position);else if((0,u.isClosePathCommand)(t)&&void 0!==l&&l.length>0){const t=Math.sign(n.ShapeUtils.area(l));void 0===c&&(c=t),t===c&&(a={rings:[]},s.push(a)),l.push(l[0].clone()),null==a||a.rings.push(l)}}}),0!==s.length&&(this.mustRoundUpCoordinates&&function(t,e){t.forEach(t=>t.rings.forEach(t=>_(t,e)))}(s,o),function(t){const e=t[0];if(void 0!==e&&0!==e.rings.length&&!(n.ShapeUtils.area(e.rings[0])>0))for(const e of t)for(const t of e.rings)t.reverse()}(s),this.m_processor.processPolygonFeature(r,o,s,i,y(t,i,m)))}filterAndModifyFeature(t,e,i){const n=this.m_tileKey.level,o=this.m_layer.name,a=v(t);if(this.m_dataFilter&&!1===this.m_dataFilter[i](o,a,n))return;const l=function(t,e){const i=new u.FeatureAttributes,n={};return i.accept(t,e,{visitAttribute:(t,e)=>(n[t]=function(t){const e=Object.prototype.hasOwnProperty;for(const i of d)if(e.call(t,i)){const e=t[i];if(void 0===e)throw new Error("unpexted undefined value");return r.isLong(e)?e.comp(f)>0||e.comp(g)<0?e.toString():e.toNumber():e}throw new Error("not happening")}(e),!0)}),n}(this.m_layer,t),c=new s.MapEnv(l);return this.m_featureModifiers&&this.m_featureModifiers.find(t=>!t[e](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:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WebTileDataSource=void 0;const r=i(5185),n=i(2616),o=i(2344),s=i(1984),a=i(4342),l=i(1527);class c extends o.DataSource{constructor(t){var e,i,r,n,o,s;super(t),this.m_options=t,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===(e=this.m_options.renderingOptions)||void 0===e?void 0:e.opacity)&&void 0!==i?i:1,this.m_transparent=!0===(null===(r=this.m_options.renderingOptions)||void 0===r?void 0:r.transparent)||this.m_opacity<1,this.m_renderOrder=null!==(o=null===(n=this.m_options.renderingOptions)||void 0===n?void 0:n.renderOrder)&&void 0!==o?o:0,this.m_resolution=(0,a.getOptionValue)(t.resolution,c.resolutionValue.resolution512),this.layerNames=null!==(s=t.layerNames)&&void 0!==s?s:["raster"]}canProvideIconText(){return!1}set opacity(t){var e;this.m_opacity=t,this.m_opacity<1?this.m_transparent=!0:!0!==(null===(e=this.m_options.renderingOptions)||void 0===e?void 0:e.transparent)&&(this.m_transparent=!1)}get opacity(){return this.m_opacity}get resolution(){return this.m_resolution}get renderOrder(){return this.m_renderOrder}get transparent(){return this.m_transparent}get technique(){return this.m_technique}shouldPreloadTiles(){return!0}getTilingScheme(){return n.webMercatorTilingScheme}getTile(t){const e=new o.Tile(this,t);return e.tileLoader=new l.WebTileLoader(this,e,this.dataProvider),e}isFullyCovering(){return!this.m_transparent}async setTheme(t,e){t=await o.ThemeLoader.load(t,{baseUrl:e});const i=(0,s.getStyles)(t.styles).filter(t=>{var e;return!t.layer||(null===(e=this.layerNames)||void 0===e?void 0:e.includes(t.layer))});if(i.length>0){this.m_styleSetEvaluator=new r.StyleSetEvaluator({styleSet:i,definitions:t.definitions,priorities:t.priorities,labelPriorities:t.labelPriorities});const e=this.m_styleSetEvaluator.getMatchingTechniques(this.mapView.env);if(0===e.length)return;const n=e[e.length-1];(0,s.isRasterTechnique)(n)&&(this.m_technique=n)}}}e.WebTileDataSource=c,function(t){let e,i;!function(t){t[t.ppi72=72]="ppi72",t[t.ppi250=250]="ppi250",t[t.ppi320=320]="ppi320",t[t.ppi500=500]="ppi500"}(e=t.ppiValue||(t.ppiValue={})),function(t){t[t.resolution256=256]="resolution256",t[t.resolution512=512]="resolution512"}(i=t.resolutionValue||(t.resolutionValue={}))}(c=e.WebTileDataSource||(e.WebTileDataSource={}))},1527:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.WebTileLoader=void 0;const r=i(6271),n=i(8152),o=i(2344),s=i(8024),a=i(176),l=i(4250);class c extends o.BaseTileLoader{constructor(t,e,i){super(t,e.tileKey),this.dataSource=t,this.tile=e,this.dataProvider=i}loadImpl(t,e,i){this.dataProvider.getTexture(this.tile,t).then(t=>{if(void 0===t||void 0===t[0])return this.tile.forceHasGeometry(!0),void e(o.TileLoaderState.Ready);const[i,c]=t;void 0!==c&&(this.tile.copyrightInfo=c),i.minFilter=r.LinearFilter,i.magFilter=r.LinearFilter,i.generateMipmaps=!1,this.tile.clear();const h=(0,s.addGroundPlane)(this.tile,this.dataSource.renderOrder,16777215,this.dataSource.opacity,!0).material;(0,l.hasColorCorrectionFeature)(h)&&a.MapMaterialAdapter.create(h,{brightness:()=>{var t,e;const i=null!==(e=(0,n.getPropertyValue)(null===(t=this.dataSource.technique)||void 0===t?void 0:t.brightness,this.dataSource.mapView.env))&&void 0!==e?e:l.ColorCorrectionFeature.DEFAULT_BRIGHTNESS;return parseFloat(i).toFixed(3)},gamma:()=>{var t,e;const i=null!==(e=(0,n.getPropertyValue)(null===(t=this.dataSource.technique)||void 0===t?void 0:t.gamma,this.dataSource.mapView.env))&&void 0!==e?e:l.ColorCorrectionFeature.DEFAULT_GAMMA;return parseFloat(i).toFixed(3)}}),i.encoding=r.LinearEncoding,h.map=i,this.dataSource.transparent&&(0,l.enableBlending)(h),h.depthTest=!1,this.tile.invalidateResourceInfo(),this.dataSource.requestUpdate(),e(o.TileLoaderState.Ready)},i).catch(i)}}e.WebTileLoader=c},9636:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Style=void 0;const r=i(6586);class n extends H.map.render.Style{constructor(t){super(t),this.m_abortController=new AbortController,"string"!=typeof t?this.setConfig(Object.assign({},t)):this.m_url=new URL(t,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 t=this.getConfig();if(void 0!==(null==t?void 0:t.features)){const e=[];for(const i in t.features){const{defaultMode:r}=t.features[i];"none"!==r&&e.push({feature:i,mode:r})}this.m_enabledFeatures=e}else this.m_enabledFeatures=void 0}
2async loadAsync(t,e){if(!e||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 e=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=r.load(this.m_url,{baseUrl:e,signal:i});const n=await this.m_loadPromise;this.setConfig(n),this.setState(H.map.render.Style.State.READY),this.setFeaturesEnabledByDefault(),t||this.dispatchChangeEvent()}catch(t){(null==i?void 0:i.aborted)||(this.setState(H.map.render.Style.State.ERROR),this.dispatchError(t))}}else this.setState(H.map.render.Style.State.READY),this.setFeaturesEnabledByDefault(),t||this.dispatchChangeEvent()}}setEnabledFeatures(t){const e=Object.assign({},this.m_enabledFeatures);if(void 0!==t){if(new Set(t.map(t=>t.feature)).size!==t.length)throw new H.lang.InvalidArgumentError(this.setEnabledFeatures,0,"The list of features to enable should not contain duplicates.");this.m_enabledFeatures=t.filter(t=>t.mode&&"none"!==t.mode)}else this.getState()===H.map.render.Style.State.READY&&this.setFeaturesEnabledByDefault();this.dispatchChangeEvent({enabledFeatures:this.m_enabledFeatures},{enabledFeatures:e})}getEnabledFeatures(){return this.m_enabledFeatures}disposeInternal(){super.disposeInternal(),this.cancelLoad()}dispatchChangeEvent(t,e){this.dispatchEvent(new H.util.ChangeEvent("change",t,e))}}e.Style=n},159:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImageLoader=void 0,e.ImageLoader=class{constructor(t){this.mapView=t,this.m_textureReferenceCounts=new Map,this.m_tilesWithRefs=new Set}setImageReferences(t,e=[]){this.m_textureReferenceCounts.forEach((i,r)=>{e.includes(r)||i.delete(t)&&0===i.size&&(this.mapView.imageRepo.imageCache.removeImage(this,r),this.m_textureReferenceCounts.delete(r))}),e.forEach(e=>{const i=this.m_textureReferenceCounts.get(e);void 0!==i?i.add(t):this.m_textureReferenceCounts.set(e,new Set([t]))}),e.length?this.m_tilesWithRefs.add(t):this.m_tilesWithRefs.delete(t)}releaseImageReferences(t){this.m_tilesWithRefs.has(t)&&this.setImageReferences(t)}dispose(){this.m_textureReferenceCounts.forEach((t,e)=>{this.mapView.imageRepo.imageCache.removeImage(this,e)}),this.m_textureReferenceCounts.clear()}load(t,e){void 0===this.mapView.imageRepo.imageCache.findImage(t)&&this.mapView.imageRepo.imageCache.registerImageByUrl(this,t,e)}}},7564:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LayeredGeoJsonDataAdapter=void 0;const r=i(5156);e.LayeredGeoJsonDataAdapter=class{constructor(){this.m_geoJsonDataAdapter=new r.GeoJsonDataAdapter}canProcess(t){return!0}
2process(t,e,i){"FeatureCollection"===t.data.type&&(t.data={geojson:t.data});const r=t.data;for(const t in r){const n=r[t];this.m_geoJsonDataAdapter.canProcess(n)&&this.m_geoJsonDataAdapter.process(n,e,i,t)}}}},1881:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LocalObjectDataAdapter=e.DEFAULT_BORDER=e.DEFAULT_EXTENTS=e.MAX_LINE_WIDTH=void 0;const r=i(2616),n=i(4342),o=i(7316),s=i(5448),a=i(6815),l=i(9776),c=i(6441),h=i(5432),u=i(6112),p=n.LoggerManager.instance.create("harp::LocalObjectDataAdapter");e.MAX_LINE_WIDTH=100,e.DEFAULT_EXTENTS=4096,e.DEFAULT_BORDER=e.DEFAULT_EXTENTS*e.MAX_LINE_WIDTH/512,e.LocalObjectDataAdapter=class{canProcess(t){return"object"==typeof t&&"markers"in t&&"spatials"in t&&"overlays"in t}process(t,e,i){this.processMarkers(t.markers,e,i),this.processSpatials(t.spatials,e,i),this.processOverlays(t.overlays,e,i)}processMarkers(t,i,r){t.forEach((t,n)=>{var s;const a=(0,o.getMarkerProperties)(t);if(null!==a){a.zOrder=null!==(s=t.getZIndex())&&void 0!==s?s:n;const o=t.getGeometry();let l,c=a.id;o instanceof H.geo.Point?l=[g(o,i)]:(c=void 0,l=o.getGeometries().map(t=>g(t,i))),r.processPointFeature("markers",e.DEFAULT_EXTENTS,l,a,c)}})}processSpatials(t,i,s){const a="spatials";t.forEach((t,l)=>{var c;const h={id:t.getId(),minZoom:t.getMin(!0),maxZoom:t.getMax(!0)+1,zOrder:l,volatile:t.getVolatility()},u=null!==(c=t.getStyle().lineWidth)&&void 0!==c?c:0;Object.assign(h,(0,o.getSpatialProperties)(t));const p=t.getId();if(t instanceof H.map.Polygon){const o=t.getElevation(),l=t.getExtrusion();if(h.min_height=o,h.height=o+l,h.height>0){h.lineWidth=n.MathUtils.clamp(u,0,1);const e=i.targetProjection;if(e.type===r.ProjectionType.Planar&&(h.constantHeight=h.height>2e3,!0===h.constantHeight)){const{lat:i,lng:r}=t.getBoundingBox().getCenter(),n=e.projectPoint({latitude:i,longitude:r}),o=e.getScaleFactor(n);h.min_height*=o,h.height*=o}}const c=function(t,e){if(t instanceof H.geo.MultiPolygon){const i=[],r=t.getGeometries();for(const t of r){const r=b(t,e);i.push(...r)}return i}return b(t,e)}(t.getGeometry(),i);s.processPolygonFeature(a,e.DEFAULT_EXTENTS,c,h,p)}else{const r=function(t,e){if(t instanceof H.geo.MultiLineString){const i=[];for(const r of t.getGeometries())i.push(..._(r,e));return i}return _(t,e)}(t.getGeometry(),i);r.length>0&&s.processLineFeature(a,e.DEFAULT_EXTENTS,r,h,p)}})}processOverlays(t,i,r){t.forEach((t,n)=>{const o=t.getGeometry().getBoundingBox(),s={id:t.getId(),minZoom:t.getMin(!0),maxZoom:t.getMax(!0)+1,zOrder:n,opacity:t.getOpacity(),min_height:0,height:0,volatile:t.getVolatility(),bbox:[o.getLeft(),o.getBottom(),o.getRight(),o.getTop()]},a=t.getBitmap();if(null===a)return;if(a instanceof HTMLImageElement)s.map=a.src;else{const t=a.getContext("2d");if(null===t)return void p.error("Cannot get context from canvas");s.map={buffer:t.getImageData(0,0,a.width,a.height).data.buffer,type:"image/raw",dataTextureProperties:{width:a.width,height:a.height}}}const l=b(H.geo.Polygon.fromRect(t.getGeometry()),i);r.processPolygonFeature("overlays",e.DEFAULT_EXTENTS,l,s,t.getId())})}};const d=new a.Vector3,m=new r.GeoCoordinates(0,0);function f(t,i,n=new a.Vector3){return(0,c.world2tile)(e.DEFAULT_EXTENTS,i,r.webMercatorProjection.projectPoint(t,d),!1,n)}function g(t,e,i=new a.Vector3){return m.latitude=t.lat,m.longitude=t.lng,m.altitude=t.alt,f(m,e,i)}function y(t,e){const i=t.getLatLngAltArray(),r=[];for(let t=0;t<i.length;t+=3)m.latitude=i[t],m.longitude=i[t+1],m.altitude=i[t+2],r.push(f(m,e,new s.Vector2));return r}function v(t,e,i=!1){return t.map(t=>(m.longitude=t[0],m.latitude=t[1],m.altitude=t[2],f(m,e,new s.Vector2)))}function _(t,i){let r;if((0,h.isCrossingAntimeridian)(t)){const e=[];(0,h.wrapGeoLineString)(t,e),r=e.map(t=>v(t,i))}else r=[y(t,i)];const n=[];for(const t of r){const i=(0,u.clipLineString)(t,-e.DEFAULT_BORDER,-e.DEFAULT_BORDER,e.DEFAULT_EXTENTS+e.DEFAULT_BORDER,e.DEFAULT_EXTENTS+e.DEFAULT_BORDER);for(const t of i)n.push({positions:H.math.simplifyDP(t,5)})}return n}function b(t,e){if((0,h.isCrossingAntimeridian)(t)){const i=[];return(0,h.wrapGeoPolygon)(t,i),i.map(t=>({rings:t.map(t=>v(t,e))}))}{const i=t.getExterior(),r=t.getInteriors(),n=[],o=y(i,e);let s=l.ShapeUtils.area(o)>0;s||o.reverse(),n.push(o);for(const t of r){const i=y(t,e);s=l.ShapeUtils.area(i)>0,s&&i.reverse(),n.push(i)}return[{rings:n}]}}},9049:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.LocalObjectDataProvider=void 0;const r=i(2754),n=i(6815),o=i(2730),s=i(1881),a=i(3261),l=new r.Box3,c=1/s.DEFAULT_EXTENTS;function h(t,e){return H.map.Object.compareZInfo(t.getZInfo(),e.getZInfo(),!1)}class u extends a.ObjectDataProvider{constructor(t){super(t),this.provider=t}async getTile(t,e){const i=this.m_tilingScheme.getGeoBox(t),r=(0,o.getClampedGeoRect)(i,t),n=(0,o.getClampedGeoRect)(p(this.m_tilingScheme,this.m_tilingScheme.getWorldBox(t,l),.1),t),s=(0,o.getClampedGeoRect)(p(this.m_tilingScheme,this.m_tilingScheme.getWorldBox(t,l),c),t);return{markers:this.provider.providesMarkers()?this.fetchMarkers(t,s):[],spatials:this.provider.providesSpatials()?this.fetchSpatials(t,n):[],overlays:this.provider.providesOverlays()?this.fetchOverlays(r):[]}}fetchMarkers(t,e){const i=[],r=[],n=this.getMarkerImageLoader(),o=this.provider.requestMarkers(e,void 0,!0,!1);for(const t of o){const e=t.getIcon();if(e.getState()===H.map.Icon.State.READY){const o=`H-icon-${e.uid}`;r.push(o),n.load(o,e.getBitmap()),i.push(t)}}return n.setImageReferences(t,r),i.sort(h),i}fetchSpatials(t,e){const i=this.provider.requestSpatials(e,void 0,!0,!1),r=[],n=this.getSpatialImageLoader();for(const t of i){const e=t.getStyle().lineDashImage;if(void 0!==e){const i=`H-lineDashImage-${t.getId()}`;r.push(i),n.load(i,e)}}return n.setImageReferences(t,r),i.sort(h)}fetchOverlays(t){return this.provider.requestOverlays(t,void 0,!0,!1).sort(h)}}function p(t,e,i){const r=new n.Vector3,o=e.getSize(r).multiplyScalar(i);return o.z=0,e.expandByVector(o),t.projection.unprojectBox(e)}e.LocalObjectDataProvider=u},2497:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LocalObjectDataSource=void 0;const r=i(1930),n=i(1503),o=i(2754),s=i(6815),a=i(2730),l=i(4262),c=i(1881),h=i(9049),u=i(9310),p=i(8124),d=new o.Box3;class m extends u.ObjectDataSource{constructor(t,e){super(Object.assign(Object.assign({},t),{dataProvider:new h.LocalObjectDataProvider(e),tileFactory:new r.TileFactory(u.ObjectTile),addGroundPlane:!1,gatherFeatureAttributes:!0,decoder:new n.VectorTileDecoder(new c.LocalObjectDataAdapter)}),e),this.provider=e,this.m_invalidateAllTiles=!1,this.m_synced_at=H.map.provider.Invalidations.MARK_INITIAL,this.m_affectedBoundingBox=new o.Box3,this.m_affectedBoundingBoxNextWorld=new o.Box3,this.m_objects=new Map,this.m_volatileObjectsCount=0}getMapObjectById(t){return this.m_objects.get(t)}attach(t){super.attach(t),this.provider instanceof H.map.provider.LocalObjectProvider&&this.provider.getRootGroup().getObjects(!0).forEach(t=>{this.m_volatileObjectsCount+=t.getVolatility(!0)?1:0,this.m_objects.set(t.getId(),t)})}detach(t){this.m_objects.forEach((t,e)=>{t.getVolatility()&&(t instanceof H.map.Overlay?this.mapView.removeDynamicProperty(f(t)):t instanceof H.map.GeoShape&&this.removeStyleDynamicProps(t.getId()))}),this.m_volatileObjectsCount=0,super.detach(t)}setStyleDynamicProps(t,e){g.forEach(i=>this.mapView.setDynamicProperty(y(i,e),t[i]))}removeStyleDynamicProps(t){g.forEach(e=>this.mapView.removeDynamicProperty(y(e,t)))}dispose(){this.m_objects.clear(),super.dispose()}invalidateTiles(){const t=this.m_affectedBoundingBox.isEmpty();this.m_invalidateAllTiles||t?this.mapView.markTilesDirty(this):t||this.mapView.markTilesDirty(this,t=>this.isTileAffected(t)),this.m_affectedBoundingBox.makeEmpty(),this.m_affectedBoundingBoxNextWorld.makeEmpty(),this.m_invalidateAllTiles=!1}isTileAffected(t){return this.getTilingScheme().getWorldBox(t.tileKey,d),d.expandByScalar(this.mapView.pixelToWorld*c.MAX_LINE_WIDTH),d.intersectsBox(this.m_affectedBoundingBox)||!this.m_affectedBoundingBoxNextWorld.isEmpty()&&d.intersectsBox(this.m_affectedBoundingBoxNextWorld)}onProviderUpdate(t){if(this.isDetached())return;if(t.target===this.provider)return this.m_invalidateAllTiles=!0,void this.invalidateTiles();const e=t.target,i=this.m_synced_at,r=t.currentTarget.getInvalidations(e.type);if(this.m_synced_at=r.getMark(),e instanceof H.map.Marker&&e.getIcon().getState()===H.map.Icon.State.READY||e instanceof H.map.GeoShape||e instanceof H.map.Overlay){if(r.isRemove(i)?(this.m_objects.delete(e.getId()),e.getVolatility()&&(this.m_volatileObjectsCount--,e instanceof H.map.Overlay?this.mapView.removeDynamicProperty(f(e)):e instanceof H.map.GeoShape&&this.removeStyleDynamicProps(e.getId()))):(this.m_objects.get(e.getId())?r.isVolatility(i)&&(this.m_volatileObjectsCount+=e.getVolatility(!0)?1:-1):(r.isVisual(i)&&e instanceof H.map.Marker||r.isAdd(i))&&e.getVolatility(!0)&&this.m_volatileObjectsCount++,this.m_objects.set(e.getId(),e)),r.isSpatial(i))return this.m_invalidateAllTiles=!0,void this.invalidateTiles();if(e instanceof H.map.GeoShape&&!e.getVolatility()&&r.isVolatility(i)&&(0,l.default)(()=>this.removeStyleDynamicProps(e.getId()),this.invalidationDebounceTime,this.invalidationMaxTime),e.getVolatility()&&(r.isAdd(i)||r.isVisual(i)||r.isVolatility(i)))if(e instanceof H.map.Overlay){const t=f(e),i=e.getBitmap(),r=this.mapView.env.lookup(t);
2if(null!==i&&r!==i&&(this.mapView.setDynamicProperty(t,i),void 0!==r))return}else if(e instanceof H.map.GeoShape){const t=e.getStyle(),n=e.getId();if(this.setStyleDynamicProps(t,n),r.isVisual(i))return}if(!this.m_invalidateAllTiles){const t=e instanceof H.map.Marker||e instanceof H.map.Overlay?e.getGeometry().getBoundingBox():e.getBoundingBox(),i=(0,a.hGeoRectToHarpGeoBox)(t);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 o.Box3(this.m_affectedBoundingBox.min.clone().add(new s.Vector3(-r,0,0)),this.m_affectedBoundingBox.max.clone().add(new s.Vector3(-r,0,0))))}this.invalidateTilesWithDelay()}}get taskQueue(){return 0===this.m_volatileObjectsCount?super.taskQueue:void 0}}function f(t){return`${p.ObjectStyleBuilder.DYNAMIC_OVERLAY_PROP_PREFIX}${t.getId()}`}e.LocalObjectDataSource=m;const g=["fillColor","strokeColor","lineWidth"];function y(t,e){return`${t}:${e}`}},3261:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ObjectDataProvider=void 0;const r=i(8635);class n extends r.DataProvider{constructor(t){super(),this.provider=t}setTilingScheme(t){this.m_tilingScheme=t}setProjectionSource(t){this.m_projectionSource=t}getProjectionSource(){return this.m_projectionSource}setMarkerImageLoader(t){this.m_markerImageLoader=t}getMarkerImageLoader(){return this.m_markerImageLoader}setSpatialImageLoader(t){this.m_spatiaImageLoader=t}getSpatialImageLoader(){return this.m_spatiaImageLoader}async connect(){}dispose(){var t,e;null===(t=this.m_markerImageLoader)||void 0===t||t.dispose(),null===(e=this.m_spatiaImageLoader)||void 0===e||e.dispose()}ready(){return void 0!==this.m_markerImageLoader&&void 0!==this.m_spatiaImageLoader}}e.ObjectDataProvider=n},9310:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ObjectTile=e.ObjectDataSource=void 0;const r=i(159),n=i(1447),o=i(1930),s=i(3436),a=i(4262);class l extends s.VectorTileDataSource{constructor(t,e){super(Object.assign(Object.assign({},t),{tileFactory:new o.TileFactory(c),addGroundPlane:!1,layerNames:[`H-${e.uid}`],gatherFeatureAttributes:!0})),this.provider=e,this.m_tileInvalidationPending=!1,this.invalidationDebounceTime=100,this.invalidationMaxTime=200,this.isDisposed=!1,e.addEventListener("update",this.onProviderUpdate,!1,this),this.debounceTileInvalidation=(0,a.default)(()=>{this.m_tileInvalidationPending=!1,this.isDisposed||this.invalidateTiles()},this.invalidationDebounceTime,this.invalidationMaxTime)}attach(t){super.attach(t);const e=this.dataProvider();e.setMarkerImageLoader(new r.ImageLoader(t)),e.setSpatialImageLoader(new r.ImageLoader(t)),e.setTilingScheme(this.getTilingScheme()),e.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()}}e.ObjectDataSource=l;class c extends n.Tile{dispose(){super.dispose(),this.dataSource.dataProvider().getMarkerImageLoader().releaseImageReferences(this.tileKey)}get allGeometryLoaded(){return super.allGeometryLoaded&&!this.dataSource.tileInvalidationPending}}e.ObjectTile=c},8124:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ObjectStyleBuilder=void 0;const r=i(1984);class n{constructor(t){this.layerName=t,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(t=!1){return this.m_withLine=!0,this.m_shouldClipLines=t,this}withOverlay(){return this.m_withOverlay=!0,this}withPolygon(t=!1,e=!1,i=!1){return this.m_withPolygon=!0,this.m_withPolygonOutline=t,this.m_withExtrudedPolygon=e,this.m_withPolygonAlwaysPickable=i,this}build(){const t=[],e={layer:this.layerName,attr:{minZoomLevel:["case",!0,["get","minZoom"],["zoom"]],maxZoomLevel:["get","maxZoom"]}};if(this.m_withMarker){const i=o(e,{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"]}});t.push(i)}if(this.m_withLine){const i=o(e,{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}}),r=o(i,{when:["all",["==",["geometry-type"],"LineString"],["has","dashes"]],technique:"solid-line",attr:{color:["case",["has","dashImage"],"#0000",["get","strokeColor"]],"dash-gap-color":"#0000","dash-image-color":["get","strokeColor"],clipping:this.m_shouldClipLines,dashes:["get","dashes"],"dash-pattern":["get","dashPattern"],"dash-image":["get","dashImage"]}});if(t.push(i,r),this.m_withVolatile){const e=o(i,{when:["all",["==",["geometry-type"],"LineString"],["!has","dashPattern"],["get","volatile"]],attr:{color:["get",["concat","strokeColor:",["get","id"]],["dynamic-properties"]
2],width:["concat",["get",["concat","lineWidth:",["get","id"]],["dynamic-properties"]],"px"]}});t.push(e)}}const i=["==",["get","height"],0];if(this.m_withOverlay){const s=o(e,{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:r.TextureCoordinateType.FeatureSpace,color:16777215,opacity:["get","opacity"],transparent:!0}});if(t.push(s),this.m_withVolatile){const e=o(s,{when:["all",["==",["geometry-type"],"Polygon"],i,["has","map"],["get","volatile"]],attr:{map:["get",["concat",n.DYNAMIC_OVERLAY_PROP_PREFIX,["get","id"]],["dynamic-properties"]]}});t.push(e)}}if(this.m_withPolygon){const n=o(e,{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&&(n.transient=r.Pickability.all),t.push(n),this.m_withPolygonOutline){const n=o(e,{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"]}}),s=o(n,{when:["all",["==",["geometry-type"],"Polygon"],i,["!has","map"],["has","dashes"]],technique:"solid-line",attr:{clipping:!0,color:["case",["has","dashImage"],"#0000",["get","strokeColor"]],"dash-gap-color":"#0000","dash-image-color":["get","strokeColor"],dashes:["get","dashes"],"dash-pattern":["get","dashPattern"],"dash-image":["get","dashImage"]}});if(this.m_withPolygonAlwaysPickable&&(n.transient=r.Pickability.all,s.transient=r.Pickability.all),t.push(n,s),this.m_withVolatile){const e=o(n,{when:["all",["==",["geometry-type"],"Polygon"],i,["!has","map"],["!has","dashes"],["get","volatile"]],attr:{color:["get",["concat","strokeColor:",["get","id"]],["dynamic-properties"]],visible:["get",["concat","strokeColor:",["get","id"]],["dynamic-properties"]],width:["concat",["get",["concat","lineWidth:",["get","id"]],["dynamic-properties"]],"px"]}});t.push(e)}}if(this.m_withExtrudedPolygon){const i=o(e,{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=r.Pickability.all),t.push(i)}if(this.m_withVolatile){const e=o(n,{when:["all",["==",["geometry-type"],"Polygon"],i,["!has","map"],["get","volatile"]],attr:{color:["get",["concat","fillColor:",["get","id"]],["dynamic-properties"]],visible:["get",["concat","fillColor:",["get","id"]],["dynamic-properties"]]}});t.push(e)}}return{styles:t}}}function o(t,e){const i=Object.assign(Object.assign({},t),e);return i.attr=Object.assign(Object.assign({},t.attr),e.attr),i}e.ObjectStyleBuilder=n,n.DYNAMIC_OVERLAY_PROP_PREFIX="overlay-image"},6724:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ObjectTileDataProvider=void 0;const r=i(3261),n=i(7316);class o extends r.ObjectDataProvider{constructor(t){super(t),this.provider=t,void 0!==H.service&&t instanceof H.service.extension.TileProvider&&t.setTileCanvasRendering(!1)}async getTile(t,e){if(void 0!==e&&e.addEventListener("abort",()=>{this.provider.cancelTile(t.column,t.row,t.level)}),this.provider.providesMarkers()){const e=this.getMarkerImageLoader();return await new Promise((i,r)=>{this.provider.requestTileAsPromise(t.column,t.row,t.level).then(r=>{const o=[],s=r.data,a=[];s.forEach(i=>{const r=(0,n.getMarkerProperties)(i);if(null!==r){const n=i.getIcon();if(n.getState()===H.map.Icon.State.READY){const t=r.imageTexture;o.push(t),e.load(t,n.getBitmap())}r.tileKey=t,a.push({type:"Feature",properties:r,geometry:i.getGeometry().toGeoJSON()})}}),e.setImageReferences(t,o),i({type:"FeatureCollection",features:a})},r)})}return this.provider.requestTileAsPromise(t.column,t.row,t.level)}}e.ObjectTileDataProvider=o},2464:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.ObjectTileDataSource=void 0;const r=i(9310),n=i(6724),o=i(1930),s=i(1447),a=i(1503),l=i(7564),c=i(7665);class h extends r.ObjectDataSource{constructor(t,e){super(u(Object.assign(Object.assign({},t),{addGroundPlane:!1,gatherFeatureAttributes:!0,dataProvider:new n.ObjectTileDataProvider(e)}),e),e),this.provider=e}ready(){return super.ready()&&this.provider.getStyleInternal().getState()===H.map.render.Style.State.READY}invalidateTiles(){this.mapView.markTilesDirty(this,({tileKey:t})=>{const e=this.provider.requestTile(t.column,t.row,t.level,!0);return void 0!==e&&!e.valid})}onProviderUpdate(t){var e;if(this.isDetached())return;if(t.target===this.provider)return void this.mapView.markTilesDirty(this);const i=t.target;(i instanceof H.map.Marker&&(null===(e=i.getIcon())||void 0===e?void 0:e.getState())===H.map.Icon.State.READY||i instanceof H.map.Spatial)&&this.invalidateTilesWithDelay()}}e.ObjectTileDataSource=h;const u=(t,e)=>{if(e.providesMarkers())t.tileFactory=new o.TileFactory(r.ObjectTile),t.decoder=new a.VectorTileDecoder;else if(e.providesSpatials())t.tileFactory=new o.TileFactory(s.Tile),t.decoder=new a.VectorTileDecoder(new c.SpatialObjectDataAdapter);else{if(!e.providesGeoJSON())throw Error('At least one of these provider\'s methods should return "true":\n providesMarkers(), providesSpatials(), providesGeoJSON()');t.tileFactory=new o.TileFactory(r.ObjectTile),t.decoder=new a.VectorTileDecoder(new l.LayeredGeoJsonDataAdapter)}return t}},2420:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isProviderAdapter=void 0,e.isProviderAdapter=function(t){return null!=t&&t.provider instanceof H.map.provider.Provider}},7665:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SpatialObjectDataAdapter=void 0;const r=i(5448),n=i(7316);e.SpatialObjectDataAdapter=class{canProcess(t){return!0}
2process(t,e,i){var r;const l="extensionSpatial",c=t.getObjects(),h=null!==(r=t.getTileSize())&&void 0!==r?r:o;c.forEach(e=>{const r=e.getGeometriesForTile(t);if(void 0!==r&&r.length>0){const t=e.getId();let o;const c=(0,n.getSpatialProperties)(e),u=e.isClosed();if(u?(o=function(t){const e=[];for(let i=0;i<t.length;i++){const r=t[i],n=r.paths,o=n.length,s=r.interiorsIndex,l=r.outlinesIndex;let c,h=Math.min(s,l,o);const u=[];for(let t=0;t<h;t++)c=[n[t].map(a)],u.push({rings:c});if(1===h){h=Math.min(l,o);for(let t=s;t<h;t++)c.push(n[t].map(a))}e.push(u)}return e}(r),c.height=0):o=s(r,!1),o.length>0)if(u){const e=Object.assign(Object.assign({},c),{lineWidth:0});o.forEach(r=>{i.processPolygonFeature(l,h,r,e,t)})}else i.processLineFeature(l,h,o,c,t);o=s(r,!0),o.length>0&&i.processLineFeature(l,h,o,c,t)}})}};const o=256;function s(t,e){const i=[];for(let r=0;r<t.length;r++){const n=t[r],o=e?n.outlinesIndex:0,s=e?n.paths.length:Math.min(n.interiorsIndex,n.outlinesIndex,n.paths.length);for(let t=o;t<s;t++)i.push({positions:n.paths[t].map(a)})}return i}function a(t){return new r.Vector2(t.x,t.y)}},3709:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VectorTileDataProvider=void 0;const r=i(8635);class n extends r.DataProvider{constructor(t){super(),this.provider=t}async getTile(t,e){return void 0!==e&&e.addEventListener("abort",()=>{this.provider.cancelTile(t.column,t.row,t.level)}),await new Promise((e,i)=>{this.provider.requestTileAsPromise(t.column,t.row,t.level).then(({data:t})=>{t instanceof ArrayBuffer&&e(t.slice(0,t.byteLength))},i)})}ready(){return!0}async connect(){return await Promise.resolve()}dispose(){}}e.VectorTileDataProvider=n},9470:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WebTileDataProvider=void 0;const r=i(394),n=[];e.WebTileDataProvider=class{constructor(t){this.provider=t}async getTexture(t,e){return void 0!==e&&e.addEventListener("abort",()=>{this.provider.cancelTile(t.tileKey.column,t.tileKey.row,t.tileKey.level)}),await new Promise((e,i)=>{this.provider.requestTileAsPromise(t.tileKey.column,t.tileKey.row,t.tileKey.level).then(({data:t})=>{null===t&&e(void 0);const i=new r.Texture(t);i.needsUpdate=!0,e([i,n])},i)})}}},5432:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isCrossingAntimeridian=e.wrapGeoLineString=e.wrapGeoPolygon=void 0;const r=i(8965),n=i(3997),o=i(4860);function s(t){const e=[],i=t.getLatLngAltArray();let r=0,n=0;for(let t=0,s=i.length;t<s;t+=3){const s=i[t];let a=i[t+1];const l=i[t+2];if(t>=3){a+=r;const t=Math.abs(a-n)>180?a>n?-360:360:0;n=a+=t,r+=t}else n=a;e.push(new o.GeoCoordinates(s,a,l))}return e}function a(t){const{left:e,middle:i,right:r}=t;return{left:null==e?void 0:e.map(l),middle:null==i?void 0:i.map(l),right:null==r?void 0:r.map(l)}}function l(t){return t.toGeoPoint()}e.wrapGeoPolygon=function(t,e){const i=s(t.getExterior()),n=a((0,r.wrapPolygon)(i)),o=t.getInteriors().map(t=>a((0,r.wrapPolygon)(s(t))));for(const t in n){if(void 0===n[t])continue;const i=[];o.forEach(e=>{void 0!==e[t]&&i.push(e[t])}),e.push([n[t],...i])}},e.wrapGeoLineString=function(t,e){const{left:i,middle:r,right:o}=(0,n.wrapLineString)(s(t));for(const t of[i,r,o])void 0!==t&&t.forEach(t=>{e.push(t.map(t=>t.toGeoPoint()))})},e.isCrossingAntimeridian=function(t){return t instanceof H.geo.LineString?t.getDBCs()>0:t.getExterior().getDBCs()>0}},7316:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getMarkerProperties=e.getSpatialProperties=void 0,e.getSpatialProperties=t=>{var e,n,o,s;const a=t.getStyle(),l=a.lineWidth,c={lineWidth:`${a.lineWidth}px`,lineJoin:"Round",strokeColor:r(a.strokeColor)};if(t.isClosed()?c.fillColor=r(a.fillColor):c.lineCap=i[a.lineCap],a.lineDash.length>1){const i=["make-vector",["pixel-world-scale",(null!==(e=a.lineDash[0])&&void 0!==e?e:0)*l],["pixel-world-scale",(null!==(n=a.lineDash[1])&&void 0!==n?n:0)*l]];a.lineDash.length>3&&i.push(["pixel-world-scale",(null!==(o=a.lineDash[2])&&void 0!==o?o:0)*l],["pixel-world-scale",(null!==(s=a.lineDash[3])&&void 0!==s?s:0)*l]),c.dashPattern=i,c.dashes="Square",void 0!==a.lineDashImage&&(c.dashImage=`H-lineDashImage-${t.getId()}`)}return c},e.getMarkerProperties=t=>{const e=t.getIcon();let i=null;if(e.getState()===H.map.Icon.State.READY){const{w:r,h:n}=e.getSize(),o=`H-icon-${e.uid}`,s=e.getAnchor();let a=0,l=0;
2void 0!==s&&(a=s.x,l=s.y),i={id:t.getId(),imageTexture:o,minZoom:t.getMin(!0),maxZoom:t.getMax(!0)+1,screenWidth:r,screenHeight:n,iconXOffset:r/2-a,iconYOffset:-(n/2-l)}}return i};const i={butt:"butt",square:"square",round:"round"},r=t=>{const e="none"===t;return e&&console.warn('Unsupported color value "none" converted to "rgba(0,0,0,0)"'),e?"rgba(0,0,0,0)":t}},8218:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.lights=void 0,e.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:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getDefaultTheme=e.DARK_THEME=e.DEFAULT_THEME=void 0;const r=i(8218),n=i(173),o={color:"#FFFFFF",startRatio:.7};e.DEFAULT_THEME={clearColor:"#FFFFFF",fog:o,sky:{type:"gradient",topColor:"#347BC0",bottomColor:"#EDF2F9",groundColor:"#FFFFFF"},lights:r.lights},e.DARK_THEME={clearColor:"#010608",fog:o,sky:{type:"gradient",topColor:"#010608",bottomColor:"#EDF2F9",groundColor:"#010608"},lights:r.lights},e.getDefaultTheme=(t=!1)=>(0,n.cloneDeep)(t?e.DARK_THEME:e.DEFAULT_THEME)},483:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Layers=void 0;const r=i(2972),n=i(9330),o=i(2497),s=i(9310),a=i(8124),l=i(2464),c=i(3709),h=i(9470),u=i(9636),p=i(5694),d=i(6667),m=i(8449),f=H.getStylePath()+"/harp/";function g(t){let e;return void 0!==H.service&&(t instanceof H.service.trafficVectorTile.Provider?e=["traffic_flow","incident_icons","traffic_incidents"]:t instanceof H.service.omv.Provider&&(e=["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"])),e}function y(t){return`H-${t.uid}`}e.Layers=class{constructor(t,e,i,r){this.mapView=t,this.dataModel=e,this.lookAtManipulator=i,this.surfaceFactory=r,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 v(e,this.m_dataSources),e.addEventListener("add",this.onAdd,!1,this),e.addEventListener("remove",this.onRemove,!1,this),e.addEventListener("set",this.onSet,!1,this),e.addEventListener("configchange",this.onConfigChange,!1,this),e.addEventListener("update",this.onUpdate,!1,this),this.resetDataSourceOrder=this.resetDataSourceOrder.bind(this);const n=[];e.asArray().forEach((t,e)=>{n.push(this.add(t,e))}),Promise.all(n).then(this.resetDataSourceOrder)}forEachRenderer(t){this.m_renderers.forEach((e,i)=>t(e,i))}dispose(){this.m_disposed=!0,this.dataModel.asArray().forEach((t,e)=>{this.removeMinMaxListeners(t),this.remove(t,e)}),this.m_renderers.forEach(t=>t.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((t,e)=>{const i=t.getProvider(),r=this.m_dataSources.get(i);void 0!==r&&(r.dataSourceOrder=e,i.providesOMV()&&(r.addGroundPlane=0===e))}),this.mapView.update()}sortSurfaces(){this.m_renderers.forEach(t=>{const e=t.getLayer();t.getSurface().setZIndex(this.dataModel.indexOf(e))})}createDataSource(t,e){var i;const s=t.getProvider(),p={name:e,minDisplayLevel:t.min,maxDisplayLevel:t.max,minDataLevel:s.min,maxDataLevel:s.max};let d;if(s instanceof H.map.provider.RemoteTileProvider){const t=s.getStyleInternal();if(!(t instanceof u.Style))throw new H.lang.IllegalOperationError(this.add,`Wrong style format for layer ${e}.`);if(this.m_disposed&&console.warn(new H.lang.IllegalOperationError(this.add,`Cannot add layer ${e}. The rendering engine has been disposed.`)),s.providesOMV()){let t;void 0!==H.service&&s instanceof H.service.omv.Provider&&(t=s.getPoliticalView(),s.addEventListener("politicalviewchange",this.onPoliticalViewChange,void 0,this)),d=new r.VectorTileDataSource(Object.assign(Object.assign({},p),{layerNames:null!==(i=g(s))&&void 0!==i?i:[y(s)],dataProvider:new c.VectorTileDataProvider(s),storageLevelOffset:-1,gatherFeatureAttributes:!0,politicalView:void 0!==t?t.toLowerCase():void 0,languages:void 0!==H.service&&s instanceof H.service.omv.Provider?s.getLanguages():void 0}))}else if(s.providesRasters())d=new n.WebTileDataSource(Object.assign(Object.assign({},p),{layerNames:[y(s)],dataProvider:new h.WebTileDataProvider(s),resolution:n.WebTileDataSource.resolutionValue[n.WebTileDataSource.resolutionValue[s.tileSize]],storageLevelOffset:this.mapView.pixelRatio<2&&s.tileSize>256?-1:0,renderingOptions:{opacity:s.getOpacityInternal(),transparent:!0}}));else if(s.providesSpatials()||s.providesMarkers()||s.providesGeoJSON()){d=new l.ObjectTileDataSource(p,s);let e=t.getConfig();if(void 0===e.styles){const t=new a.ObjectStyleBuilder(d.layerNames[0]);s.providesMarkers()?t.withMarker():s.providesSpatials()&&(t.withLine(!0),t.withPolygon()),e=t.build();const i=new u.Style(e);i.setState(H.map.render.Style.State.READY),s.setStyleInternal(i,!0)}}}else if(s instanceof H.map.provider.ObjectProvider){s.setEngineType(H.Map.EngineType.HARP),d=new o.LocalObjectDataSource(p,s);const t=new a.ObjectStyleBuilder(d.layerNames[0]).withMarker().withLine(!1).withPolygon(!0,!0).withOverlay().withVolatile().build(),e=new u.Style(t);e.setState(H.map.render.Style.State.READY),s.setStyleInternal(e,!0)}return d}async add(t,e){const i=t.getProvider();this.addMinMaxListeners(t),0===e&&this.adjustZoomConstraints();const r=`H-${null==i?void 0:i.uid}`;let n=!1;
2if(function(t){return void 0!==t.requestDomMarkers}(t)){const e=new H.map.render.dom.MarkerRenderer(t);e.setSurface(this.surfaceFactory.createDOMSurface()),this.m_renderers.push(e);const i=this.dataModel.asArray();this.m_renderers.sort((t,e)=>i.indexOf(t.getLayer())-i.indexOf(e.getLayer())),n=!0,this.sortSurfaces()}const o=this.createDataSource(t,r);void 0!==o?(this.m_dataSources.set(i,o),this.mapView.addDataSource(o),await this.setTheme()):n||console.warn(new H.lang.IllegalOperationError(this.add,`Layer ${r} is not supported.`))}remove(t,e){for(let e=0;e<this.m_renderers.length;e++)if(this.m_renderers[e].getLayer()===t){this.m_renderers[e].dispose(),this.m_renderers.splice(e,1);break}const i=t.getProvider(),r=this.m_dataSources.get(i);if(void 0!==r){this.mapView.removeDataSource(r),r.dispose(),this.m_dataSources.delete(i);const t=i.getStyleInternal();t instanceof u.Style&&t.cancelLoad(),this.setTheme()}0===e&&this.removeMinMaxListeners(t),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(t){if(t.removed instanceof H.map.layer.Layer){this.m_isSetLayerOngoing=!0;try{this.remove(t.removed,t.idx)}catch(t){throw this.m_isSetLayerOngoing=!1,t}}t.added instanceof H.map.layer.Layer&&await this.add(t.added,t.idx),this.m_isSetLayerOngoing=!1,this.resetDataSourceOrder()}onUpdate(t){const e=t.target.getProvider();if(this.m_dataSources.has(e)){const t=this.m_dataSources.get(e);t instanceof s.ObjectDataSource||(this.mapView.markTilesDirty(t),t instanceof n.WebTileDataSource&&e.providesRasters()&&(t.opacity=e.getOpacityInternal())),this.mapView.update()}}onAdd(t){this.add(t.added,t.idx).then(this.resetDataSourceOrder)}onRemove(t){this.remove(t.removed,t.idx),this.resetDataSourceOrder()}onPoliticalViewChange(t){void 0!==H.service&&t.target instanceof H.service.omv.Provider&&this.m_dataSources.get(t.target).setPoliticalView(t.newValue.toLowerCase())}adjustZoomConstraints(){const t=this.dataModel.asArray(),{min:e,max:i}=p.default.lookAt.zoom;t.length>0?this.lookAtManipulator.setZoomConstraints(Math.max(e,t[0].min),Math.min(i,t[0].max)):this.lookAtManipulator.setZoomConstraints(e,i);const r=this.mapView.zoomLevel,n=this.lookAtManipulator.clampZoom(r);n!==r&&(this.mapView.zoomLevel=n)}onMinMaxChange(t){const e=t.target;e===this.dataModel.get(0)&&this.adjustZoomConstraints();const i=this.m_dataSources.get(e.getProvider());i&&("minchange"===t.type?i.minDisplayLevel=t.newValue:i.maxDisplayLevel=Math.floor(t.newValue)+1-1e-12)}addMinMaxListeners(t){t.addEventListener("minchange",this.onMinMaxChange,!1,this),t.addEventListener("maxchange",this.onMinMaxChange,!1,this)}removeMinMaxListeners(t){t.removeEventListener("minchange",this.onMinMaxChange,!1,this),t.removeEventListener("maxchange",this.onMinMaxChange,!1,this)}onConfigChange(t){var e;if(t.target instanceof H.map.layer.Layer){const i=this.m_dataSources.get(t.target.getProvider());(null===(e=t.newValue)||void 0===e?void 0:e.hasOwnProperty("enabledFeatures"))?i instanceof m.TileDataSource&&(i.enabledFeatures=t.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 t=this.m_abortController.signal;try{const e=await this.m_themeManager.merge();t.throwIfAborted(),await this.mapView.setTheme(e,f)}catch(t){}}};class v{constructor(t,e){this.dataModel=t,this.dataSources=e,this.dark=void 0,this.m_uniqueStyles=new Map}async loadLayerTheme(t){var e;const i=t.getProvider(),r=null==i?void 0:i.getStyleInternal(),n=r.getState();if(!(r instanceof u.Style)||n===H.map.render.Style.State.ERROR)return;const o=this.dataSources.get(i);o instanceof m.TileDataSource&&(o.enabledFeatures=r.getEnabledFeatures());const s=null!==(e=r.getUrl())&&void 0!==e?e:JSON.stringify(r.getConfig()),a=this.m_uniqueStyles.get(s);if(void 0===a){this.m_uniqueStyles.set(s,r);const t=void 0===g(i);return await r.loadAsync(!1,!0).then(()=>
2{if(r.getState()!==H.map.render.Style.State.ERROR)return t?function(t,e){var i;const r=null!==(i=t.getConfig())&&void 0!==i?i:void 0;return void 0!==r&&t.getState()===H.map.render.Style.State.READY&&(Array.isArray(r.styles)&&r.styles.forEach(t=>{t.layer=e}),t.setConfig(r)),r}(r,y(i)):r.getConfig()})}n===H.map.render.Style.State.INIT&&a.loadAsync(!0,!0).then(()=>{r.setConfig(a.getConfig()),r.setState(a.getState())})}async merge(){this.m_uniqueStyles.clear();const t=this.dataModel.asArray();if(0===t.length)return this.dark=void 0,{};this.dark=t[0].dark;const e=t.map(async t=>await this.loadLayerTheme(t)),i=(await Promise.all(e)).filter(t=>void 0!==t);return{extends:[(0,d.getDefaultTheme)(this.dark),...i]}}}},9561:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LookAtManipulator=e.adjustHeading=void 0;const r=i(7220),n=i(2616),o=i(2344),s=i(5694),a=i(6815),l=i(3334),c=i(2730),h=i(1555);function u(t){return(180+t)%360}e.adjustHeading=u;class p{constructor(t,e){this.m_mapView=t,this.m_viewPort=e,this.camera=this.m_mapView.camera.clone()}update(){const{width:t,height:e,padding:i}=this.m_viewPort,r=this.m_mapView.camera,n=Math.max(1,t-i.left-i.right),s=Math.max(1,e-i.top-i.bottom);this.camera.copy(r),this.camera.aspect=n/s,o.CameraUtils.setPrincipalPoint(this.camera,{x:0,y:0});const l=(0,h.calculateNormalizedDeviceCoordinates)(i.left,i.top,t,e),c=new a.Vector3(l.x,l.y,-1).applyMatrix4(r.projectionMatrixInverse),u=2*Math.atan2(c.y,r.near);o.CameraUtils.setVerticalFov(this.camera,u,s),this.camera.updateProjectionMatrix()}get projection(){return this.m_mapView.projection}get tileWrappingEnabled(){return this.m_mapView.tileWrappingEnabled}}e.LookAtManipulator=class{constructor(t,e){this.mapView=t,this.m_viewPort=e,this.m_localTangentSpace={position:new a.Vector3,xAxis:new a.Vector3,yAxis:new a.Vector3,zAxis:new a.Vector3},this.m_boundsGenerator=new r.BoundsGenerator(this.mapView),this.m_paddedBoundsGenerator=this.m_boundsGenerator,this.setZoomConstraints(s.default.lookAt.zoom.min,s.default.lookAt.zoom.max),e.addEventListener("update",this.onViewPortUpdate,void 0,this),this.onViewPortUpdate()}
2getLookAtData(t=!1,e=!1){return(t||void 0===this.m_viewBounds)&&this.updateViewBounds(),{position:this.mapView.target.toLatLng(),zoom:this.mapView.zoomLevel,heading:u(this.mapView.heading),tilt:this.mapView.tilt,bounds:e?this.m_paddedViewBounds:this.m_viewBounds,incline:0}}setZoomConstraints(t,e){this.m_layerMinZoom=t,this.m_layerMaxZoom=e,this.mapView.minZoomLevel=t,this.mapView.maxZoomLevel=e,this.invalidateViewBounds()}clampValues(t){const{heading:e,tilt:i}=s.default.lookAt;if(void 0!==t.zoom&&(t.zoom=this.clampZoom(t.zoom)),void 0!==t.tilt&&(t.tilt=(0,l.clamp)(t.tilt,i.min,i.max)),void 0!==t.heading){const i=(t.heading%360+360)%360;t.heading=(0,l.clamp)(i,e.min,e.max)}}clampZoom(t){const{zoom:e}=s.default.lookAt;return(0,l.clamp)(t,Math.max(e.min,this.m_layerMinZoom),Math.min(e.max,this.m_layerMaxZoom))}lookAt(t){this.mapView.lookAt(Object.assign(Object.assign({},t),{padding:this.m_viewPort.padding})),this.invalidateViewBounds()}applyLookAtDelta(t,e,i,r,n){const a=this.mapView;if(r||n){const t=(0,l.degToRad)(s.default.lookAt.tilt.max);o.MapViewUtils.orbitAroundScreenPoint(this.mapView,{deltaTilt:(0,l.degToRad)(r),maxTiltAngle:t}),o.MapViewUtils.orbitAroundScreenPoint(this.mapView,{deltaAzimuth:(0,l.degToRad)(n),maxTiltAngle:t,center:e})}0!==i&&this.zoomAt(a.zoomLevel+i,e),this.moveLookAtByOffset(t.x,t.y),this.invalidateViewBounds()}moveLookAtByOffset(t,e){if(0===t&&0===e)return;const i=this.mapView.camera,r=this.mapView.projection,s=(0,l.degToRad)(this.mapView.heading),a=this.mapView.pixelToWorld,c=Math.cos(-s),h=Math.sin(-s),u=(t*c+e*h)*a,p=(e*c-t*h)*a;if(r.type===n.ProjectionType.Planar)i.position.x+=u,i.position.y-=p,this.clampCameraPosition();else{const t=o.MapViewUtils.getWorldTargetFromCamera(i,r);if(null===t)return;r.localTangentSpace(t,this.m_localTangentSpace);const e=this.m_localTangentSpace.xAxis,n=this.m_localTangentSpace.yAxis,s=t.clone();e.multiplyScalar(u),s.sub(e),n.multiplyScalar(p),s.add(n),o.MapViewUtils.panCameraAroundGlobe(this.mapView,t,s)}this.invalidateViewBounds()}setAngles(t,e){const i=s.default.lookAt.tilt;t=(0,l.clamp)(t,i.min,i.max);const{target:r,distance:n}=o.MapViewUtils.getTargetAndDistance(this.mapView.projection,this.mapView.camera,this.mapView.elevationProvider),a=this.mapView.projection.unprojectPoint(r);o.MapViewUtils.getCameraRotationAtTarget(this.mapView.projection,a,-e,t,this.mapView.camera.quaternion),o.MapViewUtils.getCameraPositionFromTarget(this.mapView.target,n,-e,t,this.mapView.projection,this.mapView.camera.position),this.invalidateViewBounds()}zoomAt(t,e){const i=this.clampZoom(t);this.mapView.zoomLevel!==i&&(o.MapViewUtils.zoomOnTargetPosition(this.mapView,e.x,e.y,i),this.invalidateViewBounds())}clampCameraPosition(){if(this.mapView.projection.type===n.ProjectionType.Spherical)return;const{target:t}=o.MapViewUtils.getTargetAndDistance(this.mapView.projection,this.mapView.camera,this.mapView.elevationProvider),e=this.mapView.projection.unprojectPoint(t),i=this.mapView.projection.projectPoint(e),r=i.x-t.x,s=i.y-t.y;this.mapView.camera.position.x+=r,this.mapView.camera.position.y+=s,this.invalidateViewBounds()}invalidateViewBounds(){this.m_viewBounds=void 0,this.m_paddedViewBounds=void 0}updateViewBounds(){var t;null===(t=this.m_paddedView)||void 0===t||t.update(),this.m_viewBounds=(0,c.harpToHGeoPolygon)(this.m_boundsGenerator.generate()),this.m_paddedViewBounds=this.m_paddedBoundsGenerator===this.m_boundsGenerator?this.m_viewBounds:(0,c.harpToHGeoPolygon)(this.m_paddedBoundsGenerator.generate())}onViewPortUpdate(){const t=this.m_viewPort.padding;if(t.top||t.left||t.bottom||t.right){const t=this.m_viewPort.center,e=this.mapView.getNormalizedScreenCoordinates(t.x,t.y);o.CameraUtils.setPrincipalPoint(this.mapView.camera,e),this.m_paddedBoundsGenerator===this.m_boundsGenerator&&(this.m_paddedView=new p(this.mapView,this.m_viewPort),this.m_paddedBoundsGenerator=new r.BoundsGenerator(this.m_paddedView))}else this.m_paddedBoundsGenerator!==this.m_boundsGenerator&&(o.CameraUtils.setPrincipalPoint(this.mapView.camera,{x:0,y:0}),this.m_paddedBoundsGenerator=this.m_boundsGenerator,this.m_paddedView=void 0);this.invalidateViewBounds()}}},8935:(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.RenderEngine=e.RenderEngineState=void 0;const r=i(6271),n=i(3334),o=i(8806),s=i(9026),a=i(2616),l=i(3977),c=i(2730),h=i(9070),u=i(2505),p=i(483),d=i(6562),m=i(9561),f=i(541),g=i(4954),y=i(248),v=i(1135),_=i(5694),b=i(6667),x=i(5925),w=i(2344),S=i(507),T=i(7362),E=d.LoggerManager.instance.create("harp::RenderEngine");var M;!function(t){t[t.IDLE=0]="IDLE",t[t.BUSY=1]="BUSY"}(M=e.RenderEngineState||(e.RenderEngineState={}));class A extends H.util.EventTarget{constructor(t,e,i,r){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=M.IDLE,this.m_rendered=!1,this.m_suspendTimeout=5e3,this.m_renderCallbacks=void 0,this.m_kinetics=void 0,this.m_control=new o.ControlUtils,this.type=H.Map.EngineType.HARP,this.m_viewModel=e,this.m_viewPort=t,this.m_dataModel=i,e.startControl=this.startControl.bind(this),e.control=this.control.bind(this),e.endControl=this.endControl.bind(this),t.startInteraction=this.startInteraction.bind(this),t.interaction=this.interaction.bind(this),t.endInteraction=this.endInteraction.bind(this),this.m_surface=new v.default(t.element,t.width,t.height,r.pixelRatio),this.m_collisionsDebugSurface=new v.default(t.element,t.width,t.height,r.pixelRatio),this.m_screenCollisionsDebug=new T.ScreenCollisionsDebug(this.m_collisionsDebugSurface.getElement()),this.m_screenCollisions=new T.ScreenCollisions,this.m_layersContainer=t.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",t.element.appendChild(this.m_layersContainer);const n=new Blob([H.__harp_worker_decoders__],{type:"application/javascript"}),s=URL.createObjectURL(n);this.mapView=new l.MapView({decoderUrl:s,synchronousRendering:!0,canvas:this.m_surface.getElement(),pixelRatio:r.pixelRatio,enableMixedLod:!0,lodMinTilePixelSize:512,enableNativeWebglAntialias:!0,projection:r.projectionType===a.ProjectionType.Spherical?a.sphereProjection:a.mercatorProjection,theme:(0,b.getDefaultTheme)(!1),enablePickTechnique:!0,maxVisibleDataSourceTiles:200}),this.setCollisionsDebugger(!1),this.m_handleRequestAnimationFrame=this.renderLoop.bind(this),e.addEventListener("update",this.onViewUpdate,void 0,this),t.addEventListener("update",this.onResize,void 0,this),this.m_lookAtManipulator=new m.LookAtManipulator(this.mapView,this.m_viewPort),this.mapView.addEventListener(l.MapViewEventNames.FrameComplete,()=>{this.m_layers.isSetLayerOngoing||(this.m_rendered=!0)}),this.mapView.addEventListener(l.MapViewEventNames.Update,()=>{this.m_rendered=!1,this.relaunch()}),this.mapView.addEventListener(l.MapViewEventNames.ContextLost,()=>{this.setState(M.IDLE),cancelAnimationFrame(this.m_animationFrameHandle)}),this.m_layers=new p.Layers(this.mapView,i,this.m_lookAtManipulator,{createDOMSurface:()=>new H.map.render.dom.Surface(this.m_layersContainer,t.width,t.height,r.pixelRatio)}),this.m_control.addEventListener(o.AnimationUpdateEvent,t=>{var e;null===(e=this.m_animation)||void 0===e||e.stop(!0),t.changeRate.hasValue()&&(this.m_animation=new h.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 c=new x.MapViewPickHandlerAdapter(this.mapView.pickHandler,this.geoToScreen.bind(this));this.m_pickingHandler=new y.PickingHandlerComposite(()=>{const t=[];return this.m_layers.forEachRenderer(e=>{e instanceof H.map.render.dom.MarkerRenderer&&t.push({getObjectsAt:(t,i,n)=>e.getObjectsAt(t*r.pixelRatio,i*r.pixelRatio,n)})}),t.push(c),t}),E.log("Ready")}setOnRenderCallbacks(t,e){this.m_renderCallbacks={start:t,end:e}}setCollisionsDebugger(t){t?(this.m_collisionsDebugSurface.getElement().style.display="block",this.mapView.iconTextRenderer.screenCollisions=this.m_screenCollisionsDebug,S.debugContext.setValue("DEBUG_SCREEN_COLLISIONS",!0)):(this.m_collisionsDebugSurface.getElement().style.display="none",this.mapView.iconTextRenderer.screenCollisions=this.m_screenCollisions,S.debugContext.setValue("DEBUG_SCREEN_COLLISIONS",!1)),this.mapView.update()}adjustZoomConstraints(){this.m_layers.adjustZoomConstraints()}onViewUpdate(t){const e=this.lookAtParamsFromLookAtData(t.newValue,t.modifiers);this.stopAnimations();const i=function(t){if(t&&this.m_lookAtManipulator.getLookAtData().zoom%1){const t=0|this.m_lookAtManipulator.getLookAtData().zoom;this.m_lookAtManipulator.lookAt({distance:f.MapViewUtils.calculateDistanceFromZoomLevel(this.mapView,t)}
2)}}.bind(this,t.integerZoom);if(t.animate){let r=1;"number"==typeof t.animate&&(r=1/t.animate),this.setLookAtWithAnimation(e,r,t.integerZoom,i),this.relaunch()}else this.m_lookAtManipulator.lookAt(e),i()}setLookAtWithAnimation(t,e,i,n){const o=u.CameraAnimationBuilder.createFlyToOptions(this.mapView,Object.assign(Object.assign({},t),{padding:this.m_viewPort.padding}),(t,i)=>{const r={heading:t.heading,tilt:t.tilt,zoom:f.MapViewUtils.calculateZoomLevelFromDistance(this.mapView,t.distance)},n={heading:i.heading,tilt:i.tilt,zoom:f.MapViewUtils.calculateZoomLevelFromDistance(this.mapView,i.distance)};return this.getFlyToDuration(r,n)*e},i).controlPoints;this.m_lookAtAnimation=new s.CameraKeyTrackAnimation(this.mapView,{controlPoints:o,interpolation:r.InterpolateLinear}),this.m_lookAtAnimation.start(0,n)}onResize(){this.setSize(!0),this.relaunch()}setSize(t){let{width:e,height:i}=this.m_viewPort;if(e>0&&i>0){t&&(this.m_syncedSize={w:e,h:i}),this.mapView.pixelRatio<2&&(e+=e%2,i+=i%2),this.m_surface.setSize(e,i),this.m_collisionsDebugSurface.setSize(e,i),this.mapView.resize(e,i);const r=this.lookAtParamsFromLookAtData(this.m_viewModel.getLookAtData());this.m_lookAtManipulator.lookAt(r),this.m_layers.forEachRenderer(t=>{t.getSurface().setSize(e,i)})}}lookAtParamsFromLookAtData(t,e=-1>>>0){const i={};return this.m_lookAtManipulator.clampValues(t),e&H.map.ChangeEvent.Type.POSITION&&(i.target=t.position),e&H.map.ChangeEvent.Type.ZOOM&&(i.zoomLevel=t.zoom),e&H.map.ChangeEvent.Type.HEADING&&(i.heading=(0,m.adjustHeading)(t.heading)),e&H.map.ChangeEvent.Type.TILT&&(i.tilt=t.tilt),e&H.map.ChangeEvent.Type.BOUNDS&&(e&H.map.ChangeEvent.Type.ZOOM&&e&H.map.ChangeEvent.Type.POSITION||(i.bounds=t.bounds instanceof H.geo.Polygon?(0,c.hToHarpGeoPolygon)(t.bounds):(0,c.getHarpBoundingBox)(t.bounds))),i}synchronizeViewPort(){null!==this.m_syncedSize&&(this.m_viewPort.synchronize(this.m_syncedSize),this.m_syncedSize=null)}synchronizeLookAt(){var t;this.m_viewModel.synchronize(this.m_lookAtManipulator.getLookAtData(null===(t=this.m_lookAtAnimation)||void 0===t?void 0:t.isRunning(),!0))}adjustLongitudeToVisibleWorld(t){const e=this.mapView.target.longitude;if(Math.abs(e-t)<a.MAX_LONGITUDE)return t;const i=Math.sign(e),r=Math.trunc(e/(2*a.MAX_LONGITUDE)+i/2);return t+2*a.MAX_LONGITUDE*r}inViewport(t){return t.x>=0&&t.y>=0&&t.x<=this.m_viewPort.width&&t.y<=this.m_viewPort.height}setProjection(t){this.mapView.projection.type!==t&&(this.mapView.projection=t===a.ProjectionType.Spherical?a.sphereProjection:a.mercatorProjection)}getProjection(){return this.mapView.projection.type}get animationDuration(){return this.m_animationDuration}set animationDuration(t){t===+t&&t>0&&(this.m_animationDuration=t)}resetAnimationDefaults(){this.m_animationDuration=.3}dispose(){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=g.PerformanceTimer.now()}relaunch(){const{width:t,height:e}=this.m_viewPort;t>0&&e>0&&(this.updateTimeStamp(),this.m_state===M.IDLE&&this.startRenderLoop())}get continueRenderLoop(){return this.mapView.isDynamicFrame||g.PerformanceTimer.now()-this.m_lastCallTime<this.m_suspendTimeout&&!this.m_rendered}startRenderLoop(){this.continueRenderLoop?(this.setState(M.BUSY),this.m_animationFrameHandle=requestAnimationFrame(this.m_handleRequestAnimationFrame)):(this.setState(M.IDLE),this.m_animationFrameHandle=void 0,this.m_rendered&&(this.m_rendered=!1,setTimeout(()=>{this.mapView.isDynamicFrame?this.relaunch():this.dispatchRenderEvent()})))}
2renderLoop(t){void 0!==this.m_renderCallbacks&&this.m_renderCallbacks.start(),this.mapView.renderSync(t),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 t,e;let i=null===(e=this.m_lookAtManipulator.getLookAtData(null===(t=this.m_lookAtAnimation)||void 0===t?void 0:t.isRunning()).bounds)||void 0===e?void 0:e.getBoundingBox();if(void 0===i)return!1;this.mapView.projection.type===a.ProjectionType.Planar&&i.getHeight()>=2*a.MercatorConstants.MAXIMUM_LATITUDE&&(i=new H.geo.Rect(90,i.getLeft(),-90,i.getRight()));const r=this.mapView.zoomLevel;this.m_dataModel.asArray().forEach(t=>{var e;null===(e=t.getProvider())||void 0===e||e.preprocessData(i,r)});const n=this.m_viewPort.center,o=new H.math.Point(0,0);let s=!0;return this.m_layers.forEachRenderer(t=>{const e=t.render(i,n,void 0,r,!1,o,t=>this.geoToScreen(t));e===H.map.render.RenderState.ACTIVE&&(this.m_suspendTimeout=1/0),e===H.map.render.RenderState.PENDING&&(s=!1)}),s}getState(){return this.m_state}setState(t){const e=this.m_state;t^e&&(this.m_state=t,setTimeout(()=>this.dispatchEvent(new H.util.ChangeEvent("statechange",e,t))))}stopAnimations(){var t,e;null===(t=this.m_lookAtAnimation)||void 0===t||t.stop(),this.m_control.isRunning()&&this.endControl(!0),this.m_interaction.isRunning()&&this.endInteraction(!0),null===(e=this.m_animation)||void 0===e||e.stop(!0)}applyControl(t,e,i,r){const n=this.m_control.getChangeRate(),o=n.moveZ*i,s=n.rotateX*i,a=n.rotateY*i,l={x:n.moveX*i,y:n.moveY*i};this.m_lookAtManipulator.applyLookAtDelta(l,this.getControlTargetNDC(),o,s,a)}dispatchRenderEvent(t){this.dispatchEvent(new H.util.Event("render",null!=t?t:this))}getFlyToDuration(t,e){const i=Math.max(8*this.getCapabilityRatio(t,e,"zoom"),this.getCapabilityRatio(t,e,"heading"),this.getCapabilityRatio(t,e,"tilt")/2);return(0,n.clamp)(3e3*i,300,4e3)/1e3}getCapabilityRatio(t,e,i){const r=this.getCapabilities().lookAt[i],n=r.max-r.min,o="zoom"===i?e[i]-t[i]:((t,e)=>{const i=e-t;return i>-180&&i<=180?i:i>180?i-360:i+360})(t[i],e[i]);return Math.abs(o)/n||0}screenToGeo(t,e){const{latitude:i,longitude:r,altitude:n}=this.mapView.getGeoCoordinatesAt(t,e,!0);return new H.geo.Point(i,r,n)}geoToScreen(t){let e;if(this.getProjection()===a.ProjectionType.Planar){const{lat:i,lng:r,alt:n}=t,o=this.adjustLongitudeToVisibleWorld(r),s=this.mapView.getScreenPosition([o,i,n]);e=s,this.inViewport(s)||(e=this.mapView.getScreenPosition([o+360,i,n]),this.inViewport(e)||(e=this.mapView.getScreenPosition([o-360,i,n])),this.inViewport(e)||(e=s))}else e=this.mapView.getScreenPosition(t);return void 0!==e?{x:Math.round(e.x),y:Math.round(e.y)}:null}screenToLookAtData(t,e){const i=this.m_viewModel.getLookAtData();return i.position=this.screenToGeo(t,e),i}getObjectsAt(t,e,i,r,n=!1){this.m_pickingHandler.getObjectsAt(t,e,i,n).then(r)}async capture(t,e,i,r){return await new Promise((n,o)=>{const s=()=>{this.mapView.removeEventListener(l.MapViewEventNames.FrameComplete,s);const o=this.m_viewPort.element.ownerDocument.createElement("img");o.onload=()=>{const s=this.m_viewPort.element.ownerDocument.createElement("canvas"),a=this.mapView.pixelRatio,l=s.width=(i-t)*a,c=s.height=(r-e)*a;s.getContext("2d").drawImage(o,t,e,l,c,0,0,l,c),n(s)},o.src=this.mapView.canvas.toDataURL()};this.mapView.addEventListener(l.MapViewEventNames.FrameComplete,s),this.mapView.update()})}setPointer(t,e){}zoomAt(t,e,i){const r=this.mapView.getNormalizedScreenCoordinates(e,i);this.m_lookAtManipulator.zoomAt(t,r),this.relaunch()}startControl(t,e,i){this.stopAnimations(),this.m_kinetics=t,this.m_control.start(e,i)}control(t,e,i,r,n,o){for(let t,e=0;e<arguments.length;e++)if(t=arguments[e],Number.isNaN(t))throw new Error(`Invalid argument ${t}`);this.m_control.isRunning()&&this.m_control.set(t,e,i,r,n,o)}endControl(t,e){var i,r;if(!this.m_control.isRunning())return;const n=e instanceof Function,o=this.getControlTargetNDC();if(null===(i=this.m_animation)||void 0===i||i.stop(),void 0===this.m_kinetics||t||n){if(n){const t=this.m_lookAtManipulator.getLookAtData();e(t);const i=this.mapView.zoomLevel,r=this.m_lookAtManipulator.clampZoom(t.zoom)-i;r&&(this.m_animation=new h.Animation(this.mapView,Math.abs(r/this.m_control.getChangeRate().moveZ)*Math.PI,t=>{const e=(n=t,--n*n*n+1);var n;this.m_lookAtManipulator.zoomAt(i+r*e,o)}).start())}}else{const t=null!==(r=this.m_kinetics.power)&&void 0!==r?r:1,e=this.m_control.getChangeRate(),i=this.m_kinetics.duration>0?this.m_kinetics.duration:1,{zoom:n,tilt:s,heading:a}=this.m_lookAtManipulator.getLookAtData();let l=0,c=0;this.m_animation=new h.Animation(this.mapView,i,r=>{const h=this.m_kinetics.ease(r)*i*t,u=e.moveX*h,p=e.moveY*h,d=e.moveZ*h,f=e.rotateX*h,g=e.rotateY*h;this.m_lookAtManipulator.setAngles(s+f,(0,m.adjustHeading)(a+g)),this.m_lookAtManipulator.zoomAt(n+d,o),this.m_lookAtManipulator.moveLookAtByOffset(u-l,p-c),l=u,c=p}).start()}this.m_control.reset()}startInteraction(t,e){const i=!!(void 0!==e||t&(H.map.render.RenderEngine.InteractionModifiers.HEADING|H.map.render.RenderEngine.InteractionModifiers.TILT));this.stopAnimations(),this.m_kinetics=e,this.m_interaction.start(t,i)}
2interaction(t,e,i,r,n){if(!this.m_interaction.isRunning())return;const o=this.m_interaction,s=o.store(t,e,i,r,n);if(!this.m_interaction.isGestureDetected())return;let a=!1;const l=this.m_interaction.getMoveVector(),c=s&&o.getBifocalCenter(),h=H.map.render.RenderEngine.InteractionModifiers;let u={x:0,y:0},p=w.CameraUtils.getPrincipalPoint(this.mapView.camera),d=0,m=0,f=0;o.isModifierEnabled(h.TILT)&&(m=l.y/this.m_viewPort.height*2*-180,a=!0),o.isModifierEnabled(h.HEADING)&&(s?(f=this.m_interaction.getBifocalRotation(),p=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();s&&1!==g&&o.isModifierEnabled(h.ZOOM)&&(d=Math.log(Math.pow(2,this.mapView.zoomLevel)*g)/Math.LN2-this.mapView.zoomLevel,p=this.mapView.getNormalizedScreenCoordinates(c.x,c.y),a=!0),o.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,p,d,m,f),this.relaunch())}endInteraction(t){var e;if(this.m_interaction.isRunning()&&!t&&void 0!==this.m_kinetics){const t=(null!==(e=this.m_kinetics.power)&&void 0!==e?e:1)*this.m_interaction.getSpeed();if(t>0){const e=this.m_kinetics.duration>0?this.m_kinetics.duration:1,i=this.m_interaction.getDirection(),r=this.m_kinetics.ease;this.m_animation=new h.Animation(this.mapView,e,e=>{const n=t-t*r(e);this.m_lookAtManipulator.moveLookAtByOffset(-i.x*n,-i.y*n)}).start()}}this.m_kinetics=void 0,this.m_interaction.clear()}getCapabilities(){return _.default}getControlTargetNDC(){var t,e;return void 0!==(null===(t=this.m_control)||void 0===t?void 0:t.atX)&&void 0!==(null===(e=this.m_control)||void 0===e?void 0:e.atY)?this.mapView.getNormalizedScreenCoordinates(this.m_control.atX,this.m_control.atY):w.CameraUtils.getPrincipalPoint(this.mapView.camera)}}e.RenderEngine=A},1135:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=class{constructor(t,e,i,r){this.m_canvas=this.createElement(t.ownerDocument),t.appendChild(this.m_canvas),this.m_pixelRatio=r,this.setSize(e,i)}createElement(t){const e=t.createElement("canvas");return e.style.position="absolute",e.style.top=e.style.left="0",e}setSize(t,e){const i=this.m_pixelRatio;this.m_canvas.width=Math.max(t*i,1),this.m_canvas.height=Math.max(e*i,1),this.m_canvas.style.width=`${t}px`,this.m_canvas.style.height=`${e}px`}getElement(){return this.m_canvas}}},5694:(t,e)=>{Object.defineProperty(e,"__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};e.default=i},6597:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,i,r){const n=i.getIcon(),o=n.getHitArea();if(null===o)return!0;const s=n.getAnchor();t+=s.x,e+=s.y;const a=i.getGeometry();let l=!1;if(a instanceof H.geo.MultiPoint){const i=a.getGeometries();let n=i.length;for(;n--&&!l;){const s=r(i[n]);l=o.hitTest(t-s.x,e-s.y,0)!==H.math.CoverType.NONE}}else{const i=r(a);l=o.hitTest(t-i.x,e-i.y,0)!==H.math.CoverType.NONE}return l}},5925:function(t,e,i){var r=this&&this.__rest||function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(i[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]])}return i};Object.defineProperty(e,"__esModule",{value:!0}),e.MapViewPickHandlerAdapter=e.getPickData=void 0;const n=i(2497),o=i(6597),s=i(2420),a=i(4342),l=i(8263),c=i(8449);var h=H.map.provider.PickingMode;function u(t,e){var i;const n=t.userData,{$id:o,$layer:s,$zoom:a,$level:l,$geometryType:c,"$localized-name":h,"$secondary-localized-name":u}=n,p=r(n,["$id","$layer","$zoom","$level","$geometryType","$localized-name","$secondary-localized-name"]),d={};d.properties=p;const m=p.kind;d.id=t.featureId>0?t.featureId:p.id,d.layers=[`${e}_${s}:${m}`],d.source_layer=s,d.source_name=e,d.geometry_type=c,d.technique=t.technique;const f=null!==(i=t.tileKey)&&void 0!==i?i:t.userData.tileKey;if(null!=f){const{row:t,column:e,level:i}=f;d.tile={coords:{x:e,y:t,z:i,key:`${e}/${t}/${i}`}}}return d}
2function p(t,e,i){const r=new H.map.Feature(u(t,e));return r.setParentEventTarget(i),r}e.getPickData=u,e.MapViewPickHandlerAdapter=class{constructor(t,e){this.pickHandler=t,this.geoToScreen=e,this.m_featureCache=new l.LRUCache(100)}async getObjectsAt(t,e,i,r){const l={maxResultCount:i?1:void 0,allowDuplicates:r},d=this.pickHandler.intersectMapObjects(t,e,l),m=[];for(const l of d){if(void 0===l.userData)continue;const d=this.pickHandler.mapView.getDataSourceByName(l.dataSourceName);if(!(d instanceof c.TileDataSource)){(0,a.assert)(!1,"Pick supported only for TileDataSource instances");continue}const f=d.dataProvider();if(!(0,s.isProviderAdapter)(f))continue;const g=f.provider;switch(g.getPickingMode()){case h.SOURCE:{if(!(d instanceof n.LocalObjectDataSource)){(0,a.assert)(!1,"Cannot use 'SOURCE' pick mode for source without 'getMapObjectById'");continue}const i=d.getMapObjectById(l.userData.id);!m.includes(i)&&(i instanceof H.map.GeoShape||i instanceof H.map.Overlay||i instanceof H.map.Marker&&(0,o.default)(t,e,i,this.geoToScreen))&&m.push(i);break}case h.FEATURE:{let t;if(void 0!==l.tileKey){const{column:e,row:i,level:r}=l.tileKey;t={x:e,y:i,z:r}}g.getFeatureProxy(l.userData,t,function(t){void 0!==t&&(t.setRootParentEventTarget(g),m.push(t))})||m.push(r?p(l,d.name,g):this.getFeature(l,d.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,d.name),!1).then(i=>{i instanceof H.map.Marker&&!(0,o.default)(t,e,i,this.geoToScreen)||m.push(i)})}if(i&&m.length>0)break}return m}getFeature(t,e,i){let r=this.m_featureCache.get(t.userData),n=null==r?void 0:r.find(e=>e.getData().technique===t.technique);return void 0===n&&(n=p(t,e,i),void 0===r&&(r=[]),r.push(n),this.m_featureCache.set(t.userData,r)),n}}},248:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PickingHandlerComposite=void 0,e.PickingHandlerComposite=class{constructor(t){this.getPickingHandlers=t}async getObjectsAt(t,e,i,r){let n=[];const o=this.getPickingHandlers();for(const s of o){const o=await s.getObjectsAt(t,e,i,r);if(i&&o.length>0)return[o[0]];n=n.concat(o)}return n}}},2730:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getClampedGeoRect=e.harpToHGeoPolygon=e.harpGeoBoxToHGeoRect=e.hGeoRectToHarpGeoBox=e.getHarpBoundingBox=e.hToHarpGeoPolygon=void 0;const r=i(6482),n=i(4860),o=i(3068),s=i(3334);function a(t){return new o.GeoBox(new n.GeoCoordinates(t.getBottom(),t.getLeft()),new n.GeoCoordinates(t.getTop(),t.getRight()))}function l(t){const e=[];t.push(t[0]);const i=t.length;for(let r=0;r<i-1;r++){const i=t[r],o=t[r+1];if(e.push(i),Math.abs(o.longitude-i.longitude)>=180){const t=(i.latitude+o.latitude)/2,r=(i.longitude+o.longitude)/2,s=(i.altitude+o.altitude)/2;e.push(new n.GeoCoordinates(t,r,s||void 0))}}return e.length!==t.length-1?l(e):e}e.hToHarpGeoPolygon=function(t){const e=[];if(t.getExterior().eachLatLngAlt((t,i,r)=>{e.push(new n.GeoCoordinates(t,i,r))}),e.length>2)return new r.GeoPolygon(e,!0)},e.getHarpBoundingBox=function(t){return a(t.getBoundingBox())},e.hGeoRectToHarpGeoBox=a,e.harpGeoBoxToHGeoRect=function(t){return H.geo.Rect.fromPoints({lat:t.north,lng:t.west},{lat:t.south,lng:t.east})},e.harpToHGeoPolygon=function(t){if(void 0===t)return;const e=[];return l(t.coordinates).map(t=>{e.push(t.latitude,t.longitude,t.altitude)}),new H.geo.Polygon(new H.geo.LineString(e))},e.getClampedGeoRect=function(t,e){const i=function(t){const e=Math.pow(2,t.level)-1;return{row:t.row===e,column:t.column===e}}(e);return new H.geo.Rect(0===e.row?90:(0,s.clamp)(t.north,-90,90),(0,s.clamp)(t.west,-180,180),i.row?-90:(0,s.clamp)(t.south,-90,90),i.column?180:(0,s.clamp)(t.east,-180,180))}},9070:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Animation=void 0;const r=i(3977),n=i(4954);e.Animation=class{constructor(t,e,i){this.mapView=t,this.duration=e,this.updateCallback=i,this.running=!1,this.m_lastFrameTime=0,this.m_startTime=0,this.m_animateCb=t=>{this.animate(t.time<this.m_startTime?n.PerformanceTimer.now():t.time)}
2}start(t,e){if(!this.running)return this.running=!0,this.onFinished=e,this.mapView.addEventListener(r.MapViewEventNames.Render,this.m_animateCb),this.mapView.beginAnimation(),this.m_startTime=null!=t?t:n.PerformanceTimer.now(),this.m_lastFrameTime=this.m_startTime,this}stop(t=!1){this.running&&(this.running=!1,this.mapView.endAnimation(),this.mapView.removeEventListener(r.MapViewEventNames.Render,this.m_animateCb),void 0===this.onFinished||t||this.onFinished())}animate(t){const e=t-this.m_startTime,i=t-this.m_lastFrameTime;let r=e/this.duration;(0===this.duration||r>1)&&(r=1),this.m_lastFrameTime=t,this.update(r,e,i,t),r>=1&&this.stop()}update(t,e,i,r){void 0!==this.updateCallback&&this.updateCallback(t,e,i,r)}}},8806:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ChangeRate=e.ControlUtils=e.AnimationUpdateEvent=void 0,e.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(t,e){this.m_isRunning&&this.reset(),t===+t&&e===+e&&(this.atX=t,this.atY=e),this.m_isRunning=!0}reset(){this.m_isRunning=!1,this.atX=this.atY=void 0,this.m_changeRate=new n(0,0,0,0,0,0)}set(t,e,i,o,s,a){if(t/=1e3,e/=1e3,i/=1e3,o/=1e3,s/=1e3,a/=1e3,this.isRunning()){const l=new n(t,e,i,o,s,a);this.m_changeRate.equals(l)||(this.m_changeRate=l,this.dispatchEvent(new r(this.getChangeRate())))}}isRunning(){return this.m_isRunning}getChangeRate(){return this.m_changeRate}}e.ControlUtils=i;class r extends H.util.Event{constructor(t){super(e.AnimationUpdateEvent),this.changeRate=t,this.changeRate=t}}class n{constructor(t,e,i,r,n,o){this.moveX=t,this.moveY=e,this.moveZ=i,this.rotateX=r,this.rotateY=n,this.rotateZ=o,this.moveX=t,this.moveY=e,this.moveZ=i,this.rotateX=r,this.rotateY=n,this.rotateZ=o}equals(t){return this.moveX===t.moveX&&this.moveY===t.moveY&&this.moveZ===t.moveZ&&this.rotateX===t.rotateX&&this.rotateY===t.rotateY&&this.rotateZ===t.rotateZ}hasValue(){return 0!==this.moveX||0!==this.moveY||0!==this.moveZ||0!==this.rotateX||0!==this.rotateY||0!==this.rotateZ}}e.ChangeRate=n},4262:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,i=0){let r,n;return function(){const o=this,s=arguments;function a(){n=0,t.apply(o,s)}clearTimeout(r),n>0&&i&&Date.now()-n>=i?a():(void 0===n&&(n=Date.now()),r=setTimeout(()=>a(),e))}}},8775:(t,e,i)=>{i.r(e),i.d(e,{parseTar:()=>o});const r=512,n={GZIP:"GZIP",GZIP2:"GZIP2",TAR:"TAR",PLAIN:"PLAIN"};async function o(t){let e=t.buffer||t;const i=function(t){let e=l(t,0,2);return"1f8b"===c(e)?n.GZIP:(e=l(t,0,5),"425a683931"===c(e)?n.GZIP2:(e=l(t,257,5),"7573746172"===c(e)?n.TAR:n.PLAIN))}(e);if(i!=n.GZIP&&i!=n.TAR)throw new Error("The file format should be tar.gz or tar");if(i==n.GZIP){const i=new ReadableStream({start(e){e.enqueue(new Uint8Array(t)),e.close()}}).pipeThrough(new DecompressionStream("gzip"));e=await new Response(i).arrayBuffer()}const o=[];let h=0;for(;h<e.byteLength-r;){let t=s(e,h,100);if(0===t.length)break;const i=s(e,h+345,155);i&&(t=`${i}${t}`);const n=s(e,h+100,8),l=Number.parseInt(s(e,h+108,8)),c=Number.parseInt(s(e,h+116,8)),u=a(e,h+124,12),p=a(e,h+136,12),d=a(e,h+156,1),m=0===d?"file":5===d?"directory":d,f=s(e,h+265,32),g=s(e,h+297,32),y=new Uint8Array(e,h+r,u);o.push({name:t,type:m,size:u,data:y,get text(){return(new TextDecoder).decode(this.data)},attrs:{mode:n,uid:l,gid:c,mtime:p,user:f,group:g}}),h+=512+512*Math.trunc(u/512),u%512&&(h+=512)}return o}function s(t,e,i){const r=new Uint8Array(t,e,i),n=r.indexOf(0);return(new TextDecoder).decode(r.slice(0,n))}function a(t,e,i){const r=new Uint8Array(t,e,i);let n="";for(let t=0;t<i;t++)n+=String.fromCodePoint(r[t]);return Number.parseInt(n,8)}function l(t,e,i){return t.slice(e,e+i)}function c(t){const e=new Uint8Array(t);let i="";for(let t=0;t<e.length;t++)i+=e[t].toString(16).padStart(2,"0");return i}},3827:(t,e,i)=>{i.r(e),i.d(e,{AnimationClip:()=>d});var r=i(8887),n=i(9302),o=i(6271);class s extends n.t{}s.prototype.ValueTypeName="bool",s.prototype.ValueBufferType=Array,s.prototype.DefaultInterpolation=o.InterpolateDiscrete,s.prototype.InterpolantFactoryMethodLinear=void 0,s.prototype.InterpolantFactoryMethodSmooth=void 0;class a extends n.t{}a.prototype.ValueTypeName="color";var l=i(1993),c=i(2997);class h extends n.t{}h.prototype.ValueTypeName="string",h.prototype.ValueBufferType=Array,h.prototype.DefaultInterpolation=o.InterpolateDiscrete,h.prototype.InterpolantFactoryMethodLinear=void 0,h.prototype.InterpolantFactoryMethodSmooth=void 0;var u=i(5760),p=i(3334);class d{constructor(t,e=-1,i,r=o.NormalAnimationBlendMode){this.name=t,this.tracks=i,this.duration=e,this.blendMode=r,this.uuid=p.generateUUID(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],i=t.tracks,r=1/(t.fps||1);for(let t=0,n=i.length;t!==n;++t)e.push(m(i[t]).scale(r));const n=new this(t.name,t.duration,e,t.blendMode);return n.uuid=t.uuid,n}static toJSON(t){const e=[],i=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,r=i.length;t!==r;++t)e.push(n.t.toJSON(i[t]));return r}static CreateFromMorphTargetSequence(t,e,i,n){const o=e.length,s=[];for(let t=0;t<o;t++){let a=[],c=[];a.push((t+o-1)%o,t,(t+1)%o),c.push(0,1,0);const h=r.lK(a);a=r.qx(a,1,h),c=r.qx(c,1,h),n||0!==a[0]||(a.push(o),c.push(c[0])),s.push(new l.NumberKeyframeTrack(".morphTargetInfluences["+e[t].name+"]",a,c).scale(1/i))}return new this(t,-1,s)}static findByName(t,e){let i=t;if(!Array.isArray(t)){const e=t;i=e.geometry&&e.geometry.animations||e.animations}for(let t=0;t<i.length;t++)if(i[t].name===e)return i[t];return null}static CreateClipsFromMorphTargetSequences(t,e,i){const r={},n=/^([\w-]*?)([\d]+)$/;for(let e=0,i=t.length;e<i;e++){const i=t[e],o=i.name.match(n);if(o&&o.length>1){const t=o[1];let e=r[t];e||(r[t]=e=[]),e.push(i)}}const o=[];for(const t in r)o.push(this.CreateFromMorphTargetSequence(t,r[t],e,i));return o}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;
vendor: 6,268 bytes, line 2
2const i=function(t,e,i,n,o){if(0!==i.length){const s=[],a=[];r.hN(i,s,a,n),0!==s.length&&o.push(new t(e,s,a))}},n=[],o=t.name||"default",s=t.fps||30,a=t.blendMode;let h=t.length||-1;const p=t.hierarchy||[];for(let t=0;t<p.length;t++){const r=p[t].keys;if(r&&0!==r.length)if(r[0].morphTargets){const t={};let e;for(e=0;e<r.length;e++)if(r[e].morphTargets)for(let i=0;i<r[e].morphTargets.length;i++)t[r[e].morphTargets[i]]=-1;for(const i in t){const t=[],o=[];for(let n=0;n!==r[e].morphTargets.length;++n){const n=r[e];t.push(n.time),o.push(n.morphTarget===i?1:0)}n.push(new l.NumberKeyframeTrack(".morphTargetInfluence["+i+"]",t,o))}h=t.length*s}else{const o=".bones["+e[t].name+"]";i(u.VectorKeyframeTrack,o+".position",r,"pos",n),i(c.QuaternionKeyframeTrack,o+".quaternion",r,"rot",n),i(u.VectorKeyframeTrack,o+".scale",r,"scl",n)}}return 0===n.length?null:new this(o,h,n,a)}resetDuration(){let t=0;for(let e=0,i=this.tracks.length;e!==i;++e){const i=this.tracks[e];t=Math.max(t,i.times[i.times.length-1])}return this.duration=t,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function m(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return l.NumberKeyframeTrack;case"vector":case"vector2":case"vector3":case"vector4":return u.VectorKeyframeTrack;case"color":return a;case"quaternion":return c.QuaternionKeyframeTrack;case"bool":case"boolean":return s;case"string":return h}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){const e=[],i=[];r.hN(t.keys,e,i,"value"),t.times=e,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}},4839:(t,e,i)=>{i.r(e),i.d(e,{AnimationMixer:()=>v});var r=i(6271);class n{constructor(t,e,i=null,n=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=n;const o=e.tracks,s=o.length,a=new Array(s),l={endingStart:r.ZeroCurvatureEnding,endingEnd:r.ZeroCurvatureEnding};for(let t=0;t!==s;++t){const e=o[t].createInterpolant(null);a[t]=e,e.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=r.LoopRepeat,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(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,i){if(t.fadeOut(e),this.fadeIn(e),i){const i=this._clip.duration,r=t._clip.duration,n=r/i,o=i/r;t.warp(1,n,e),this.warp(o,1,e)}return this}crossFadeTo(t,e,i){return t.crossFadeFrom(this,e,i)}stopFading(){const t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,i){const r=this._mixer,n=r.time,o=this.timeScale;let s=this._timeScaleInterpolant;null===s&&(s=r._lendControlInterpolant(),this._timeScaleInterpolant=s);const a=s.parameterPositions,l=s.sampleValues;return a[0]=n,a[1]=n+i,l[0]=t/o,l[1]=e/o,this}stopWarping(){const t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,i,n){if(!this.enabled)return void this._updateWeight(t);const o=this._startTime;if(null!==o){const r=(t-o)*i;r<0||0===i?e=0:(this._startTime=null,e=i*r)}e*=this._updateTimeScale(t);const s=this._updateTime(e),a=this._updateWeight(t);if(a>0){const t=this._interpolants,e=this._propertyBindings;switch(this.blendMode){case r.AdditiveAnimationBlendMode:for(let i=0,r=t.length;i!==r;++i)t[i].evaluate(s),e[i].accumulateAdditive(a);break;case r.NormalAnimationBlendMode:default:for(let i=0,r=t.length;i!==r;++i)t[i].evaluate(s),e[i].accumulate(n,a)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(null!==i){const r=i.evaluate(t)[0];e*=r,t>i.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const i=this._timeScaleInterpolant;null!==i&&(e*=i.evaluate(t)[0],t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,i=this.loop;let n=this.time+t,o=this._loopCount;const s=i===r.LoopPingPong;if(0===t)return-1===o||!s||1&~o?n:e-n;
vendor: 4,618 bytes, line 2
2if(i===r.LoopOnce){-1===o&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n>=e)n=e;else{if(!(n<0)){this.time=n;break t}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===o&&(t>=0?(o=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),n>=e||n<0){const i=Math.floor(n/e);n-=e*i,o+=Math.abs(i);const r=this.repetitions-o;if(r<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=t>0?e:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===r){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=o,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(s&&!(1&~o))return e-n}return n}_setEndings(t,e,i){const n=this._interpolantSettings;i?(n.endingStart=r.ZeroSlopeEnding,n.endingEnd=r.ZeroSlopeEnding):(n.endingStart=t?this.zeroSlopeAtStart?r.ZeroSlopeEnding:r.ZeroCurvatureEnding:r.WrapAroundEnding,n.endingEnd=e?this.zeroSlopeAtEnd?r.ZeroSlopeEnding:r.ZeroCurvatureEnding:r.WrapAroundEnding)}_scheduleFading(t,e,i){const r=this._mixer,n=r.time;let o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const s=o.parameterPositions,a=o.sampleValues;return s[0]=n,a[0]=e,s[1]=n+t,a[1]=i,this}}var o=i(2356),s=i(9698);const a="\\[\\]\\.:\\/",l=new RegExp("["+a+"]","g"),c="[^"+a+"]",h="[^"+a.replace("\\.","")+"]",u=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",c)+/(WCOD+)?/.source.replace("WCOD",h)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",c)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",c)+"$"),p=["material","materials","bones","map"];class d{constructor(t,e,i){this.path=e,this.parsedPath=i||d.parseTrackName(e),this.node=d.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new d.Composite(t,e,i):new d(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(l,"")}static parseTrackName(t){const e=u.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){const t=i.nodeName.substring(r+1);-1!==p.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=t)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){const i=function(t){for(let r=0;r<t.length;r++){const n=t[r];if(n.name===e||n.uuid===e)return n;const o=i(n.children);if(o)return o}return null},r=i(t.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){const i=this.resolvedProperty;for(let r=0,n=i.length;r!==n;++r)t[e++]=i[r]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){const i=this.resolvedProperty;for(let r=0,n=i.length;r!==n;++r)i[r]=t[e++]}_setValue_array_setNeedsUpdate(t,e){const i=this.resolvedProperty;for(let r=0,n=i.length;r!==n;++r)i[r]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){const i=this.resolvedProperty;for(let r=0,n=i.length;r!==n;++r)i[r]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}
vendor: 4,305 bytes, line 2
2_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node;const e=this.parsedPath,i=e.objectName,r=e.propertyName;let n=e.propertyIndex;if(t||(t=d.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(i){let r=e.objectIndex;switch(i){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===r){r=e;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);t=t.material.map;break;default:if(void 0===t[i])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[i]}if(void 0!==r){if(void 0===t[r])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[r]}}const o=t[r];if(void 0===o){const i=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+i+"."+r+" but it wasn't found.",t)}let s=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?s=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(s=this.Versioning.MatrixWorldNeedsUpdate);let a=this.BindingType.Direct;if(void 0!==n){if("morphTargetInfluences"===r){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[n]&&(n=t.morphTargetDictionary[n])}a=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=n}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=r;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(t,e,i){const r=i||d.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)}getValue(t,e){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];void 0!==r&&r.getValue(t,e)}setValue(t,e){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,n=i.length;r!==n;++r)i[r].setValue(t,e)}bind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].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_setMatr
vendor: 4,937 bytes, line 2
2ixWorldNeedsUpdate],[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]];var m=i(9747);class f{constructor(t,e,i){let r,n,o;switch(this.binding=t,this.valueSize=i,e){case"quaternion":r=this._slerp,n=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*i),this._workIndex=5;break;case"string":case"bool":r=this._select,n=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(5*i);break;default:r=this._lerp,n=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*i)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=n,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){const i=this.buffer,r=this.valueSize,n=t*r+r;let o=this.cumulativeWeight;if(0===o){for(let t=0;t!==r;++t)i[n+t]=i[t];o=e}else{o+=e;const t=e/o;this._mixBufferRegion(i,n,0,t,r)}this.cumulativeWeight=o}accumulateAdditive(t){const e=this.buffer,i=this.valueSize,r=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,r,0,t,i),this.cumulativeWeightAdditive+=t}apply(t){const e=this.valueSize,i=this.buffer,r=t*e+e,n=this.cumulativeWeight,o=this.cumulativeWeightAdditive,s=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,n<1){const t=e*this._origIndex;this._mixBufferRegion(i,r,t,1-n,e)}o>0&&this._mixBufferRegionAdditive(i,r,this._addIndex*e,1,e);for(let t=e,n=e+e;t!==n;++t)if(i[t]!==i[t+e]){s.setValue(i,r);break}}saveOriginalState(){const t=this.binding,e=this.buffer,i=this.valueSize,r=i*this._origIndex;t.getValue(e,r);for(let t=i,n=r;t!==n;++t)e[t]=e[r+t%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i<e;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[e+i]=this.buffer[t+i]}_select(t,e,i,r,n){if(r>=.5)for(let r=0;r!==n;++r)t[e+r]=t[i+r]}_slerp(t,e,i,r){m.Quaternion.slerpFlat(t,e,t,e,t,i,r)}_slerpAdditive(t,e,i,r,n){const o=this._workIndex*n;m.Quaternion.multiplyQuaternionsFlat(t,o,t,e,t,i),m.Quaternion.slerpFlat(t,e,t,e,t,o,r)}_lerp(t,e,i,r,n){const o=1-r;for(let s=0;s!==n;++s){const n=e+s;t[n]=t[n]*o+t[i+s]*r}}_lerpAdditive(t,e,i,r,n){for(let o=0;o!==n;++o){const n=e+o;t[n]=t[n]+t[i+o]*r}}}var g=i(3827);const y=new Float32Array(1);class v extends o.EventDispatcher{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const i=t._localRoot||this._root,r=t._clip.tracks,n=r.length,o=t._propertyBindings,s=t._interpolants,a=i.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let t=0;t!==n;++t){const n=r[t],l=n.name;let h=c[l];if(void 0!==h)++h.referenceCount,o[t]=h;else{if(h=o[t],void 0!==h){null===h._cacheIndex&&(++h.referenceCount,this._addInactiveBinding(h,a,l));continue}const r=e&&e._propertyBindings[t].binding.parsedPath;h=new f(d.create(i,l,r),n.ValueTypeName,n.getValueSize()),++h.referenceCount,this._addInactiveBinding(h,a,l),o[t]=h}s[t].resultBuffer=h.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,i=t._clip.uuid,r=this._actionsByClip[i];this._bindAction(t,r&&r.knownActions[0]),this._addInactiveAction(t,i,e)}const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const e=t._cacheIndex;return null!==e&&e<this._nActiveActions}
vendor: 12,062 bytes, line 2
2_addInactiveAction(t,e,i){const r=this._actions,n=this._actionsByClip;let o=n[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,n[e]=o;else{const e=o.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=r.length,r.push(t),o.actionByRoot[i]=t}_removeInactiveAction(t){const e=this._actions,i=e[e.length-1],r=t._cacheIndex;i._cacheIndex=r,e[r]=i,e.pop(),t._cacheIndex=null;const n=t._clip.uuid,o=this._actionsByClip,s=o[n],a=s.knownActions,l=a[a.length-1],c=t._byClipCacheIndex;l._byClipCacheIndex=c,a[c]=l,a.pop(),t._byClipCacheIndex=null,delete s.actionByRoot[(t._localRoot||this._root).uuid],0===a.length&&delete o[n],this._removeInactiveBindingsForAction(t)}_removeInactiveBindingsForAction(t){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==--i.referenceCount&&this._removeInactiveBinding(i)}}_lendAction(t){const e=this._actions,i=t._cacheIndex,r=this._nActiveActions++,n=e[r];t._cacheIndex=r,e[r]=t,n._cacheIndex=i,e[i]=n}_takeBackAction(t){const e=this._actions,i=t._cacheIndex,r=--this._nActiveActions,n=e[r];t._cacheIndex=r,e[r]=t,n._cacheIndex=i,e[i]=n}_addInactiveBinding(t,e,i){const r=this._bindingsByRootAndName,n=this._bindings;let o=r[e];void 0===o&&(o={},r[e]=o),o[i]=t,t._cacheIndex=n.length,n.push(t)}_removeInactiveBinding(t){const e=this._bindings,i=t.binding,r=i.rootNode.uuid,n=i.path,o=this._bindingsByRootAndName,s=o[r],a=e[e.length-1],l=t._cacheIndex;a._cacheIndex=l,e[l]=a,e.pop(),delete s[n],0===Object.keys(s).length&&delete o[r]}_lendBinding(t){const e=this._bindings,i=t._cacheIndex,r=this._nActiveBindings++,n=e[r];t._cacheIndex=r,e[r]=t,n._cacheIndex=i,e[i]=n}_takeBackBinding(t){const e=this._bindings,i=t._cacheIndex,r=--this._nActiveBindings,n=e[r];t._cacheIndex=r,e[r]=t,n._cacheIndex=i,e[i]=n}_lendControlInterpolant(){const t=this._controlInterpolants,e=this._nActiveControlInterpolants++;let i=t[e];return void 0===i&&(i=new s.l(new Float32Array(2),new Float32Array(2),1,y),i.__cacheIndex=e,t[e]=i),i}_takeBackControlInterpolant(t){const e=this._controlInterpolants,i=t.__cacheIndex,r=--this._nActiveControlInterpolants,n=e[r];t.__cacheIndex=r,e[r]=t,n.__cacheIndex=i,e[i]=n}clipAction(t,e,i){const o=e||this._root,s=o.uuid;let a="string"==typeof t?g.AnimationClip.findByName(o,t):t;const l=null!==a?a.uuid:t,c=this._actionsByClip[l];let h=null;if(void 0===i&&(i=null!==a?a.blendMode:r.NormalAnimationBlendMode),void 0!==c){const t=c.actionByRoot[s];if(void 0!==t&&t.blendMode===i)return t;h=c.knownActions[0],null===a&&(a=h._clip)}if(null===a)return null;const u=new n(this,a,e,i);return this._bindAction(u,h),this._addInactiveAction(u,l,s),u}existingAction(t,e){const i=e||this._root,r=i.uuid,n="string"==typeof t?g.AnimationClip.findByName(i,t):t,o=n?n.uuid:t,s=this._actionsByClip[o];return void 0!==s&&s.actionByRoot[r]||null}stopAllAction(){const t=this._actions;for(let e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,i=this._nActiveActions,r=this.time+=t,n=Math.sign(t),o=this._accuIndex^=1;for(let s=0;s!==i;++s)e[s]._update(r,t,n,o);const s=this._bindings,a=this._nActiveBindings;for(let t=0;t!==a;++t)s[t].apply(o);return this}setTime(t){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(t)}getRoot(){return this._root}uncacheClip(t){const e=this._actions,i=t.uuid,r=this._actionsByClip,n=r[i];if(void 0!==n){const t=n.knownActions;for(let i=0,r=t.length;i!==r;++i){const r=t[i];this._deactivateAction(r);const n=r._cacheIndex,o=e[e.length-1];r._cacheIndex=null,r._byClipCacheIndex=null,o._cacheIndex=n,e[n]=o,e.pop(),this._removeInactiveBindingsForAction(r)}delete r[i]}}uncacheRoot(t){const e=t.uuid,i=this._actionsByClip;for(const t in i){const r=i[t].actionByRoot[e];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}const r=this._bindingsByRootAndName[e];if(void 0!==r)for(const t in r){const e=r[t];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(t,e){const i=this.existingAction(t,e);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}}},8887:(t,e,i)=>{function r(t,e,i){return o(t)?new t.constructor(t.subarray(e,void 0!==i?i:t.length)):t.slice(e,i)}function n(t,e,i){return!t||!i&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)}function o(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function s(t){const e=t.length,i=new Array(e);for(let t=0;t!==e;++t)i[t]=t;return i.sort(function(e,i){return t[e]-t[i]}),i}function a(t,e,i){const r=t.length,n=new t.constructor(r);for(let o=0,s=0;s!==r;++o){const r=i[o]*e;for(let i=0;i!==e;++i)n[s++]=t[r+i]}return n}function l(t,e,i,r){let n=1,o=t[0];for(;void 0!==o&&void 0===o[r];)o=t[n++];if(void 0===o)return;let s=o[r];if(void 0!==s)if(Array.isArray(s))do{s=o[r],void 0!==s&&(e.push(o.time),i.push.apply(i,s)),o=t[n++]}while(void 0!==o);else if(void 0!==s.toArray)do{s=o[r],void 0!==s&&(e.push(o.time),s.toArray(i,i.length)),o=t[n++]}while(void 0!==o);else do{s=o[r],void 0!==s&&(e.push(o.time),i.push(s)),o=t[n++]}while(void 0!==o)}i.d(e,{fU:()=>o,hN:()=>l,j5:()=>n,lK:()=>s,qx:()=>a,zS:()=>r}),i(9747),i(6271)},9302:(t,e,i)=>{i.d(e,{t:()=>c});var r=i(6271),n=i(4116);class o extends n._{constructor(t,e,i,n){super(t,e,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:r.ZeroCurvatureEnding,endingEnd:r.ZeroCurvatureEnding}}intervalChanged_(t,e,i){const n=this.parameterPositions;let o=t-2,s=t+1,a=n[o],l=n[s];if(void 0===a)switch(this.getSettings_().endingStart){case r.ZeroSlopeEnding:o=t,a=2*e-i;break;case r.WrapAroundEnding:o=n.length-2,a=e+n[o]-n[o+1];break;default:o=t,a=i}if(void 0===l)switch(this.getSettings_().endingEnd){case r.ZeroSlopeEnding:s=t,l=2*i-e;break;case r.WrapAroundEnding:s=1,l=i+n[1]-n[0];break;default:s=t-1,l=e}const c=.5*(i-e),h=this.valueSize;this._weightPrev=c/(e-a),this._weightNext=c/(l-i),this._offsetPrev=o*h,this._offsetNext=s*h}interpolate_(t,e,i,r){const n=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,l=a-s,c=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,p=this._weightNext,d=(i-e)/(r-e),m=d*d,f=m*d,g=-u*f+2*u*m-u*d,y=(1+u)*f+(-1.5-2*u)*m+(-.5+u)*d+1,v=(-1-p)*f+(1.5+p)*m+.5*d,_=p*f-p*m;for(let t=0;t!==s;++t)n[t]=g*o[c+t]+y*o[l+t]+v*o[a+t]+_*o[h+t];return n}}var s=i(9698);class a extends n._{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t){return this.copySampleValue_(t-1)}}var l=i(8887);class c{constructor(t,e,i,r){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=l.j5(e,this.TimeBufferType),this.values=l.j5(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let i;if(e.toJSON!==this.toJSON)i=e.toJSON(t);else{i={name:t.name,times:l.j5(t.times,Array),values:l.j5(t.values,Array)};const e=t.getInterpolation();e!==t.DefaultInterpolation&&(i.interpolation=e)}return i.type=t.ValueTypeName,i}InterpolantFactoryMethodDiscrete(t){return new a(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new s.l(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new o(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case r.InterpolateDiscrete:e=this.InterpolantFactoryMethodDiscrete;break;case r.InterpolateLinear:e=this.InterpolantFactoryMethodLinear;break;case r.InterpolateSmooth:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){const e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",e),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return r.InterpolateDiscrete;case this.InterpolantFactoryMethodLinear:return r.InterpolateLinear;case this.InterpolantFactoryMethodSmooth:return r.InterpolateSmooth}}getValueSize(){return this.values.length/this.times.length}shift(t){if(0!==t){const e=this.times;for(let i=0,r=e.length;i!==r;++i)e[i]+=t}return this}scale(t){if(1!==t){const e=this.times;for(let i=0,r=e.length;i!==r;++i)e[i]*=t}return this}trim(t,e){const i=this.times,r=i.length;let n=0,o=r-1;for(;n!==r&&i[n]<t;)++n;for(;-1!==o&&i[o]>e;)--o;if(++o,0!==n||o!==r){n>=o&&(o=Math.max(o,1),n=o-1);const t=this.getValueSize();this.times=l.zS(i,n,o),this.values=l.zS(this.values,n*t,o*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const i=this.times,r=this.values,n=i.length;0===n&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let e=0;e!==n;e++){const r=i[e];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,r),t=!1;break}if(null!==o&&o>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,r,o),t=!1;break}o=r}if(void 0!==r&&l.fU(r))for(let e=0,i=r.length;e!==i;++e){const i=r[e];if(isNaN(i)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,i),t=!1;break}}return t}optimize(){const t=l.zS(this.times),e=l.zS(this.values),i=this.getValueSize(),n=this.getInterpolation()===r.InterpolateSmooth,o=t.length-1;let s=1;for(let r=1;r<o;++r){let o=!1;const a=t[r];if(a!==t[r+1]&&(1!==r||a!==t[0]))if(n)o=!0;else{const t=r*i,n=t-i,s=t+i;for(let r=0;r!==i;++r){const i=e[t+r];if(i!==e[n+r]||i!==e[s+r]){o=!0;break}}}if(o){if(r!==s){t[s]=t[r];const n=r*i,o=s*i;for(let t=0;t!==i;++t)e[o+t]=e[n+t]}++s}}if(o>0){t[s]=t[o];for(let t=o*i,r=s*i,n=0;n!==i;++n)e[r+n]=e[t+n];++s}return s!==t.length?(this.times=l.zS(t,0,s),this.values=l.zS(e,0,s*i)):(this.times=t,this.values=e),this}clone(){const t=l.zS(this.times,0),e=l.zS(this.values,0),i=new(0,this.constructor)(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}c.prototype.TimeBufferType=Float32Array,c.prototype.ValueBufferType=Float32Array,c.prototype.DefaultInterpolation=r.InterpolateLinear},1993:(t,e,i)=>{i.r(e),i.d(e,{NumberKeyframeTrack:()=>n});var r=i(9302);class n extends r.t{}n.prototype.ValueTypeName="number"},2997:(t,e,i)=>{i.r(e),i.d(e,{QuaternionKeyframeTrack:()=>l});var r=i(6271),n=i(9302),o=i(4116),s=i(9747);class a extends o._{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t,e,i,r){const n=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-e)/(r-e);let c=t*a;for(let t=c+a;c!==t;c+=4)s.Quaternion.slerpFlat(n,0,o,c-a,o,c,l);return n}}class l extends n.t{InterpolantFactoryMethodLinear(t){return new a(this.times,this.values,this.getValueSize(),t)}}l.prototype.ValueTypeName="quaternion",l.prototype.DefaultInterpolation=r.InterpolateLinear,l.prototype.InterpolantFactoryMethodSmooth=void 0},5760:(t,e,i)=>{i.r(e),i.d(e,{VectorKeyframeTrack:()=>n});var r=i(9302);class n extends r.t{}n.prototype.ValueTypeName="vector"},5086:(t,e,i)=>{i.d(e,{V:()=>o});var r=i(8333),n=i(2481);class o extends n.Object3D{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new r.Matrix4,this.projectionMatrix=new r.Matrix4,this.projectionMatrixInverse=new r.Matrix4}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}}
vendor: 6,465 bytes, line 2
2,9896:(t,e,i)=>{i.r(e),i.d(e,{OrthographicCamera:()=>n});var r=i(5086);class n extends r.V{constructor(t=-1,e=1,i=1,r=-1,n=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=r,this.near=n,this.far=o,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,i,r,n,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=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=r,this.view.width=n,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let n=i-t,o=i+t,s=r+e,a=r-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;n+=t*this.view.offsetX,o=n+t*this.view.width,s-=e*this.view.offsetY,a=s-e*this.view.height}this.projectionMatrix.makeOrthographic(n,o,s,a,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}},2479:(t,e,i)=>{i.r(e),i.d(e,{PerspectiveCamera:()=>o});var r=i(5086),n=i(3334);class o extends r.V{constructor(t=50,e=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*n.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*n.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*n.RAD2DEG*Math.atan(Math.tan(.5*n.DEG2RAD*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,i,r,n,o){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=r,this.view.width=n,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*n.DEG2RAD*this.fov)/this.zoom,i=2*e,r=this.aspect*i,o=-.5*r;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,n=s.fullHeight;o+=s.offsetX*r/t,e-=s.offsetY*i/n,r*=s.width/t,i*=s.height/n}const a=this.filmOffset;0!==a&&(o+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+r,e,e-i,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}},6271:(t,e,i)=>{i.r(e),i.d(e,{ACESFilmicToneMapping:()=>et,AddEquation:()=>T,AddOperation:()=>Z,AdditiveAnimationBlendMode:()=>Le,AdditiveBlending:()=>b,AlphaFormat:()=>Ot,AlwaysDepth:()=>B,AlwaysStencilFunc:()=>oi,BackSide:()=>f,BasicDepthPacking:()=>Ne,BasicShadowMap:()=>h,ByteType:()=>St,CineonToneMapping:()=>tt,ClampToEdgeWrapping:()=>ht,CubeReflectionMapping:()=>nt,CubeRefractionMapping:()=>ot,CubeUVReflectionMapping:()=>lt,CullFaceBack:()=>a,CullFaceFront:()=>l,CullFaceFrontBack:()=>c,CullFaceNone:()=>s,CustomBlending:()=>S,CustomToneMapping:()=>it,DecrementStencilOp:()=>Ye,DecrementWrapStencilOp:()=>Ze,DepthFormat:()=>Ft,DepthStencilFormat:()=>Ut,DisplayP3ColorSpace:()=>Ge,DoubleSide:()=>g,DstAlphaFactor:()=>k,DstColorFactor:()=>F,DynamicCopyUsage:()=>di,DynamicDrawUsage:()=>ai,DynamicReadUsage:()=>hi,EqualDepth:()=>H,EqualStencilFunc:()=>ti,EquirectangularReflectionMapping:()=>st,EquirectangularRefractionMapping:()=>at,FloatType:()=>Ct,FrontSide:()=>m,GLSL1:()=>fi,GLSL3:()=>gi,GreaterDepth:()=>W,GreaterEqualDepth:()=>q,GreaterEqualStencilFunc:()=>ni,GreaterStencilFunc:()=>ii,HalfFloatType:()=>Pt,IncrementStencilOp:()=>Xe,IncrementWrapStencilOp:()=>Ke,IntType:()=>Mt,InterpolateDiscrete:()=>Se,InterpolateLinear:()=>Te,InterpolateSmooth:()=>Ee,InvertStencilOp:()=>$e,KeepStencilOp:()=>qe,LessDepth:()=>V,LessEqualDepth:()=>G,LessEqualStencilFunc:()=>ei,LessStencilFunc:()=>Qe,LinearEncoding:()=>De,LinearFilter:()=>yt,LinearMipMapLinearFilter:()=>xt,LinearMipMapNearestFilter:()=>_t,LinearMipmapLinearFilter:()=>bt,LinearMipmapNearestFilter:()=>vt,LinearSRGBColorSpace:()=>Ve,LinearToneMapping:()=>J,LoopOnce:()=>be,LoopPingPong:()=>we,LoopRepeat:()=>xe,LuminanceAlphaFormat:()=>Nt,LuminanceFormat:()=>kt,MOUSE:()=>n,MaxEquation:()=>C,MinEquation:()=>A,MirroredRepeatWrapping:()=>ut,MixOperation:()=>K,MultiplyBlending:()=>w,MultiplyOperation:()=>Y,NearestFilter:()=>pt,NearestMipMapLinearFilter:()=>gt,NearestMipMapNearestFilter:()=>mt,NearestMipmapLinearFilter:()=>ft,NearestMipmapNearestFilter:()=>dt,NeverDepth:()=>j,NeverStencilFunc:()=>Je,NoBlending:()=>v,NoColorSpace:()=>je,NoToneMapping:()=>$,NormalAnimationBlendMode:()=>Pe,NormalBlending:()=>_,NotEqualDepth:()=>X,NotEqualStencilFunc:()=>ri,ObjectSpaceNormalMap:()=>ze,OneFactor:()=>L,OneMinusDstAlphaFactor:()=>N,OneMinusDstColorFactor:()=>U,OneMinusSrcAlphaFactor:()=>D,OneMinusSrcColorFactor:()=>I,PCFShadowMap:()=>u,PCFSoftShadowMap:()=>p,RED_GREEN_RGTC2_Format:()=>
vendor: 4,486 bytes, line 2
2ve,RED_RGTC1_Format:()=>ge,REVISION:()=>r,RGBADepthPacking:()=>Fe,RGBAFormat:()=>Dt,RGBAIntegerFormat:()=>Gt,RGBA_ASTC_10x10_Format:()=>pe,RGBA_ASTC_10x5_Format:()=>ce,RGBA_ASTC_10x6_Format:()=>he,RGBA_ASTC_10x8_Format:()=>ue,RGBA_ASTC_12x10_Format:()=>de,RGBA_ASTC_12x12_Format:()=>me,RGBA_ASTC_4x4_Format:()=>ee,RGBA_ASTC_5x4_Format:()=>ie,RGBA_ASTC_5x5_Format:()=>re,RGBA_ASTC_6x5_Format:()=>ne,RGBA_ASTC_6x6_Format:()=>oe,RGBA_ASTC_8x5_Format:()=>se,RGBA_ASTC_8x6_Format:()=>ae,RGBA_ASTC_8x8_Format:()=>le,RGBA_BPTC_Format:()=>fe,RGBA_ETC2_EAC_Format:()=>te,RGBA_PVRTC_2BPPV1_Format:()=>$t,RGBA_PVRTC_4BPPV1_Format:()=>Zt,RGBA_S3TC_DXT1_Format:()=>qt,RGBA_S3TC_DXT3_Format:()=>Wt,RGBA_S3TC_DXT5_Format:()=>Xt,RGB_ETC1_Format:()=>Jt,RGB_ETC2_Format:()=>Qt,RGB_PVRTC_2BPPV1_Format:()=>Kt,RGB_PVRTC_4BPPV1_Format:()=>Yt,RGB_S3TC_DXT1_Format:()=>Ht,RGFormat:()=>Bt,RGIntegerFormat:()=>Vt,RedFormat:()=>zt,RedIntegerFormat:()=>jt,ReinhardToneMapping:()=>Q,RepeatWrapping:()=>ct,ReplaceStencilOp:()=>We,ReverseSubtractEquation:()=>M,SIGNED_RED_GREEN_RGTC2_Format:()=>_e,SIGNED_RED_RGTC1_Format:()=>ye,SRGBColorSpace:()=>Be,ShortType:()=>Tt,SrcAlphaFactor:()=>O,SrcAlphaSaturateFactor:()=>z,SrcColorFactor:()=>R,StaticCopyUsage:()=>pi,StaticDrawUsage:()=>si,StaticReadUsage:()=>ci,StreamCopyUsage:()=>mi,StreamDrawUsage:()=>li,StreamReadUsage:()=>ui,SubtractEquation:()=>E,SubtractiveBlending:()=>x,TOUCH:()=>o,TangentSpaceNormalMap:()=>Ue,TriangleFanDrawMode:()=>Oe,TriangleStripDrawMode:()=>Ie,TrianglesDrawMode:()=>Re,TwoPassDoubleSide:()=>y,UVMapping:()=>rt,UnsignedByteType:()=>wt,UnsignedInt248Type:()=>It,UnsignedIntType:()=>At,UnsignedShort4444Type:()=>Lt,UnsignedShort5551Type:()=>Rt,UnsignedShortType:()=>Et,VSMShadowMap:()=>d,WrapAroundEnding:()=>Ce,ZeroCurvatureEnding:()=>Me,ZeroFactor:()=>P,ZeroSlopeEnding:()=>Ae,ZeroStencilOp:()=>He,_SRGBAFormat:()=>yi,sRGBEncoding:()=>ke});const r="152",n={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,h=0,u=1,p=2,d=3,m=0,f=1,g=2,y=2,v=0,_=1,b=2,x=3,w=4,S=5,T=100,E=101,M=102,A=103,C=104,P=200,L=201,R=202,I=203,O=204,D=205,k=206,N=207,F=208,U=209,z=210,j=0,B=1,V=2,G=3,H=4,q=5,W=6,X=7,Y=0,K=1,Z=2,$=0,J=1,Q=2,tt=3,et=4,it=5,rt=300,nt=301,ot=302,st=303,at=304,lt=306,ct=1e3,ht=1001,ut=1002,pt=1003,dt=1004,mt=1004,ft=1005,gt=1005,yt=1006,vt=1007,_t=1007,bt=1008,xt=1008,wt=1009,St=1010,Tt=1011,Et=1012,Mt=1013,At=1014,Ct=1015,Pt=1016,Lt=1017,Rt=1018,It=1020,Ot=1021,Dt=1023,kt=1024,Nt=1025,Ft=1026,Ut=1027,zt=1028,jt=1029,Bt=1030,Vt=1031,Gt=1033,Ht=33776,qt=33777,Wt=33778,Xt=33779,Yt=35840,Kt=35841,Zt=35842,$t=35843,Jt=36196,Qt=37492,te=37496,ee=37808,ie=37809,re=37810,ne=37811,oe=37812,se=37813,ae=37814,le=37815,ce=37816,he=37817,ue=37818,pe=37819,de=37820,me=37821,fe=36492,ge=36283,ye=36284,ve=36285,_e=36286,be=2200,xe=2201,we=2202,Se=2300,Te=2301,Ee=2302,Me=2400,Ae=2401,Ce=2402,Pe=2500,Le=2501,Re=0,Ie=1,Oe=2,De=3e3,ke=3001,Ne=3200,Fe=3201,Ue=0,ze=1,je="",Be="srgb",Ve="srgb-linear",Ge="display-p3",He=0,qe=7680,We=7681,Xe=7682,Ye=7683,Ke=34055,Ze=34056,$e=5386,Je=512,Qe=513,ti=514,ei=515,ii=516,ri=517,ni=518,oi=519,si=35044,ai=35048,li=35040,ci=35045,hi=35049,ui=35041,pi=35046,di=35050,mi=35042,fi="100",gi="300 es",yi=1035},9365:(t,e,i)=>{i.r(e),i.d(e,{BufferAttribute:()=>p,Float16BufferAttribute:()=>b,Float32BufferAttribute:()=>x,Float64BufferAttribute:()=>w,Int16BufferAttribute:()=>g,Int32BufferAttribute:()=>v,Int8BufferAttribute:()=>d,Uint16BufferAttribute:()=>y,Uint32BufferAttribute:()=>_,Uint8BufferAttribute:()=>m,Uint8ClampedBufferAttribute:()=>f});var r=i(6815),n=i(5448),o=i(3334),s=i(6271);const a=function(){const t=new ArrayBuffer(4),e=new Float32Array(t),i=new Uint32Array(t),r=new Uint32Array(512),n=new Uint32Array(512);for(let t=0;t<256;++t){const e=t-127;e<-27?(r[t]=0,r[256|t]=32768,n[t]=24,n[256|t]=24):e<-14?(r[t]=1024>>-e-14,r[256|t]=1024>>-e-14|32768,n[t]=-e-1,n[256|t]=-e-1):e<=15?(r[t]=e+15<<10,r[256|t]=e+15<<10|32768,n[t]=13,n[256|t]=13):e<128?(r[t]=31744,r[256|t]=64512,n[t]=24,n[256|t]=24):(r[t]=31744,r[256|t]=64512,n[t]=13,n[256|t]=13)}const o=new Uint32Array(2048),s=new Uint32Array(64),a=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,i=0;for(;!(8388608&e);)e<<=1,i-=8388608;e&=-8388609,i+=947912704,o[t]=e|i}for(let t=1024;t<2048;++t)o[t]=939524096+(t-1024<<13);for(let t=1;t<31;++t)s[t]=t<<23;s[31]=1199570944,s[32]=2147483648;for(let t=33;t<63;++t)s[t]=2147483648+(t-32<<23);s[63]=3347054592;for(let t=1;t<64;
2++t)32!==t&&(a[t]=1024);return{floatView:e,uint32View:i,baseTable:r,shiftTable:n,mantissaTable:o,exponentTable:s,offsetTable:a}}();function l(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=(0,o.clamp)(t,-65504,65504),a.floatView[0]=t;const e=a.uint32View[0],i=e>>23&511;return a.baseTable[i]+((8388607&e)>>a.shiftTable[i])}function c(t){const e=t>>10;return a.uint32View[0]=a.mantissaTable[a.offsetTable[e]+(1023&t)]+a.exponentTable[e],a.floatView[0]}const h=new r.Vector3,u=new n.Vector2;class p{constructor(t,e,i=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=i,this.usage=s.StaticDrawUsage,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let r=0,n=this.itemSize;r<n;r++)this.array[t+r]=e.array[i+r];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,i=this.count;e<i;e++)u.fromBufferAttribute(this,e),u.applyMatrix3(t),this.setXY(e,u.x,u.y);else if(3===this.itemSize)for(let e=0,i=this.count;e<i;e++)h.fromBufferAttribute(this,e),h.applyMatrix3(t),this.setXYZ(e,h.x,h.y,h.z);return this}applyMatrix4(t){for(let e=0,i=this.count;e<i;e++)h.fromBufferAttribute(this,e),h.applyMatrix4(t),this.setXYZ(e,h.x,h.y,h.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)h.fromBufferAttribute(this,e),h.applyNormalMatrix(t),this.setXYZ(e,h.x,h.y,h.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)h.fromBufferAttribute(this,e),h.transformDirection(t),this.setXYZ(e,h.x,h.y,h.z);return this}set(t,e=0){return this.array.set(t,e),this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=(0,o.denormalize)(e,this.array)),e}setX(t,e){return this.normalized&&(e=(0,o.normalize)(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=(0,o.denormalize)(e,this.array)),e}setY(t,e){return this.normalized&&(e=(0,o.normalize)(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=(0,o.denormalize)(e,this.array)),e}setZ(t,e){return this.normalized&&(e=(0,o.normalize)(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=(0,o.denormalize)(e,this.array)),e}setW(t,e){return this.normalized&&(e=(0,o.normalize)(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=(0,o.normalize)(e,this.array),i=(0,o.normalize)(i,this.array)),this.array[t+0]=e,this.array[t+1]=i,this}setXYZ(t,e,i,r){return t*=this.itemSize,this.normalized&&(e=(0,o.normalize)(e,this.array),i=(0,o.normalize)(i,this.array),r=(0,o.normalize)(r,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=r,this}setXYZW(t,e,i,r,n){return t*=this.itemSize,this.normalized&&(e=(0,o.normalize)(e,this.array),i=(0,o.normalize)(i,this.array),r=(0,o.normalize)(r,this.array),n=(0,o.normalize)(n,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=r,this.array[t+3]=n,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==s.StaticDrawUsage&&(t.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(t.updateRange=this.updateRange),t}copyColorsArray(){console.error("THREE.BufferAttribute: copyColorsArray() was removed in r144.")}copyVector2sArray(){console.error("THREE.BufferAttribute: copyVector2sArray() was removed in r144.")}copyVector3sArray(){console.error("THREE.BufferAttribute: copyVector3sArray() was removed in r144.")}copyVector4sArray(){console.error("THREE.BufferAttribute: copyVector4sArray() was removed in r144.")}}class d extends p{constructor(t,e,i){super(new Int8Array(t),e,i)}}class m extends p{constructor(t,e,i){super(new Uint8Array(t),e,i)}}class f extends p{constructor(t,e,i){super(new Uint8ClampedArray(t),e,i)}}class g extends p{constructor(t,e,i){super(new Int16Array(t),e,i)}}class y extends p{constructor(t,e,i){super(new Uint16Array(t),e,i)}}class v extends p{constructor(t,e,i){super(new Int32Array(t),e,i)}}class _ extends p{constructor(t,e,i){super(new Uint32Array(t),e,i)}}class b extends p{constructor(t,e,i){super(new Uint16Array(t),e,i),this.isFloat16BufferAttribute=!0}getX(t){let e=c(this.array[t*this.itemSize]);return this.normalized&&(e=(0,o.denormalize)(e,this.array)),e}setX(t,e){return this.normalized&&(e=(0,o.normalize)(e,this.array)),this.array[t*this.itemSize]=l(e),this}getY(t){let e=c(this.array[t*this.itemSize+1]);return this.normalized&&(e=(0,o.denormalize)(e,this.array)),e}setY(t,e){return this.normalized&&(e=(0,o.normalize)(e,this.array)),this.array[t*this.itemSize+1]=l(e),this}getZ(t){let e=c(this.array[t*this.itemSize+2]);return this.normalized&&(e=(0,o.denormalize)(e,this.array)),e}setZ(t,e){return this.normalized&&(e=(0,o.normalize)(e,this.array)),this.array[t*this.itemSize+2]=l(e),this}getW(t){let e=c(this.array[t*this.itemSize+3]);return this.normalized&&(e=(0,o.denormalize)(e,this.array)),e}setW(t,e){return this.normalized&&(e=(0,o.normalize)(e,this.array)),this.array[t*this.itemSize+3]=l(e),this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=(0,o.normalize)(e,this.array),i=(0,o.normalize)(i,this.array)),this.array[t+0]=l(e),this.array[t+1]=l(i),this}
2setXYZ(t,e,i,r){return t*=this.itemSize,this.normalized&&(e=(0,o.normalize)(e,this.array),i=(0,o.normalize)(i,this.array),r=(0,o.normalize)(r,this.array)),this.array[t+0]=l(e),this.array[t+1]=l(i),this.array[t+2]=l(r),this}setXYZW(t,e,i,r,n){return t*=this.itemSize,this.normalized&&(e=(0,o.normalize)(e,this.array),i=(0,o.normalize)(i,this.array),r=(0,o.normalize)(r,this.array),n=(0,o.normalize)(n,this.array)),this.array[t+0]=l(e),this.array[t+1]=l(i),this.array[t+2]=l(r),this.array[t+3]=l(n),this}}class x extends p{constructor(t,e,i){super(new Float32Array(t),e,i)}}class w extends p{constructor(t,e,i){super(new Float64Array(t),e,i)}}},3148:(t,e,i)=>{i.r(e),i.d(e,{BufferGeometry:()=>x});var r=i(6815),n=i(5448),o=i(2754),s=i(2356),a=i(9365),l=i(5381),c=i(2481),h=i(8333),u=i(8955),p=i(3334),d=i(1968);let m=0;const f=new h.Matrix4,g=new c.Object3D,y=new r.Vector3,v=new o.Box3,_=new o.Box3,b=new r.Vector3;class x extends s.EventDispatcher{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:m++}),this.uuid=p.generateUUID(),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(t){return Array.isArray(t)?this.index=new((0,d.H7)(t)?a.Uint32BufferAttribute:a.Uint16BufferAttribute)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,i=0){this.groups.push({start:t,count:e,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const i=this.attributes.normal;if(void 0!==i){const e=(new u.Matrix3).getNormalMatrix(t);i.applyNormalMatrix(e),i.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(t),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return f.makeRotationFromQuaternion(t),this.applyMatrix4(f),this}rotateX(t){return f.makeRotationX(t),this.applyMatrix4(f),this}rotateY(t){return f.makeRotationY(t),this.applyMatrix4(f),this}rotateZ(t){return f.makeRotationZ(t),this.applyMatrix4(f),this}translate(t,e,i){return f.makeTranslation(t,e,i),this.applyMatrix4(f),this}scale(t,e,i){return f.makeScale(t,e,i),this.applyMatrix4(f),this}lookAt(t){return g.lookAt(t),g.updateMatrix(),this.applyMatrix4(g.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(y).negate(),this.translate(y.x,y.y,y.z),this}setFromPoints(t){const e=[];for(let i=0,r=t.length;i<r;i++){const r=t[i];e.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new a.Float32BufferAttribute(e,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new o.Box3);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "fal
2se".',this),void this.boundingBox.set(new r.Vector3(-1/0,-1/0,-1/0),new r.Vector3(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){const i=e[t];v.setFromBufferAttribute(i),this.morphTargetsRelative?(b.addVectors(this.boundingBox.min,v.min),this.boundingBox.expandByPoint(b),b.addVectors(this.boundingBox.max,v.max),this.boundingBox.expandByPoint(b)):(this.boundingBox.expandByPoint(v.min),this.boundingBox.expandByPoint(v.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 l.Sphere);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "fal
2se".',this),void this.boundingSphere.set(new r.Vector3,1/0);if(t){const i=this.boundingSphere.center;if(v.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){const i=e[t];_.setFromBufferAttribute(i),this.morphTargetsRelative?(b.addVectors(v.min,_.min),v.expandByPoint(b),b.addVectors(v.max,_.max),v.expandByPoint(b)):(v.expandByPoint(_.min),v.expandByPoint(_.max))}v.getCenter(i);let r=0;for(let e=0,n=t.count;e<n;e++)b.fromBufferAttribute(t,e),r=Math.max(r,i.distanceToSquared(b));if(e)for(let n=0,o=e.length;n<o;n++){const o=e[n],s=this.morphTargetsRelative;for(let e=0,n=o.count;e<n;e++)b.fromBufferAttribute(o,e),s&&(y.fromBufferAttribute(t,e),b.add(y)),r=Math.max(r,i.distanceToSquared(b))}this.boundingSphere.radius=Math.sqrt(r),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 t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const i=t.array,o=e.position.array,s=e.normal.array,l=e.uv.array,c=o.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new a.BufferAttribute(new Float32Array(4*c),4));const h=this.getAttribute("tangent").array,u=[],p=[];for(let t=0;t<c;t++)u[t]=new r.Vector3,p[t]=new r.Vector3;const d=new r.Vector3,m=new r.Vector3,f=new r.Vector3,g=new n.Vector2,y=new n.Vector2,v=new n.Vector2,_=new r.Vector3,b=new r.Vector3;function x(t,e,i){d.fromArray(o,3*t),m.fromArray(o,3*e),f.fromArray(o,3*i),g.fromArray(l,2*t),y.fromArray(l,2*e),v.fromArray(l,2*i),m.sub(d),f.sub(d),y.sub(g),v.sub(g);const r=1/(y.x*v.y-v.x*y.y);isFinite(r)&&(_.copy(m).multiplyScalar(v.y).addScaledVector(f,-y.y).multiplyScalar(r),b.copy(f).multiplyScalar(y.x).addScaledVector(m,-v.x).multiplyScalar(r),u[t].add(_),u[e].add(_),u[i].add(_),p[t].add(b),p[e].add(b),p[i].add(b))}let w=this.groups;0===w.length&&(w=[{start:0,count:i.length}]);for(let t=0,e=w.length;t<e;++t){const e=w[t],r=e.start;for(let t=r,n=r+e.count;t<n;t+=3)x(i[t+0],i[t+1],i[t+2])}const S=new r.Vector3,T=new r.Vector3,E=new r.Vector3,M=new r.Vector3;function A(t){E.fromArray(s,3*t),M.copy(E);const e=u[t];S.copy(e),S.sub(E.multiplyScalar(E.dot(e))).normalize(),T.crossVectors(M,e);const i=T.dot(p[t])<0?-1:1;h[4*t]=S.x,h[4*t+1]=S.y,h[4*t+2]=S.z,h[4*t+3]=i}for(let t=0,e=w.length;t<e;++t){const e=w[t],r=e.start;for(let t=r,n=r+e.count;t<n;t+=3)A(i[t+0]),A(i[t+1]),A(i[t+2])}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let i=this.getAttribute("normal");if(void 0===i)i=new a.BufferAttribute(new Float32Array(3*e.count),3),this.setAttribute("normal",i);else for(let t=0,e=i.count;t<e;t++)i.setXYZ(t,0,0,0);const n=new r.Vector3,o=new r.Vector3,s=new r.Vector3,l=new r.Vector3,c=new r.Vector3,h=new r.Vector3,u=new r.Vector3,p=new r.Vector3;if(t)for(let r=0,a=t.count;r<a;r+=3){const a=t.getX(r+0),d=t.getX(r+1),m=t.getX(r+2);n.fromBufferAttribute(e,a),o.fromBufferAttribute(e,d),s.fromBufferAttribute(e,m),u.subVectors(s,o),p.subVectors(n,o),u.cross(p),l.fromBufferAttribute(i,a),c.fromBufferAttribute(i,d),h.fromBufferAttribute(i,m),l.add(u),c.add(u),h.add(u),i.setXYZ(a,l.x,l.y,l.z),i.setXYZ(d,c.x,c.y,c.z),i.setXYZ(m,h.x,h.y,h.z)}else for(let t=0,r=e.count;t<r;t+=3)n.fromBufferAttribute(e,t+0),o.fromBufferAttribute(e,t+1),s.fromBufferAttribute(e,t+2),u.subVectors(s,o),p.subVectors(n,o),u.cross(p),i.setXYZ(t+0,u.x,u.y,u.z),i.setXYZ(t+1,u.x,u.y,u.z),i.setXYZ(t+2,u.x,u.y,u.z);this.normalizeNormals(),i.needsUpdate=!0}}merge(){return console.error("THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeGeometries() instead."),this}normalizeNormals(){const t=this.attributes.normal;for(let e=0,i=t.count;e<i;e++)b.fromBufferAttribute(t,e),b.normalize(),t.setXYZ(e,b.x,b.y,b.z)}toNonIndexed(){function t(t,e){const i=t.array,r=t.itemSize,n=t.normalized,o=new i.constructor(e.length*r);let s=0,l=0;for(let n=0,a=e.length;n<a;n++){s=t.isInterleavedBufferAttribute?e[n]*t.data.stride+t.offset:e[n]*r;for(let t=0;t<r;t++)o[l++]=i[s++]}return new a.BufferAttribute(o,r,n)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new x,i=this.index.array,r=this.attributes;for(const n in r){const o=t(r[n],i);e.setAttribute(n,o)}const n=this.morphAttributes;for(const r in n){const o=[],s=n[r];for(let e=0,r=s.length;e<r;e++){const r=t(s[e],i);o.push(r)}e.morphAttributes[r]=o}e.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let t=0,i=o.length;t<i;t++){const i=o[t];e.addGroup(i.start,i.count,i.materialIndex)}return e}toJSON(){const t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};
vendor: 4,328 bytes, line 2
2if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const e in i){const r=i[e];t.data.attributes[e]=r.toJSON(t.data)}const r={};let n=!1;for(const e in this.morphAttributes){const i=this.morphAttributes[e],o=[];for(let e=0,r=i.length;e<r;e++){const r=i[e];o.push(r.toJSON(t.data))}o.length>0&&(r[e]=o,n=!0)}n&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));const s=this.boundingSphere;return null!==s&&(t.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;null!==i&&this.setIndex(i.clone(e));const r=t.attributes;for(const t in r){const i=r[t];this.setAttribute(t,i.clone(e))}const n=t.morphAttributes;for(const t in n){const i=[],r=n[t];for(let t=0,n=r.length;t<n;t++)i.push(r[t].clone(e));this.morphAttributes[t]=i}this.morphTargetsRelative=t.morphTargetsRelative;const o=t.groups;for(let t=0,e=o.length;t<e;t++){const e=o[t];this.addGroup(e.start,e.count,e.materialIndex)}const s=t.boundingBox;null!==s&&(this.boundingBox=s.clone());const a=t.boundingSphere;return null!==a&&(this.boundingSphere=a.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}},2356:(t,e,i)=>{i.r(e),i.d(e,{EventDispatcher:()=>r});class r{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const i=this._listeners[t];if(void 0!==i){const t=i.indexOf(e);-1!==t&&i.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const i=e.slice(0);for(let e=0,r=i.length;e<r;e++)i[e].call(this,t);t.target=null}}}},9044:(t,e,i)=>{i.r(e),i.d(e,{InterleavedBuffer:()=>o});var r=i(3334),n=i(6271);class o{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=n.StaticDrawUsage,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=r.generateUUID()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let r=0,n=this.stride;r<n;r++)this.array[t+r]=e.array[i+r];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=r.generateUUID()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(e,this.stride);return i.setUsage(this.usage),i}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=r.generateUUID()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}},6280:(t,e,i)=>{i.r(e),i.d(e,{InterleavedBufferAttribute:()=>a});var r=i(6815),n=i(9365),o=i(3334);const s=new r.Vector3;class a{constructor(t,e,i,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=i,this.normalized=r}
2get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,i=this.data.count;e<i;e++)s.fromBufferAttribute(this,e),s.applyMatrix4(t),this.setXYZ(e,s.x,s.y,s.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)s.fromBufferAttribute(this,e),s.applyNormalMatrix(t),this.setXYZ(e,s.x,s.y,s.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)s.fromBufferAttribute(this,e),s.transformDirection(t),this.setXYZ(e,s.x,s.y,s.z);return this}setX(t,e){return this.normalized&&(e=(0,o.normalize)(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=(0,o.normalize)(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=(0,o.normalize)(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=(0,o.normalize)(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=(0,o.denormalize)(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=(0,o.denormalize)(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=(0,o.denormalize)(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=(0,o.denormalize)(e,this.array)),e}setXY(t,e,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=(0,o.normalize)(e,this.array),i=(0,o.normalize)(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this}setXYZ(t,e,i,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=(0,o.normalize)(e,this.array),i=(0,o.normalize)(i,this.array),r=(0,o.normalize)(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=r,this}setXYZW(t,e,i,r,n){return t=t*this.data.stride+this.offset,this.normalized&&(e=(0,o.normalize)(e,this.array),i=(0,o.normalize)(i,this.array),r=(0,o.normalize)(r,this.array),n=(0,o.normalize)(n,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=r,this.data.array[t+3]=n,this}clone(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return new n.BufferAttribute(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new a(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}},1389:(t,e,i)=>{i.d(e,{S:()=>r});class r{constructor(){this.mask=1}set(t){this.mask=1<<t>>>0}enable(t){this.mask|=1<<t}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t}disable(t){this.mask&=~(1<<t)}disableAll(){this.mask=0}test(t){return!!(this.mask&t.mask)}isEnabled(t){return!!(this.mask&1<<t)}}},2481:(t,e,i)=>{i.r(e),i.d(e,{Object3D:()=>M});var r=i(9747),n=i(6815),o=i(8333),s=i(2356),a=i(3334);const l=new o.Matrix4,c=new r.Quaternion;
vendor: 4,367 bytes, line 2
2class h{constructor(t=0,e=0,i=0,r=h.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,r=this._order){return this._x=t,this._y=e,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const r=t.elements,n=r[0],o=r[4],s=r[8],l=r[1],c=r[5],h=r[9],u=r[2],p=r[6],d=r[10];switch(e){case"XYZ":this._y=Math.asin((0,a.clamp)(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-o,n)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-(0,a.clamp)(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,n),this._z=0);break;case"ZXY":this._x=Math.asin((0,a.clamp)(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,n));break;case"ZYX":this._y=Math.asin(-(0,a.clamp)(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(p,d),this._z=Math.atan2(l,n)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin((0,a.clamp)(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,n)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-(0,a.clamp)(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(s,n)):(this._x=Math.atan2(-h,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return l.makeRotationFromQuaternion(t),this.setFromRotationMatrix(l,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return c.setFromEuler(this),this.setFromQuaternion(c,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}h.DEFAULT_ORDER="XYZ";var u=i(1389),p=i(8955);let d=0;const m=new n.Vector3,f=new r.Quaternion,g=new o.Matrix4,y=new n.Vector3,v=new n.Vector3,_=new n.Vector3,b=new r.Quaternion,x=new n.Vector3(1,0,0),w=new n.Vector3(0,1,0),S=new n.Vector3(0,0,1),T={type:"added"},E={type:"removed"};class M extends s.EventDispatcher{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:d++}),this.uuid=a.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=M.DEFAULT_UP.clone();const t=new n.Vector3,e=new h,i=new r.Quaternion,s=new n.Vector3(1,1,1);e._onChange(function(){i.setFromEuler(e,!1)}),i._onChange(function(){e.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:s},modelViewMatrix:{value:new o.Matrix4},normalMatrix:{value:new p.Matrix3}}),this.matrix=new o.Matrix4,this.matrixWorld=new o.Matrix4,this.matrixAutoUpdate=M.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=M.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.layers=new u.S,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}
vendor: 4,206 bytes, line 2
2setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return f.setFromAxisAngle(t,e),this.quaternion.multiply(f),this}rotateOnWorldAxis(t,e){return f.setFromAxisAngle(t,e),this.quaternion.premultiply(f),this}rotateX(t){return this.rotateOnAxis(x,t)}rotateY(t){return this.rotateOnAxis(w,t)}rotateZ(t){return this.rotateOnAxis(S,t)}translateOnAxis(t,e){return m.copy(t).applyQuaternion(this.quaternion),this.position.add(m.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(x,t)}translateY(t){return this.translateOnAxis(w,t)}translateZ(t){return this.translateOnAxis(S,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(g.copy(this.matrixWorld).invert())}lookAt(t,e,i){t.isVector3?y.copy(t):y.set(t,e,i);const r=this.parent;this.updateWorldMatrix(!0,!1),v.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?g.lookAt(v,y,this.up):g.lookAt(y,v,this.up),this.quaternion.setFromRotationMatrix(g),r&&(g.extractRotation(r.matrixWorld),f.setFromRotationMatrix(g),this.quaternion.premultiply(f.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(T)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(E)),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=null,e.dispatchEvent(E)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),g.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),g.multiply(t.parent.matrixWorld)),t.applyMatrix4(g),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let i=0,r=this.children.length;i<r;i++){const r=this.children[i].getObjectByProperty(t,e);if(void 0!==r)return r}}getObjectsByProperty(t,e){let i=[];this[t]===e&&i.push(this);for(let r=0,n=this.children.length;r<n;r++){const n=this.children[r].getObjectsByProperty(t,e);n.length>0&&(i=i.concat(n))}return i}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(v,t,_),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(v,b,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let i=0,r=e.length;i<r;i++)e[i].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let i=0,r=e.length;i<r;i++)e[i].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let i=0,r=e.length;i<r;i++){const r=e[i];!0!==r.matrixWorldAutoUpdate&&!0!==t||r.updateMatrixWorld(t)}}updateWorldMatrix(t,e){const i=this.parent;if(!0===t&&null!==i&&!0===i.matrixWorldAutoUpdate&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix
vendor: 4,508 bytes, line 2
2):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const t=this.children;for(let e=0,i=t.length;e<i;e++){const i=t[e];!0===i.matrixWorldAutoUpdate&&i.updateWorldMatrix(!1,!0)}}}toJSON(t){const e=void 0===t||"string"==typeof t,i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const r={};function n(e,i){return void 0===e[i.uuid]&&(e[i.uuid]=i.toJSON(t)),i.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=n(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const i=e.shapes;if(Array.isArray(i))for(let e=0,r=i.length;e<r;e++){const r=i[e];n(t.shapes,r)}else n(t.shapes,i)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(n(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let i=0,r=this.material.length;i<r;i++)e.push(n(t.materials,this.material[i]));r.material=e}else r.material=n(t.materials,this.material);if(this.children.length>0){r.children=[];for(let e=0;e<this.children.length;e++)r.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let e=0;e<this.animations.length;e++){const i=this.animations[e];r.animations.push(n(t.animations,i))}}if(e){const e=o(t.geometries),r=o(t.materials),n=o(t.textures),s=o(t.images),a=o(t.shapes),l=o(t.skeletons),c=o(t.animations),h=o(t.nodes);e.length>0&&(i.geometries=e),r.length>0&&(i.materials=r),n.length>0&&(i.textures=n),s.length>0&&(i.images=s),a.length>0&&(i.shapes=a),l.length>0&&(i.skeletons=l),c.length>0&&(i.animations=c),h.length>0&&(i.nodes=h)}return i.object=r,i;function o(t){const e=[];for(const i in t){const r=t[i];delete r.metadata,e.push(r)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){const i=t.children[e];this.add(i.clone())}return this}}M.DEFAULT_UP=new n.Vector3(0,1,0),M.DEFAULT_MATRIX_AUTO_UPDATE=!0,M.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0},3216:(t,e,i)=>{i.r(e),i.d(e,{Raycaster:()=>o});var r=i(2309),n=i(1389);class o{constructor(t,e,i=0,o=1/0){this.ray=new r.Ray(t,e),this.near=i,this.far=o,this.camera=null,this.layers=new n.S,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster:
2Unsupported camera type: "+e.type)}intersectObject(t,e=!0,i=[]){return a(t,this,i,e),i.sort(s),i}intersectObjects(t,e=!0,i=[]){for(let r=0,n=t.length;r<n;r++)a(t[r],this,i,e);return i.sort(s),i}}function s(t,e){return t.distance-e.distance}function a(t,e,i,r){if(t.layers.test(e.layers)&&t.raycast(e,i),!0===r){const r=t.children;for(let t=0,n=r.length;t<n;t++)a(r[t],e,i,!0)}}},4125:(t,e,i)=>{i.r(e),i.d(e,{Uniform:()=>r});class r{constructor(t){this.value=t}clone(){return new r(void 0===this.value.clone?this.value:this.value.clone())}}},6782:(t,e,i)=>{i.r(e),i.d(e,{Earcut:()=>r});const r={triangulate:function(t,e,i=2){const r=e&&e.length,o=r?e[0]*i:t.length;let a=n(t,0,o,i,!0);const l=[];if(!a||a.next===a.prev)return l;let c,h,d,m,g,y,v;if(r&&(a=function(t,e,i,r){const o=[];let s,a,l,c,h;for(s=0,a=e.length;s<a;s++)l=e[s]*r,c=s<a-1?e[s+1]*r:t.length,h=n(t,l,c,r,!1),h===h.next&&(h.steiner=!0),o.push(f(h));for(o.sort(u),s=0;s<o.length;s++)i=p(o[s],i);return i}(t,e,a,i)),t.length>80*i){c=d=t[0],h=m=t[1];for(let e=i;e<o;e+=i)g=t[e],y=t[e+1],g<c&&(c=g),y<h&&(h=y),g>d&&(d=g),y>m&&(m=y);v=Math.max(d-c,m-h),v=0!==v?32767/v:0}return s(a,l,i,c,h,v,0),l}};function n(t,e,i,r,n){let o,s;if(n===function(t,e,i,r){let n=0;for(let o=e,s=i-r;o<i;o+=r)n+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return n}(t,e,i,r)>0)for(o=e;o<i;o+=r)s=E(o,t[o],t[o+1],s);else for(o=i-r;o>=e;o-=r)s=E(o,t[o],t[o+1],s);return s&&_(s,s.next)&&(M(s),s=s.next),s}function o(t,e){if(!t)return t;e||(e=t);let i,r=t;do{if(i=!1,r.steiner||!_(r,r.next)&&0!==v(r.prev,r,r.next))r=r.next;else{if(M(r),r=e=r.prev,r===r.next)break;i=!0}}while(i||r!==e);return e}function s(t,e,i,r,n,u,p){if(!t)return;!p&&u&&function(t,e,i,r){let n=t;do{0===n.z&&(n.z=m(n.x,n.y,e,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){let e,i,r,n,o,s,a,l,c=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,r=i,a=0,e=0;e<c&&(a++,r=r.nextZ,r);e++);for(l=c;a>0||l>0&&r;)0!==a&&(0===l||!r||i.z<=r.z)?(n=i,i=i.nextZ,a--):(n=r,r=r.nextZ,l--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;i=r}o.nextZ=null,c*=2}while(s>1)}(n)}(t,r,n,u);let d,f,g=t;for(;t.prev!==t.next;)if(d=t.prev,f=t.next,u?l(t,r,n,u):a(t))e.push(d.i/i|0),e.push(t.i/i|0),e.push(f.i/i|0),M(t),t=f.next,g=f.next;else if((t=f)===g){p?1===p?s(t=c(o(t),e,i),e,i,r,n,u,2):2===p&&h(t,e,i,r,n,u):s(o(t),e,i,r,n,u,1);break}}function a(t){const e=t.prev,i=t,r=t.next;if(v(e,i,r)>=0)return!1;const n=e.x,o=i.x,s=r.x,a=e.y,l=i.y,c=r.y,h=n<o?n<s?n:s:o<s?o:s,u=a<l?a<c?a:c:l<c?l:c,p=n>o?n>s?n:s:o>s?o:s,d=a>l?a>c?a:c:l>c?l:c;let m=r.next;for(;m!==e;){if(m.x>=h&&m.x<=p&&m.y>=u&&m.y<=d&&g(n,a,o,l,s,c,m.x,m.y)&&v(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function l(t,e,i,r){const n=t.prev,o=t,s=t.next;if(v(n,o,s)>=0)return!1;const a=n.x,l=o.x,c=s.x,h=n.y,u=o.y,p=s.y,d=a<l?a<c?a:c:l<c?l:c,f=h<u?h<p?h:p:u<p?u:p,y=a>l?a>c?a:c:l>c?l:c,_=h>u?h>p?h:p:u>p?u:p,b=m(d,f,e,i,r),x=m(y,_,e,i,r);let w=t.prevZ,S=t.nextZ;for(;w&&w.z>=b&&S&&S.z<=x;){if(w.x>=d&&w.x<=y&&w.y>=f&&w.y<=_&&w!==n&&w!==s&&g(a,h,l,u,c,p,w.x,w.y)&&v(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,S.x>=d&&S.x<=y&&S.y>=f&&S.y<=_&&S!==n&&S!==s&&g(a,h,l,u,c,p,S.x,S.y)&&v(S.prev,S,S.next)>=0)return!1;S=S.nextZ}for(;w&&w.z>=b;){if(w.x>=d&&w.x<=y&&w.y>=f&&w.y<=_&&w!==n&&w!==s&&g(a,h,l,u,c,p,w.x,w.y)&&v(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;S&&S.z<=x;){if(S.x>=d&&S.x<=y&&S.y>=f&&S.y<=_&&S!==n&&S!==s&&g(a,h,l,u,c,p,S.x,S.y)&&v(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function c(t,e,i){let r=t;do{const n=r.prev,o=r.next.next;!_(n,o)&&b(n,r,r.next,o)&&S(n,o)&&S(o,n)&&(e.push(n.i/i|0),e.push(r.i/i|0),e.push(o.i/i|0),M(r),M(r.next),r=t=o),r=r.next}while(r!==t);return o(r)}function h(t,e,i,r,n,a){let l=t;do{let t=l.next.next;for(;t!==l.prev;){if(l.i!==t.i&&y(l,t)){let c=T(l,t);return l=o(l,l.next),c=o(c,c.next),s(l,e,i,r,n,a,0),void s(c,e,i,r,n,a,0)}t=t.next}l=l.next}while(l!==t)}function u(t,e){return t.x-e.x}function p(t,e){const i=function(t,e){let i,r=e,n=-1/0;const o=t.x,s=t.y;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){const t=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y
vendor: 21,533 bytes, line 2
2);if(t<=o&&t>n&&(n=t,i=r.x<r.next.x?r:r.next,t===o))return i}r=r.next}while(r!==e);if(!i)return null;const a=i,l=i.x,c=i.y;let h,u=1/0;r=i;do{o>=r.x&&r.x>=l&&o!==r.x&&g(s<c?o:n,s,l,c,s<c?n:o,s,r.x,r.y)&&(h=Math.abs(s-r.y)/(o-r.x),S(r,t)&&(h<u||h===u&&(r.x>i.x||r.x===i.x&&d(i,r)))&&(i=r,u=h)),r=r.next}while(r!==a);return i}(t,e);if(!i)return e;const r=T(i,t);return o(r,r.next),o(i,i.next)}function d(t,e){return v(t.prev,t,e.prev)<0&&v(e.next,t,t.next)<0}function m(t,e,i,r,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){let e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function g(t,e,i,r,n,o,s,a){return(n-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(r-a)>=(i-s)*(e-a)&&(i-s)*(o-a)>=(n-s)*(r-a)}function y(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&b(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(S(t,e)&&S(e,t)&&function(t,e){let i=t,r=!1;const n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)&&(v(t.prev,t,e.prev)||v(t,e.prev,e))||_(t,e)&&v(t.prev,t,t.next)>0&&v(e.prev,e,e.next)>0)}function v(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function _(t,e){return t.x===e.x&&t.y===e.y}function b(t,e,i,r){const n=w(v(t,e,i)),o=w(v(t,e,r)),s=w(v(i,r,t)),a=w(v(i,r,e));return n!==o&&s!==a||!(0!==n||!x(t,i,e))||!(0!==o||!x(t,r,e))||!(0!==s||!x(i,t,r))||!(0!==a||!x(i,e,r))}function x(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function w(t){return t>0?1:t<0?-1:0}function S(t,e){return v(t.prev,t,t.next)<0?v(t,e,t.next)>=0&&v(t,t.prev,e)>=0:v(t,e,t.prev)<0||v(t,t.next,e)<0}function T(t,e){const i=new A(t.i,t.x,t.y),r=new A(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function E(t,e,i,r){const n=new A(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function M(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}},7300:(t,e,i)=>{i.d(e,{P:()=>s});var r=i(1968),n=i(9677);let o;class s{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===o&&(o=(0,r.c)("canvas")),o.width=t.width,o.height=t.height;const i=o.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=o}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=(0,r.c)("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const o=i.getImageData(0,0,t.width,t.height),s=o.data;for(let t=0;t<s.length;t++)s[t]=255*(0,n.SRGBToLinear)(s[t]/255);return i.putImageData(o,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*(0,n.SRGBToLinear)(e[t]/255)):e[t]=(0,n.SRGBToLinear)(e[t]);return{data:e,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}},9776:(t,e,i)=>{i.r(e),i.d(e,{ShapeUtils:()=>n});var r=i(6782);class n{static area(t){const e=t.length;let i=0;for(let r=e-1,n=0;n<e;r=n++)i+=t[r].x*t[n].y-t[n].x*t[r].y;return.5*i}static isClockWise(t){return n.area(t)<0}static triangulateShape(t,e){const i=[],n=[],a=[];o(t),s(i,t);let l=t.length;e.forEach(o);for(let t=0;t<e.length;t++)n.push(l),l+=e[t].length,s(i,e[t]);const c=r.Earcut.triangulate(i,n);for(let t=0;t<c.length;t+=3)a.push(c.slice(t,t+3));return a}}function o(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function s(t,e){for(let i=0;i<e.length;i++)t.push(e[i].x),t.push(e[i].y)}},2848:(t,e,i)=>{i.d(e,{H:()=>a});var r=i(3334),n=i(5448),o=i(6815),s=i(8333);class a{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let i,r=this.getPoint(0),n=0;e.push(0);for(let o=1;o<=t;o++)i=this.getPoint(o/t),n+=i.distanceTo(r),e.push(n),r=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const i=this.getLengths();let r=0;const n=i.length;let o;o=e||t*i[n-1];let s,a=0,l=n-1;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),s=i[r]-o,s<0)a=r+1;else{if(!(s>0)){l=r;break}l=r-1}if(r=l,i[r]===o)return r/(n-1);const c=i[r];return(r+(o-c)/(i[r+1]-c))/(n-1)}getTangent(t,e){const i=1e-4;let r=t-i,s=t+i;r<0&&(r=0),s>1&&(s=1);const a=this.getPoint(r),l=this.getPoint(s),c=e||(a.isVector2?new n.Vector2:new o.Vector3);return c.copy(l).sub(a).normalize(),c}getTangentAt(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e){const i=new o.Vector3,n=[],a=[],l=[],c=new o.Vector3,h=new s.Matrix4;for(let e=0;e<=t;e++){const i=e/t;n[e]=this.getTangentAt(i,new o.Vector3)}a[0]=new o.Vector3,l[0]=new o.Vector3;let u=Number.MAX_VALUE;const p=Math.abs(n[0].x),d=Math.abs(n[0].y),m=Math.abs(n[0].z);p<=u&&(u=p,i.set(1,0,0)),d<=u&&(u=d,i.set(0,1,0)),m<=u&&i.set(0,0,1),c.crossVectors(n[0],i).normalize(),a[0].crossVectors(n[0],c),l[0].crossVectors(n[0],a[0]);for(let e=1;e<=t;e++){if(a[e]=a[e-1].clone(),l[e]=l[e-1].clone(),c.crossVectors(n[e-1],n[e]),c.length()>Number.EPSILON){c.normalize();const t=Math.acos(r.clamp(n[e-1].dot(n[e]),-1,1));a[e].applyMatrix4(h.makeRotationAxis(c,t))}l[e].crossVectors(n[e],a[e])}if(!0===e){let e=Math.acos(r.clamp(a[0].dot(a[t]),-1,1));e/=t,n[0].dot(c.crossVectors(a[0],a[t]))>0&&(e=-e);for(let i=1;i<=t;i++)a[i].applyMatrix4(h.makeRotationAxis(n[i],e*i)),l[i].crossVectors(n[i],a[i])}return{tangents:n,normals:a,binormals:l}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}},8117:(t,e,i)=>{i.r(e),i.d(e,{Path:()=>M});var r={};i.r(r),i.d(r,{ArcCurve:()=>l,CatmullRomCurve3:()=>f,CubicBezierCurve:()=>_,CubicBezierCurve3:()=>b,EllipseCurve:()=>a,LineCurve:()=>s.LineCurve,LineCurve3:()=>x,QuadraticBezierCurve:()=>w,QuadraticBezierCurve3:()=>S,SplineCurve:()=>T});var n=i(5448),o=i(2848),s=i(7793);class a extends o.H{constructor(t=0,e=0,i=1,r=1,n=0,o=2*Math.PI,s=!1,a=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=r,this.aStartAngle=n,this.aEndAngle=o,this.aClockwise=s,this.aRotation=a}getPoint(t,e){const i=e||new n.Vector2,r=2*Math.PI;let o=this.aEndAngle-this.aStartAngle;const s=Math.abs(o)<Number.EPSILON;for(;o<0;)o+=r;for(;o>r;)o-=r;o<Number.EPSILON&&(o=s?0:r),!0!==this.aClockwise||s||(o===r?o=-r:o-=r);const a=this.aStartAngle+t*o;let l=this.aX+this.xRadius*Math.cos(a),c=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){const t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),i=l-this.aX,r=c-this.aY;l=i*t-r*e+this.aX,c=i*e+r*t+this.aY}return i.set(l,c)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}class l extends a{constructor(t,e,i,r,n,o){super(t,e,i,i,r,n,o),this.isArcCurve=!0,this.type="ArcCurve"}}var c=i(6815);function h(){let t=0,e=0,i=0,r=0;function n(n,o,s,a){t=n,e=s,i=-3*n+3*o-2*s-a,r=2*n-2*o+s+a}return{initCatmullRom:function(t,e,i,r,o){n(e,i,o*(i-t),o*(r-e))},initNonuniformCatmullRom:function(t,e,i,r,o,s,a){let l=(e-t)/o-(i-t)/(o+s)+(i-e)/s,c=(i-e)/s-(r-e)/(s+a)+(r-i)/a;l*=s,c*=s,n(e,i,l,c)},calc:function(n){const o=n*n;return t+e*n+i*o+r*(o*n)}}}const u=new c.Vector3,p=new h,d=new h,m=new h;class f extends o.H{constructor(t=[],e=!1,i="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=i,this.tension=r}getPoint(t,e=new c.Vector3){const i=e,r=this.points,n=r.length,o=(n-(this.closed?0:1))*t;let s,a,l=Math.floor(o),h=o-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/n)+1)*n:0===h&&l===n-1&&(l=n-2,h=1),this.closed||l>0?s=r[(l-1)%n]:(u.subVectors(r[0],r[1]).add(r[0]),s=u);const f=r[l%n],g=r[(l+1)%n];if(this.closed||l+2<n?a=r[(l+2)%n]:(u.subVectors(r[n-1],r[n-2]).add(r[n-1]),a=u),"centripetal"===this.curveType||"chordal"===this.curveType){const t="chordal"===this.curveType?.5:.25;let e=Math.pow(s.distanceToSquared(f),t),i=Math.pow(f.distanceToSquared(g),t),r=Math.pow(g.distanceToSquared(a),t);i<1e-4&&(i=1),e<1e-4&&(e=i),r<1e-4&&(r=i),p.initNonuniformCatmullRom(s.x,f.x,g.x,a.x,e,i,r),d.initNonuniformCatmullRom(s.y,f.y,g.y,a.y,e,i,r),m.initNonuniformCatmullRom(s.z,f.z,g.z,a.z,e,i,r)}else"catmullrom"===this.curveType&&(p.initCatmullRom(s.x,f.x,g.x,a.x,this.tension),d.initCatmullRom(s.y,f.y,g.y,a.y,this.tension),m.initCatmullRom(s.z,f.z,g.z,a.z,this.tension));return i.set(p.calc(h),d.calc(h),m.calc(h)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){const i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push((new c.Vector3).fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function g(t,e,i,r,n){const o=.5*(r-e),s=.5*(n-i),a=t*t;return(2*i-2*r+o+s)*(t*a)+(-3*i+3*r-2*o-s)*a+o*t+i}function y(t,e,i,r){return function(t,e){const i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,r)}function v(t,e,i,r,n){return function(t,e){const i=1-t;return i*i*i*e}(t,e)+function(t,e){const i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,r)+function(t,e){return t*t*t*e}(t,n)}class _ extends o.H{constructor(t=new n.Vector2,e=new n.Vector2,i=new n.Vector2,r=new n.Vector2){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=i,this.v3=r}getPoint(t,e=new n.Vector2){const i=e,r=this.v0,o=this.v1,s=this.v2,a=this.v3;return i.set(v(t,r.x,o.x,s.x,a.x),v(t,r.y,o.y,s.y,a.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class b extends o.H{constructor(t=new c.Vector3,e=new c.Vector3,i=new c.Vector3,r=new c.Vector3){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=i,this.v3=r}getPoint(t,e=new c.Vector3){const i=e,r=this.v0,n=this.v1,o=this.v2,s=this.v3;return i.set(v(t,r.x,n.x,o.x,s.x),v(t,r.y,n.y,o.y,s.y),v(t,r.z,n.z,o.z,s.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class x extends o.H{constructor(t=new c.Vector3,e=new c.Vector3){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new c.Vector3){const i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new c.Vector3){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class w extends o.H{constructor(t=new n.Vector2,e=new n.Vector2,i=new n.Vector2){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new n.Vector2){const i=e,r=this.v0,o=this.v1,s=this.v2;return i.set(y(t,r.x,o.x,s.x),y(t,r.y,o.y,s.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class S extends o.H{constructor(t=new c.Vector3,e=new c.Vector3,i=new c.Vector3){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new c.Vector3){const i=e,r=this.v0,n=this.v1,o=this.v2;return i.set(y(t,r.x,n.x,o.x),y(t,r.y,n.y,o.y),y(t,r.z,n.z,o.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class T extends o.H{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new n.Vector2){const i=e,r=this.points,o=(r.length-1)*t,s=Math.floor(o),a=o-s,l=r[0===s?s:s-1],c=r[s],h=r[s>r.length-2?r.length-1:s+1],u=r[s>r.length-3?r.length-1:s+2];return i.set(g(a,l.x,c.x,h.x,u.x),g(a,l.y,c.y,h.y,u.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push(i.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){const i=this.points[e];t.points.push(i.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push((new n.Vector2).fromArray(i))}return this}}class E extends o.H{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new s.LineCurve(e,t))}getPoint(t,e){const i=t*this.getLength(),r=this.getCurveLengths();let n=0;for(;n<r.length;){if(r[n]>=i){const t=r[n]-i,o=this.curves[n],s=o.getLength(),a=0===s?0:1-t/s;return o.getPointAt(a,e)}n++}return null}getLength(){const t=this.getCurveLengths();return t[t.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 t=[];let e=0;for(let i=0,r=this.curves.length;i<r;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let i;for(let r=0,n=this.curves;r<n.length;r++){const o=n[r],s=o.isEllipseCurve?2*t:o.isLineCurve||o.isLineCurve3?1:o.isSplineCurve?t*o.points.length:t,a=o.getPoints(s);for(let t=0;t<a.length;t++){const r=a[t];i&&i.equals(r)||(e.push(r),i=r)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){const i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,i=this.curves.length;e<i;e++){const i=this.curves[e];t.curves.push(i.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){const i=t.curves[e];this.curves.push((new r[i.type]).fromJSON(i))}return this}}class M extends E{constructor(t){super(),this.type="Path",this.currentPoint=new n.Vector2,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const i=new s.LineCurve(this.currentPoint.clone(),new n.Vector2(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,i,r){const o=new w(this.currentPoint.clone(),new n.Vector2(t,e),new n.Vector2(i,r));return this.curves.push(o),this.currentPoint.set(i,r),this}bezierCurveTo(t,e,i,r,o,s){const a=new _(this.currentPoint.clone(),new n.Vector2(t,e),new n.Vector2(i,r),new n.Vector2(o,s));return this.curves.push(a),this.currentPoint.set(o,s),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),i=new T(e);return this.curves.push(i),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,i,r,n,o){const s=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(t+s,e+a,i,r,n,o),this}absarc(t,e,i,r,n,o){return this.absellipse(t,e,i,i,r,n,o),this}ellipse(t,e,i,r,n,o,s,a){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(t+l,e+c,i,r,n,o,s,a),this}absellipse(t,e,i,r,n,o,s,l){const c=new a(t,e,i,r,n,o,s,l);if(this.curves.length>0){const t=c.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(c);const h=c.getPoint(1);return this.currentPoint.copy(h),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}},7793:(t,e,i)=>{i.r(e),i.d(e,{LineCurve:()=>o});var r=i(5448),n=i(2848);class o extends n.H{constructor(t=new r.Vector2,e=new r.Vector2){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new r.Vector2){const i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new r.Vector2){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}},8817:(t,e,i)=>{i.r(e),i.d(e,{PlaneGeometry:()=>o});var r=i(3148),n=i(9365);class o extends r.BufferGeometry{constructor(t=1,e=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:r};const o=t/2,s=e/2,a=Math.floor(i),l=Math.floor(r),c=a+1,h=l+1,u=t/a,p=e/l,d=[],m=[],f=[],g=[];for(let t=0;t<h;t++){const e=t*p-s;for(let i=0;i<c;i++){const r=i*u-o;m.push(r,-e,0),f.push(0,0,1),g.push(i/a),g.push(1-t/l)}}for(let t=0;t<l;t++)for(let e=0;e<a;e++){const i=e+c*t,r=e+c*(t+1),n=e+1+c*(t+1),o=e+1+c*t;d.push(i,r,o),d.push(r,n,o)}this.setIndex(d),this.setAttribute("position",new n.Float32BufferAttribute(m,3)),this.setAttribute("normal",new n.Float32BufferAttribute(f,3)),this.setAttribute("uv",new n.Float32BufferAttribute(g,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new o(t.width,t.height,t.widthSegments,t.heightSegments)}}},5814:(t,e,i)=>{i.r(e),i.d(e,{SphereGeometry:()=>s});var r=i(3148),n=i(9365),o=i(6815);class s extends r.BufferGeometry{constructor(t=1,e=32,i=16,r=0,s=2*Math.PI,a=0,l=Math.PI){super(),this.type="SphereGeometry",this.parameters={radiu
2s:t,widthSegments:e,heightSegments:i,phiStart:r,phiLength:s,thetaStart:a,thetaLength:l},e=Math.max(3,Math.floor(e)),i=Math.max(2,Math.floor(i));const c=Math.min(a+l,Math.PI);let h=0;const u=[],p=new o.Vector3,d=new o.Vector3,m=[],f=[],g=[],y=[];for(let n=0;n<=i;n++){const o=[],m=n/i;let v=0;0===n&&0===a?v=.5/e:n===i&&c===Math.PI&&(v=-.5/e);for(let i=0;i<=e;i++){const n=i/e;p.x=-t*Math.cos(r+n*s)*Math.sin(a+m*l),p.y=t*Math.cos(a+m*l),p.z=t*Math.sin(r+n*s)*Math.sin(a+m*l),f.push(p.x,p.y,p.z),d.copy(p).normalize(),g.push(d.x,d.y,d.z),y.push(n+v,1-m),o.push(h++)}u.push(o)}for(let t=0;t<i;t++)for(let r=0;r<e;r++){const e=u[t][r+1],n=u[t][r],o=u[t+1][r],s=u[t+1][r+1];(0!==t||a>0)&&m.push(e,n,s),(t!==i-1||c<Math.PI)&&m.push(n,o,s)}this.setIndex(m),this.setAttribute("position",new n.Float32BufferAttribute(f,3)),this.setAttribute("normal",new n.Float32BufferAttribute(g,3)),this.setAttribute("uv",new n.Float32BufferAttribute(y,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new s(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}},3441:(t,e,i)=>{i.r(e),i.d(e,{WireframeGeometry:()=>s});var r=i(3148),n=i(9365),o=i(6815);class s extends r.BufferGeometry{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},null!==t){const e=[],i=new Set,r=new o.Vector3,s=new o.Vector3;if(null!==t.index){const n=t.attributes.position,o=t.index;let l=t.groups;0===l.length&&(l=[{start:0,count:o.count,materialIndex:0}]);for(let t=0,c=l.length;t<c;++t){const c=l[t],h=c.start;for(let t=h,l=h+c.count;t<l;t+=3)for(let l=0;l<3;l++){const c=o.getX(t+l),h=o.getX(t+(l+1)%3);r.fromBufferAttribute(n,c),s.fromBufferAttribute(n,h),!0===a(r,s,i)&&(e.push(r.x,r.y,r.z),e.push(s.x,s.y,s.z))}}}else{const n=t.attributes.position;for(let t=0,o=n.count/3;t<o;t++)for(let o=0;o<3;o++){const l=3*t+o,c=3*t+(o+1)%3;r.fromBufferAttribute(n,l),s.fromBufferAttribute(n,c),!0===a(r,s,i)&&(e.push(r.x,r.y,r.z),e.push(s.x,s.y,s.z))}}this.setAttribute("position",new n.Float32BufferAttribute(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}function a(t,e,i){const r=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,n=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return!0!==i.has(r)&&!0!==i.has(n)&&(i.add(r),i.add(n),!0)}},9191:(t,e,i)=>{i.r(e),i.d(e,{AmbientLight:()=>n});var r=i(2063);class n extends r._{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}}},4307:(t,e,i)=>{i.r(e),i.d(e,{DirectionalLight:()=>g});var r=i(2063),n=i(8333),o=i(5448),s=i(6815),a=i(6577),l=i(6084);const c=new n.Matrix4,h=new s.Vector3,u=new s.Vector3;class p{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new o.Vector2(512,512),this.map=null,this.mapPass=null,this.matrix=new n.Matrix4,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new l.Frustum,this._frameExtents=new o.Vector2(1,1),this._viewportCount=1,this._viewports=[new a.Vector4(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,i=this.matrix;h.setFromMatrixPosition(t.matrixWorld),e.position.copy(h),u.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(u),e.updateMatrixWorld(),c.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(c),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(c)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}var d=i(9896);
2class m extends p{constructor(){super(new d.OrthographicCamera(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}var f=i(2481);class g extends r._{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(f.Object3D.DEFAULT_UP),this.updateMatrix(),this.target=new f.Object3D,this.shadow=new m}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}},2063:(t,e,i)=>{i.d(e,{_:()=>o});var r=i(2481),n=i(5971);class o extends r.Object3D{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new n.Color(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}},8497:(t,e,i)=>{i.r(e),i.d(e,{CubeTextureLoader:()=>s});var r=i(2676),n=i(862),o=i(5421);class s extends o.a{constructor(t){super(t)}load(t,e,i,o){const s=new n.CubeTexture,a=new r.ImageLoader(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);let l=0;function c(i){a.load(t[i],function(t){s.images[i]=t,l++,6===l&&(s.needsUpdate=!0,e&&e(s))},void 0,o)}for(let e=0;e<t.length;++e)c(e);return s}}},2676:(t,e,i)=>{i.r(e),i.d(e,{ImageLoader:()=>s});const r={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};var n=i(5421),o=i(1968);class s extends n.a{constructor(t){super(t)}load(t,e,i,n){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const s=this,a=r.get(t);if(void 0!==a)return s.manager.itemStart(t),setTimeout(function(){e&&e(a),s.manager.itemEnd(t)},0),a;const l=(0,o.c)("img");function c(){u(),r.add(t,this),e&&e(this),s.manager.itemEnd(t)}function h(e){u(),n&&n(e),s.manager.itemError(t),s.manager.itemEnd(t)}function u(){l.removeEventListener("load",c,!1),l.removeEventListener("error",h,!1)}return l.addEventListener("load",c,!1),l.addEventListener("error",h,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(l.crossOrigin=this.crossOrigin),s.manager.itemStart(t),l.src=t,l}}},5421:(t,e,i)=>{i.d(e,{a:()=>n});const r=new class{constructor(t,e,i){const r=this;let n,o=!1,s=0,a=0;const l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(t){a++,!1===o&&void 0!==r.onStart&&r.onStart(t,s,a),o=!0},this.itemEnd=function(t){s++,void 0!==r.onProgress&&r.onProgress(t,s,a),s===a&&(o=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)},this.resolveURL=function(t){return n?n(t):t},this.setURLModifier=function(t){return n=t,this},this.addHandler=function(t,e){return l.push(t,e),this},this.removeHandler=function(t){const e=l.indexOf(t);return-1!==e&&l.splice(e,2),this},this.getHandler=function(t){for(let e=0,i=l.length;e<i;e+=2){const i=l[e],r=l[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return r}return null}}};class n{constructor(t){this.manager=void 0!==t?t:r,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const i=this;return new Promise(function(r,n){i.load(t,r,e,n)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}},642:(t,e,i)=>{i.r(e),i.d(e,{TextureLoader:()=>s});var r=i(2676),n=i(394),o=i(5421);class s extends o.a{constructor(t){super(t)}load(t,e,i,o){const s=new n.Texture,a=new r.ImageLoader(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(t,function(t){s.image=t,s.needsUpdate=!0,void 0!==e&&e(s)},i,o),s}}},6307:(t,e,i)=>{i.r(e),i.d(e,{LineBasicMaterial:()=>o});var r=i(7951),n=i(5971);class o extends r.F{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new n.Color(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}},2578:(t,e,i)=>{i.r(e),i.d(e,{LineDashedMaterial:()=>n});var r=i(6307);
2class n extends r.LineBasicMaterial{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}},7951:(t,e,i)=>{i.d(e,{F:()=>a});var r=i(2356),n=i(6271),o=i(3334);let s=0;class a extends r.EventDispatcher{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:s++}),this.uuid=o.generateUUID(),this.name="",this.type="Material",this.blending=n.NormalBlending,this.side=n.FrontSide,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=n.SrcAlphaFactor,this.blendDst=n.OneMinusSrcAlphaFactor,this.blendEquation=n.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=n.LessEqualDepth,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=n.AlwaysStencilFunc,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=n.KeepStencilOp,this.stencilZFail=n.KeepStencilOp,this.stencilZPass=n.KeepStencilOp,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const i=t[e];if(void 0===i){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const r=this[e];void 0!==r?r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[e]=i:console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`)}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(t){const e=[];for(const i in t){const r=t[i];delete r.metadata,e.push(r)}return e}
vendor: 23,287 bytes, line 2
2if(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(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).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(t).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(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!==n.NormalBlending&&(i.blending=this.blending),this.side!==n.FrontSide&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!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,void 0!==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),void 0!==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.forceSinglePass&&(i.forceSinglePass=this.forceSinglePass),!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),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),e){const e=r(t.textures),n=r(t.images);e.length>0&&(i.textures=e),n.length>0&&(i.images=n)}return i}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(null!==e){const t=e.length;i=new Array(t);for(let r=0;r!==t;++r)i[r]=e[r].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}},977:(t,e,i)=>{i.r(e),i.d(e,{MeshBasicMaterial:()=>s});var r=i(7951),n=i(6271),o=i(5971);class s extends r.F{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new o.Color(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=n.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}},4127:(t,e,i)=>{i.r(e),i.d(e,{MeshDepthMaterial:()=>o});var r=i(7951),n=i(6271);class o extends r.F{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=n.BasicDepthPacking,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}},2149:(t,e,i)=>{i.r(e),i.d(e,{MeshPhongMaterial:()=>a});var r=i(6271),n=i(7951),o=i(5448),s=i(5971);class a extends n.F{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new s.Color(16777215),this.specular=new s.Color(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new s.Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=r.TangentSpaceNormalMap,this.normalScale=new o.Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=r.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}},8282:(t,e,i)=>{i.r(e),i.d(e,{MeshStandardMaterial:()=>a});var r=i(6271),n=i(7951),o=i(5448),s=i(5971);class a extends n.F{constructor(t){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new s.Color(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 s.Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=r.TangentSpaceNormalMap,this.normalScale=new o.Vector2(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.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}},3905:(t,e,i)=>{i.r(e),i.d(e,{PointsMaterial:()=>o});var r=i(7951),n=i(5971);class o extends r.F{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new n.Color(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}},4085:(t,e,i)=>{i.r(e),i.d(e,{RawShaderMaterial:()=>n});var r=i(1498);class n extends r.ShaderMaterial{constructor(t){super(t),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}},1498:(t,e,i)=>{i.r(e),i.d(e,{ShaderMaterial:()=>o});var r=i(7951),n=i(5143);class o extends r.F{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="\nvoid main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",this.fragmentShader="\nvoid main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}\n",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=(0,n.cloneUniforms)(t.uniforms),this.uniformsGroups=(0,n.cloneUniformsGroups)(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const i in this.uniforms){const r=this.uniforms[i].value;r&&r.isTexture?e.uniforms[i]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[i]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[i]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[i]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[i]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?e.uniforms[i]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[i]={type:"m4",value:r.toArray()}:e.uniforms[i]={value:r}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const i={};for(const t in this.extensions)!0===this.extensions[t]&&(i[t]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}}},433:(t,e,i)=>{i.r(e),i.d(e,{Box2:()=>o});var r=i(5448);const n=new r.Vector2;class o{constructor(t=new r.Vector2(1/0,1/0),e=new r.Vector2(-1/0,-1/0)){this.isBox2=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=n.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.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(t){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,n).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}},2754:(t,e,i)=>{i.r(e),i.d(e,{Box3:()=>n});var r=i(6815);class n{constructor(t=new r.Vector3(1/0,1/0,1/0),e=new r.Vector3(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e+=3)this.expandByPoint(s.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,i=t.count;e<i;e++)this.expandByPoint(s.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=s.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.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(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){if(t.updateWorldMatrix(!1,!1),void 0!==t.boundingBox)null===t.boundingBox&&t.computeBoundingBox(),a.copy(t.boundingBox),a.applyMatrix4(t.matrixWorld),this.union(a);else{const i=t.geometry;if(void 0!==i)if(e&&void 0!==i.attributes&&void 0!==i.attributes.position){const e=i.attributes.position;for(let i=0,r=e.count;i<r;i++)s.fromBufferAttribute(e,i).applyMatrix4(t.matrixWorld),this.expandByPoint(s)}else null===i.boundingBox&&i.computeBoundingBox(),a.copy(i.boundingBox),a.applyMatrix4(t.matrixWorld),this.union(a)}const i=t.children;for(let t=0,r=i.length;t<r;t++)this.expandByObject(i[t],e);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,s),s.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(m),f.subVectors(this.max,m),l.subVectors(t.a,m),c.subVectors(t.b,m),h.subVectors(t.c,m),u.subVectors(c,l),p.subVectors(h,c),d.subVectors(l,h);let e=[0,-u.z,u.y,0,-p.z,p.y,0,-d.z,d.y,u.z,0,-u.x,p.z,0,-p.x,d.z,0,-d.x,-u.y,u.x,0,-p.y,p.x,0,-d.y,d.x,0];return!!v(e,l,c,h,f)&&(e=[1,0,0,0,1,0,0,0,1],!!v(e,l,c,h,f)&&(g.crossVectors(u,p),e=[g.x,g.y,g.z],v(e,l,c,h,f)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,s).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(s).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(o[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),o[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),o[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),o[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),o[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),o[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),o[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),o[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(o)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}
2const o=[new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3],s=new r.Vector3,a=new n,l=new r.Vector3,c=new r.Vector3,h=new r.Vector3,u=new r.Vector3,p=new r.Vector3,d=new r.Vector3,m=new r.Vector3,f=new r.Vector3,g=new r.Vector3,y=new r.Vector3;function v(t,e,i,r,n){for(let o=0,s=t.length-3;o<=s;o+=3){y.fromArray(t,o);const s=n.x*Math.abs(y.x)+n.y*Math.abs(y.y)+n.z*Math.abs(y.z),a=e.dot(y),l=i.dot(y),c=r.dot(y);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>s)return!1}return!0}},5971:(t,e,i)=>{i.r(e),i.d(e,{Color:()=>h});var r=i(3334),n=i(9677),o=i(6271);const s={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},a={h:0,s:0,l:0},l={h:0,s:0,l:0};function c(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}class h{constructor(t,e,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,void 0===e&&void 0===i?this.set(t):this.setRGB(t,e,i)}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=o.SRGBColorSpace){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,n.ColorManagement.toWorkingColorSpace(this,e),this}setRGB(t,e,i,r=n.ColorManagement.workingColorSpace){return this.r=t,this.g=e,this.b=i,n.ColorManagement.toWorkingColorSpace(this,r),this}setHSL(t,e,i,o=n.ColorManagement.workingColorSpace){if(t=(0,r.euclideanModulo)(t,1),e=(0,r.clamp)(e,0,1),i=(0,r.clamp)(i,0,1),0===e)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+e):i+e-i*e,n=2*i-r;this.r=c(n,r,t+1/3),this.g=c(n,r,t),this.b=c(n,r,t-1/3)}return n.ColorManagement.toWorkingColorSpace(this,o),this}setStyle(t,e=o.SRGBColorSpace){function i(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let n;const o=r[1],s=r[2];switch(o){case"rgb":case"rgba":if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(n[4]),this.setRGB(Math.min(255,parseInt(n[1],10))/255,Math.min(255,parseInt(n[2],10))/255,Math.min(255,parseInt(n[3],10))/255,e);if(n=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(n[4]),this.setRGB(Math.min(100,parseInt(n[1],10))/100,Math.min(100,parseInt(n[2],10))/100,Math.min(100,parseInt(n[3],10))/100,e);break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(n[4]),this.setHSL(parseFloat(n[1])/360,parseFloat(n[2])/100,parseFloat(n[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const i=r[1],n=i.length;if(3===n)return this.setRGB(parseInt(i.charAt(0),16)/15,parseInt(i.charAt(1),16)/15,parseInt(i.charAt(2),16)/15,e);if(6===n)return this.setHex(parseInt(i,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=o.SRGBColorSpace){const i=s[t.toLowerCase()];return void 0!==i?this.setHex(i,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=(0,n.SRGBToLinear)(t.r),this.g=(0,n.SRGBToLinear)(t.g),this.b=(0,n.SRGBToLinear)(t.b),this}copyLinearToSRGB(t){return this.r=(0,n.LinearToSRGB)(t.r),this.g=(0,n.LinearToSRGB)(t.g),this.b=(0,n.LinearToSRGB)(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=o.SRGBColorSpace){return n.ColorManagement.fromWorkingColorSpace(u.copy(this),t),65536
2*Math.round((0,r.clamp)(255*u.r,0,255))+256*Math.round((0,r.clamp)(255*u.g,0,255))+Math.round((0,r.clamp)(255*u.b,0,255))}getHexString(t=o.SRGBColorSpace){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=n.ColorManagement.workingColorSpace){n.ColorManagement.fromWorkingColorSpace(u.copy(this),e);const i=u.r,r=u.g,o=u.b,s=Math.max(i,r,o),a=Math.min(i,r,o);let l,c;const h=(a+s)/2;if(a===s)l=0,c=0;else{const t=s-a;switch(c=h<=.5?t/(s+a):t/(2-s-a),s){case i:l=(r-o)/t+(r<o?6:0);break;case r:l=(o-i)/t+2;break;case o:l=(i-r)/t+4}l/=6}return t.h=l,t.s=c,t.l=h,t}getRGB(t,e=n.ColorManagement.workingColorSpace){return n.ColorManagement.fromWorkingColorSpace(u.copy(this),e),t.r=u.r,t.g=u.g,t.b=u.b,t}getStyle(t=o.SRGBColorSpace){n.ColorManagement.fromWorkingColorSpace(u.copy(this),t);const e=u.r,i=u.g,r=u.b;return t!==o.SRGBColorSpace?`color(${t} ${e.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*i)},${Math.round(255*r)})`}offsetHSL(t,e,i){return this.getHSL(a),a.h+=t,a.s+=e,a.l+=i,this.setHSL(a.h,a.s,a.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(a),t.getHSL(l);const i=(0,r.lerp)(a.h,l.h,e),n=(0,r.lerp)(a.s,l.s,e),o=(0,r.lerp)(a.l,l.l,e);return this.setHSL(i,n,o),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,i=this.g,r=this.b,n=t.elements;return this.r=n[0]*e+n[3]*i+n[6]*r,this.g=n[1]*e+n[4]*i+n[7]*r,this.b=n[2]*e+n[5]*i+n[8]*r,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const u=new h;h.NAMES=s},9677:(t,e,i)=>{i.r(e),i.d(e,{ColorManagement:()=>u,LinearToSRGB:()=>s,SRGBToLinear:()=>o});var r=i(6271),n=i(8955);function o(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}
2function s(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const a=(new n.Matrix3).fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),l=(new n.Matrix3).fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]),c={[r.LinearSRGBColorSpace]:t=>t,[r.SRGBColorSpace]:t=>t.convertSRGBToLinear(),[r.DisplayP3ColorSpace]:function(t){return t.convertSRGBToLinear().applyMatrix3(l)}},h={[r.LinearSRGBColorSpace]:t=>t,[r.SRGBColorSpace]:t=>t.convertLinearToSRGB(),[r.DisplayP3ColorSpace]:function(t){return t.applyMatrix3(a).convertLinearToSRGB()}},u={enabled:!0,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!t},get workingColorSpace(){return r.LinearSRGBColorSpace},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,e,i){if(!1===this.enabled||e===i||!e||!i)return t;const r=c[e],n=h[i];if(void 0===r||void 0===n)throw new Error(`Unsupported color space conversion, "${e}" to "${i}".`);return n(r(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}}},6084:(t,e,i)=>{i.r(e),i.d(e,{Frustum:()=>l});var r=i(6815),n=i(5381),o=i(3850);const s=new n.Sphere,a=new r.Vector3;class l{constructor(t=new o.Plane,e=new o.Plane,i=new o.Plane,r=new o.Plane,n=new o.Plane,s=new o.Plane){this.planes=[t,e,i,r,n,s]}set(t,e,i,r,n,o){const s=this.planes;return s[0].copy(t),s[1].copy(e),s[2].copy(i),s[3].copy(r),s[4].copy(n),s[5].copy(o),this}copy(t){const e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t){const e=this.planes,i=t.elements,r=i[0],n=i[1],o=i[2],s=i[3],a=i[4],l=i[5],c=i[6],h=i[7],u=i[8],p=i[9],d=i[10],m=i[11],f=i[12],g=i[13],y=i[14],v=i[15];return e[0].setComponents(s-r,h-a,m-u,v-f).normalize(),e[1].setComponents(s+r,h+a,m+u,v+f).normalize(),e[2].setComponents(s+n,h+l,m+p,v+g).normalize(),e[3].setComponents(s-n,h-l,m-p,v-g).normalize(),e[4].setComponents(s-o,h-c,m-d,v-y).normalize(),e[5].setComponents(s+o,h+c,m+d,v+y).normalize(),this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),s.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),s.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(s)}intersectsSprite(t){return s.center.set(0,0,0),s.radius=.7071067811865476,s.applyMatrix4(t.matrixWorld),this.intersectsSphere(s)}intersectsSphere(t){const e=this.planes,i=t.center,r=-t.radius;for(let t=0;t<6;t++)if(e[t].distanceToPoint(i)<r)return!1;return!0}intersectsBox(t){const e=this.planes;for(let i=0;i<6;i++){const r=e[i];if(a.x=r.normal.x>0?t.max.x:t.min.x,a.y=r.normal.y>0?t.max.y:t.min.y,a.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(a)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}},4116:(t,e,i)=>{i.d(e,{_:()=>r});class r{constructor(t,e,i,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new e.constructor(i),this.sampleValues=e,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(t){const e=this.parameterPositions;let i=this._cachedIndex,r=e[i],n=e[i-1];t:{e:{let o;i:{r:if(!(t<r)){for(let o=i+2;;){if(void 0===r){if(t<n)break r;return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===o)break;if(n=r,r=e[++i],t<r)break e}o=e.length;break i}if(t>=n)break t;{const s=e[1];t<s&&(i=2,n=s);for(let o=i-2;;){if(void 0===n)return this._cachedIndex=0,this.copySampleValue_(0);if(i===o)break;if(r=n,n=e[--i-1],t>=n)break e}o=i,i=0}}for(;i<o;){const r=i+o>>>1;t<e[r]?o=r:i=r+1}if(r=e[i],n=e[i-1],void 0===n)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===r)return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,n,r)}return this.interpolate_(i,n,t,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,i=this.sampleValues,r=this.valueSize,n=t*r;for(let t=0;t!==r;++t)e[t]=i[n+t];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}},414:(t,e,i)=>{i.r(e),i.d(e,{Line3:()=>a});var r=i(6815),n=i(3334);const o=new r.Vector3,s=new r.Vector3;class a{constructor(t=new r.Vector3,e=new r.Vector3){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){o.subVectors(t,this.start),s.subVectors(this.end,this.start);const i=s.dot(s);let r=s.dot(o)/i;return e&&(r=n.clamp(r,0,1)),r}closestPointToPoint(t,e,i){const r=this.closestPointToPointParameter(t,e);return this.delta(i).multiplyScalar(r).add(this.start)}
vendor: 4,706 bytes, line 2
2applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}},3334:(t,e,i)=>{i.r(e),i.d(e,{DEG2RAD:()=>o,MathUtils:()=>P,RAD2DEG:()=>s,ceilPowerOfTwo:()=>T,clamp:()=>l,damp:()=>d,degToRad:()=>x,denormalize:()=>A,euclideanModulo:()=>c,floorPowerOfTwo:()=>E,generateUUID:()=>a,inverseLerp:()=>u,isPowerOfTwo:()=>S,lerp:()=>p,mapLinear:()=>h,normalize:()=>C,pingpong:()=>m,radToDeg:()=>w,randFloat:()=>v,randFloatSpread:()=>_,randInt:()=>y,seededRandom:()=>b,setQuaternionFromProperEuler:()=>M,smootherstep:()=>g,smoothstep:()=>f});const r=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let n=1234567;const o=Math.PI/180,s=180/Math.PI;function a(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(r[255&t]+r[t>>8&255]+r[t>>16&255]+r[t>>24&255]+"-"+r[255&e]+r[e>>8&255]+"-"+r[e>>16&15|64]+r[e>>24&255]+"-"+r[63&i|128]+r[i>>8&255]+"-"+r[i>>16&255]+r[i>>24&255]+r[255&n]+r[n>>8&255]+r[n>>16&255]+r[n>>24&255]).toLowerCase()}function l(t,e,i){return Math.max(e,Math.min(i,t))}function c(t,e){return(t%e+e)%e}function h(t,e,i,r,n){return r+(t-e)*(n-r)/(i-e)}function u(t,e,i){return t!==e?(i-t)/(e-t):0}function p(t,e,i){return(1-i)*t+i*e}function d(t,e,i,r){return p(t,e,1-Math.exp(-i*r))}function m(t,e=1){return e-Math.abs(c(t,2*e)-e)}function f(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}function g(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*t*(t*(6*t-15)+10)}function y(t,e){return t+Math.floor(Math.random()*(e-t+1))}function v(t,e){return t+Math.random()*(e-t)}function _(t){return t*(.5-Math.random())}function b(t){void 0!==t&&(n=t);let e=n+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}function x(t){return t*o}function w(t){return t*s}function S(t){return!(t&t-1)&&0!==t}function T(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function E(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function M(t,e,i,r,n){const o=Math.cos,s=Math.sin,a=o(i/2),l=s(i/2),c=o((e+r)/2),h=s((e+r)/2),u=o((e-r)/2),p=s((e-r)/2),d=o((r-e)/2),m=s((r-e)/2);switch(n){case"XYX":t.set(a*h,l*u,l*p,a*c);break;case"YZY":t.set(l*p,a*h,l*u,a*c);break;case"ZXZ":t.set(l*u,l*p,a*h,a*c);break;case"XZX":t.set(a*h,l*m,l*d,a*c);break;case"YXY":t.set(l*d,a*h,l*m,a*c);break;case"ZYZ":t.set(l*m,l*d,a*h,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+n)}}function A(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function C(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const P={DEG2RAD:o,RAD2DEG:s,generateUUID:a,clamp:l,euclideanModulo:c,mapLinear:h,inverseLerp:u,lerp:p,damp:d,pingpong:m,smoothstep:f,smootherstep:g,randInt:y,randFloat:v,randFloatSpread:_,seededRandom:b,degToRad:x,radToDeg:w,isPowerOfTwo:S,ceilPowerOfTwo:T,floorPowerOfTwo:E,setQuaternionFromProperEuler:M,normalize:C,denormalize:A}}
vendor: 4,421 bytes, line 2
2,8955:(t,e,i)=>{i.r(e),i.d(e,{Matrix3:()=>r});class r{constructor(){r.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(t,e,i,r,n,o,s,a,l){const c=this.elements;return c[0]=t,c[1]=r,c[2]=s,c[3]=e,c[4]=n,c[5]=a,c[6]=i,c[7]=o,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,r=e.elements,n=this.elements,o=i[0],s=i[3],a=i[6],l=i[1],c=i[4],h=i[7],u=i[2],p=i[5],d=i[8],m=r[0],f=r[3],g=r[6],y=r[1],v=r[4],_=r[7],b=r[2],x=r[5],w=r[8];return n[0]=o*m+s*y+a*b,n[3]=o*f+s*v+a*x,n[6]=o*g+s*_+a*w,n[1]=l*m+c*y+h*b,n[4]=l*f+c*v+h*x,n[7]=l*g+c*_+h*w,n[2]=u*m+p*y+d*b,n[5]=u*f+p*v+d*x,n[8]=u*g+p*_+d*w,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],r=t[2],n=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8];return e*o*c-e*s*l-i*n*c+i*s*a+r*n*l-r*o*a}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],n=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],h=c*o-s*l,u=s*a-c*n,p=l*n-o*a,d=e*h+i*u+r*p;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);const m=1/d;return t[0]=h*m,t[1]=(r*l-c*i)*m,t[2]=(s*i-r*o)*m,t[3]=u*m,t[4]=(c*e-r*a)*m,t[5]=(r*n-s*e)*m,t[6]=p*m,t[7]=(i*a-l*e)*m,t[8]=(o*e-i*n)*m,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,r,n,o,s){const a=Math.cos(n),l=Math.sin(n);return this.set(i*a,i*l,-i*(a*o+l*s)+o+t,-r*l,r*a,-r*(-l*o+a*s)+s+e,0,0,1),this}scale(t,e){return this.premultiply(n.makeScale(t,e)),this}rotate(t){return this.premultiply(n.makeRotation(-t)),this}translate(t,e){return this.premultiply(n.makeTranslation(t,e)),this}makeTranslation(t,e){return this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<9;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}const n=new r},8333:(t,e,i)=>{i.r(e),i.d(e,{Matrix4:()=>n});var r=i(6815);class n{constructor(){n.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(t,e,i,r,n,o,s,a,l,c,h,u,p,d,m,f){const g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=r,g[1]=n,g[5]=o,g[9]=s,g[13]=a,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=p,g[7]=d,g[11]=m,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 n).fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,r=1/o.setFromMatrixColumn(t,0).length(),n=1/o.setFromMatrixColumn(t,1).length(),s=1/o.setFromMatrixColumn(t,2).length();return e[0]=i[0]*r,e[1]=i[1]*r,e[2]=i[2]*r,e[3]=0,e[4]=i[4]*n,e[5]=i[5]*n,e[6]=i[6]*n,e[7]=0,e[8]=i[8]*s,e[9]=i[9]*s,e[10
vendor: 14,711 bytes, line 2
2]=i[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,r=t.y,n=t.z,o=Math.cos(i),s=Math.sin(i),a=Math.cos(r),l=Math.sin(r),c=Math.cos(n),h=Math.sin(n);if("XYZ"===t.order){const t=o*c,i=o*h,r=s*c,n=s*h;e[0]=a*c,e[4]=-a*h,e[8]=l,e[1]=i+r*l,e[5]=t-n*l,e[9]=-s*a,e[2]=n-t*l,e[6]=r+i*l,e[10]=o*a}else if("YXZ"===t.order){const t=a*c,i=a*h,r=l*c,n=l*h;e[0]=t+n*s,e[4]=r*s-i,e[8]=o*l,e[1]=o*h,e[5]=o*c,e[9]=-s,e[2]=i*s-r,e[6]=n+t*s,e[10]=o*a}else if("ZXY"===t.order){const t=a*c,i=a*h,r=l*c,n=l*h;e[0]=t-n*s,e[4]=-o*h,e[8]=r+i*s,e[1]=i+r*s,e[5]=o*c,e[9]=n-t*s,e[2]=-o*l,e[6]=s,e[10]=o*a}else if("ZYX"===t.order){const t=o*c,i=o*h,r=s*c,n=s*h;e[0]=a*c,e[4]=r*l-i,e[8]=t*l+n,e[1]=a*h,e[5]=n*l+t,e[9]=i*l-r,e[2]=-l,e[6]=s*a,e[10]=o*a}else if("YZX"===t.order){const t=o*a,i=o*l,r=s*a,n=s*l;e[0]=a*c,e[4]=n-t*h,e[8]=r*h+i,e[1]=h,e[5]=o*c,e[9]=-s*c,e[2]=-l*c,e[6]=i*h+r,e[10]=t-n*h}else if("XZY"===t.order){const t=o*a,i=o*l,r=s*a,n=s*l;e[0]=a*c,e[4]=-h,e[8]=l*c,e[1]=t*h+n,e[5]=o*c,e[9]=i*h-r,e[2]=r*h-i,e[6]=s*c,e[10]=n*h+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(a,t,l)}lookAt(t,e,i){const r=this.elements;return u.subVectors(t,e),0===u.lengthSq()&&(u.z=1),u.normalize(),c.crossVectors(i,u),0===c.lengthSq()&&(1===Math.abs(i.z)?u.x+=1e-4:u.z+=1e-4,u.normalize(),c.crossVectors(i,u)),c.normalize(),h.crossVectors(u,c),r[0]=c.x,r[4]=h.x,r[8]=u.x,r[1]=c.y,r[5]=h.y,r[9]=u.y,r[2]=c.z,r[6]=h.z,r[10]=u.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,r=e.elements,n=this.elements,o=i[0],s=i[4],a=i[8],l=i[12],c=i[1],h=i[5],u=i[9],p=i[13],d=i[2],m=i[6],f=i[10],g=i[14],y=i[3],v=i[7],_=i[11],b=i[15],x=r[0],w=r[4],S=r[8],T=r[12],E=r[1],M=r[5],A=r[9],C=r[13],P=r[2],L=r[6],R=r[10],I=r[14],O=r[3],D=r[7],k=r[11],N=r[15];return n[0]=o*x+s*E+a*P+l*O,n[4]=o*w+s*M+a*L+l*D,n[8]=o*S+s*A+a*R+l*k,n[12]=o*T+s*C+a*I+l*N,n[1]=c*x+h*E+u*P+p*O,n[5]=c*w+h*M+u*L+p*D,n[9]=c*S+h*A+u*R+p*k,n[13]=c*T+h*C+u*I+p*N,n[2]=d*x+m*E+f*P+g*O,n[6]=d*w+m*M+f*L+g*D,n[10]=d*S+m*A+f*R+g*k,n[14]=d*T+m*C+f*I+g*N,n[3]=y*x+v*E+_*P+b*O,n[7]=y*w+v*M+_*L+b*D,n[11]=y*S+v*A+_*R+b*k,n[15]=y*T+v*C+_*I+b*N,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[4],r=t[8],n=t[12],o=t[1],s=t[5],a=t[9],l=t[13],c=t[2],h=t[6],u=t[10],p=t[14];return t[3]*(+n*a*h-r*l*h-n*s*u+i*l*u+r*s*p-i*a*p)+t[7]*(+e*a*p-e*l*u+n*o*u-r*o*p+r*l*c-n*a*c)+t[11]*(+e*l*h-e*s*p-n*o*h+i*o*p+n*s*c-i*l*c)+t[15]*(-r*s*c-e*a*h+e*s*u+r*o*h-i*o*u+i*a*c)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],n=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],h=t[9],u=t[10],p=t[11],d=t[12],m=t[13],f=t[14],g=t[15],y=h*f*l-m*u*l+m*a*p-s*f*p-h*a*g+s*u*g,v=d*u*l-c*f*l-d*a*p+o*f*p+c*a*g-o*u*g,_=c*m*l-d*h*l+d*s*p-o*m*p-c*s*g+o*h*g,b=d*h*a-c*m*a-d*s*u+o*m*u+c*s*f-o*h*f,x=e*y+i*v+r*_+n*b;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/x;return t[0]=y*w,t[1]=(m*u*n-h*f*n-m*r*p+i*f*p+h*r*g-i*u*g)*w,t[2]=(s*f*n-m*a*n+m*r*l-i*f*l-s*r*g+i*a*g)*w,t[3]=(h*a*n-s*u*n-h*r*l+i*u*l+s*r*p-i*a*p)*w,t[4]=v*w,t[5]=(c*f*n-d*u*n+d*r*p-e*f*p-c*r*g+e*u*g)*w,t[6]=(d*a*n-o*f*n-d*r*l+e*f*l+o*r*g-e*a*g)*w,t[7]=(o*u*n-c*a*n+c*r*l-e*u*l-o*r*p+e*a*p)*w,t[8]=_*w,t[9]=(d*h*n-c*m*n-d*i*p+e*m*p+c*i*g-e*h*g)*w,t[10]=(o*m*n-d*s*n+d*i*l-e*m*l-o*i*g+e*s*g)*w,t[11]=(c*s*n-o*h*n-c*i*l+e*h*l+o*i*p-e*s*p)*w,t[12]=b*w,t[13]=(c*m*r-d*h*r+d*i*u-e*m*u-c*i*f+e*h*f)*w,t[14]=(d*s*r-o*m*r-d*i*a+e*m*a+o*i*f-e*s*f)*w,t[15]=(o*h*r-c*s*r+c*i*a-e*h*a-o*i*u+e*s*u)*w,this}scale(t){const e=this.elements,i=t.x,r=t.y,n=t.z;return e[0]*=i,e[4]*=r,e[8]*=n,e[1]*=i,e[5]*=r,e[9]*=n,e[2]*=i,e[6]*=r,e[10]*=n,e[3]*=i,e[7]*=r,e[11]*=n,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,r))}makeTranslation(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),r=Math.sin(e),n=1-i,o=t.x,s=t.y,a=t.z,l=n*o,c=n*s;return this.set(l*o+i,l*s-r*a,l*a+r*s,0,l*s+r*a,c*s+i,c*a-r*o,0,l*a-r*s,c*a+r*o,n*a*a+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,r,n,o){return this.set(1,i,n,0,t,1,o,0,e,r,1,0,0,0,0,1),this}compose(t,e,i){const r=this.elements,n=e._x,o=e._y,s=e._z,a=e._w,l=n+n,c=o+o,h=s+s,u=n*l,p=n*c,d=n*h,m=o*c,f=o*h,g=s*h,y=a*l,v=a*c,_=a*h,b=i.x,x=i.y,w=i.z;return r[0]=(1-(m+g))*b,r[1]=(p+_)*b,r[2]=(d-v)*b,r[3]=0,r[4]=(p-_)*x,r[5]=(1-(u+g))*x,r[6]=(f+y)*x,r[7]=0,r[8]=(d+v)*w,r[9]=(f-y)*w,r[10]=(1-(u+m))*w,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,i){const r=this.elements;let n=o.set(r[0],r[1],r[2]).length();const a=o.set(r[4],r[5],r[6]).length(),l=o.set(r[8],r[9],r[10]).length();this.determinant()<0&&(n=-n),t.x=r[12],t.y=r[13],t.z=r[14],s.copy(this);const c=1/n,h=1/a,u=1/l;return s.elements[0]*=c,s.elements[1]*=c,s.elements[2]*=c,s.elements[4]*=h,s.elements[5]*=h,s.elements[6]*=h,s.elements[8]*=u,s.elements[9]*=u,s.elements[10]*=u,e.setFromRotationMatrix(s),i.x=n,i.y=a,i.z=l,this}makePerspective(t,e,i,r,n,o){const s=this.elements,a=2*n/(e-t),l=2*n/(i-r),c=(e+t)/(e-t),h=(i+r)/(i-r),u=-(o+n)/(o-n),p=-2*o*n/(o-n);return s[0]=a,s[4]=0,s[8]=c,s[12]=0,s[1]=0,s[5]=l,s[9]=h,s[13]=0,s[2]=0,s[6]=0,s[10]=u,s[14]=p,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(t,e,i,r,n,o){const s=this.elements,a=1/(e-t),l=1/(i-r),c=1/(o-n),h=(e+t)*a,u=(i+r)*l,p=(o+n)*c;return s[0]=2*a,s[4]=0,s[8]=0,s[12]=-h,s[1]=0,s[5]=2*l,s[9]=0,s[13]=-u,s[2]=0,s[6]=0,s[10]=-2*c,s[14]=-p,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<16;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}const o=new r.Vector3,s=new n,a=new r.Vector3(0,0,0),l=new r.Vector3(1,1,1),c=new r.Vector3,h=new r.Vector3,u=new r.Vector3},3850:(t,e,i)=>{i.r(e),i.d(e,{Plane:()=>l});var r=i(8955),n=i(6815);const o=new n.Vector3,s=new n.Vector3,a=new r.Matrix3;class l{constructor(t=new n.Vector3(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,r){return this.normal.set(t,e,i),this.constant=r,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){const r=o.subVectors(i,e).cross(s.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const i=t.delta(o),r=this.normal.dot(i);if(0===r)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const n=-(t.start.dot(this.normal)+this.constant)/r;return n<0||n>1?null:e.copy(t.start).addScaledVector(i,n)}intersectsLine(t){const e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const i=e||a.getNormalMatrix(t),r=this.coplanarPoint(o).applyMatrix4(t),n=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(n),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}},9747:(t,e,i)=>{i.r(e),i.d(e,{Quaternion:()=>n});var r=i(3334);class n{constructor(t=0,e=0,i=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=r}static slerpFlat(t,e,i,r,n,o,s){let a=i[r+0],l=i[r+1],c=i[r+2],h=i[r+3];const u=n[o+0],p=n[o+1],d=n[o+2],m=n[o+3];if(0===s)return t[e+0]=a,t[e+1]=l,t[e+2]=c,void(t[e+3]=h);if(1===s)return t[e+0]=u,t[e+1]=p,t[e+2]=d,void(t[e+3]=m);if(h!==m||a!==u||l!==p||c!==d){let t=1-s;const e=a*u+l*p+c*d+h*m,i=e>=0?1:-1,r=1-e*e;if(r>Number.EPSILON){const n=Math.sqrt(r),o=Math.atan2(n,e*i);t=Math.sin(t*o)/n,s=Math.sin(s*o)/n}const n=s*i;if(a=a*t+u*n,l=l*t+p*n,c=c*t+d*n,h=h*t+m*n,t===1-s){const t=1/Math.sqrt(a*a+l*l+c*c+h*h);a*=t,l*=t,c*=t,h*=t}}t[e]=a,t[e+1]=l,t[e+2]=c,t[e+3]=h}static multiplyQuaternionsFlat(t,e,i,r,n,o){const s=i[r],a=i[r+1],l=i[r+2],c=i[r+3],h=n[o],u=n[o+1],p=n[o+2],d=n[o+3];return t[e]=s*d+c*h+a*p-l*u,t[e+1]=a*d+c*u+l*h-s*p,t[e+2]=l*d+c*p+s*u-a*h,t[e+3]=c*d-s*h-a*u-l*p,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,r){return this._x=t,this._y=e,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){const i=t._x,r=t._y,n=t._z,o=t._order,s=Math.cos,a=Math.sin,l=s(i/2),c=s(r/2),h=s(n/2),u=a(i/2),p=a(r/2),d=a(n/2);switch(o){case"XYZ":this._x=u*c*h+l*p*d,this._y=l*p*h-u*c*d,this._z=l*c*d+u*p*h,this._w=l*c*h-u*p*d;break;case"YXZ":this._x=u*c*h+l*p*d,this._y=l*p*h-u*c*d,this._z=l*c*d-u*p*h,this._w=l*c*h+u*p*d;break;case"ZXY":this._x=u*c*h-l*p*d,this._y=l*p*h+u*c*d,this._z=l*c*d+u*p*h,this._w=l*c*h-u*p*d;break;case"ZYX":this._x=u*c*h-l*p*d,this._y=l*p*h+u*c*d,this._z=l*c*d-u*p*h,this._w=l*c*h+u*p*d;break;case"YZX":this._x=u*c*h+l*p*d,this._y=l*p*h+u*c*d,this._z=l*c*d-u*p*h,this._w=l*c*h-u*p*d;break;case"XZY":this._x=u*c*h-l*p*d,this._y=l*p*h-u*c*d,this._z=l*c*d+u*p*h,this._w=l*c*h+u*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,r=Math.sin(i);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],r=e[4],n=e[8],o=e[1],s=e[5],a=e[9],l=e[2],c=e[6],h=e[10],u=i+s+h;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(c-a)*t,this._y=(n-l)*t,this._z=(o-r)*t}else if(i>s&&i>h){const t=2*Math.sqrt(1+i-s-h);this._w=(c-a)/t,this._x=.25*t,this._y=(r+o)/t,this._z=(n+l)/t}else if(s>h){const t=2*Math.sqrt(1+s-i-h);this._w=(n-l)/t,this._x=(r+o)/t,this._y=.25*t,this._z=(a+c)/t}else{const t=2*Math.sqrt(1+h-i-s);this._w=(o-r)/t,this._x=(n+l)/t,this._y=(a+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return i<Number.EPSILON?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(r.clamp(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(0===i)return this;const r=Math.min(1,e/i);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,r=t._y,n=t._z,o=t._w,s=e._x,a=e._y,l=e._z,c=e._w;return this._x=i*c+o*s+r*l-n*a,this._y=r*c+o*a+n*s-i*l,this._z=n*c+o*l+i*a-r*s,this._w=o*c-i*s-r*a-n*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const i=this._x,r=this._y,n=this._z,o=this._w;let s=o*t._w+i*t._x+r*t._y+n*t._z;if(s<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,s=-s):this.copy(t),s>=1)return this._w=o,this._x=i,this._y=r,this._z=n,this;const a=1-s*s;if(a<=Number.EPSILON){const t=1-e;return this._w=t*o+e*this._w,this._x=t*i+e*this._x,this._y=t*r+e*this._y,this._z=t*n+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(a),c=Math.atan2(l,s),h=Math.sin((1-e)*c)/l,u=Math.sin(e*c)/l;return this._w=o*h+this._w*u,this._x=i*h+this._x*u,this._y=r*h+this._y*u,this._z=n*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=Math.random(),e=Math.sqrt(1-t),i=Math.sqrt(t),r=2*Math.PI*Math.random(),n=2*Math.PI*Math.random();return this.set(e*Math.cos(r),i*Math.sin(n),i*Math.cos(n),e*Math.sin(r))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}toJSON(){return this.toArray()}
vendor: 9,393 bytes, line 2
2_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}},2309:(t,e,i)=>{i.r(e),i.d(e,{Ray:()=>u});var r=i(6815);const n=new r.Vector3,o=new r.Vector3,s=new r.Vector3,a=new r.Vector3,l=new r.Vector3,c=new r.Vector3,h=new r.Vector3;class u{constructor(t=new r.Vector3,e=new r.Vector3(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,n)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=n.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(n.copy(this.origin).addScaledVector(this.direction,e),n.distanceToSquared(t))}distanceSqToSegment(t,e,i,r){o.copy(t).add(e).multiplyScalar(.5),s.copy(e).sub(t).normalize(),a.copy(this.origin).sub(o);const n=.5*t.distanceTo(e),l=-this.direction.dot(s),c=a.dot(this.direction),h=-a.dot(s),u=a.lengthSq(),p=Math.abs(1-l*l);let d,m,f,g;if(p>0)if(d=l*h-c,m=l*c-h,g=n*p,d>=0)if(m>=-g)if(m<=g){const t=1/p;d*=t,m*=t,f=d*(d+l*m+2*c)+m*(l*d+m+2*h)+u}else m=n,d=Math.max(0,-(l*m+c)),f=-d*d+m*(m+2*h)+u;else m=-n,d=Math.max(0,-(l*m+c)),f=-d*d+m*(m+2*h)+u;else m<=-g?(d=Math.max(0,-(-l*n+c)),m=d>0?-n:Math.min(Math.max(-n,-h),n),f=-d*d+m*(m+2*h)+u):m<=g?(d=0,m=Math.min(Math.max(-n,-h),n),f=m*(m+2*h)+u):(d=Math.max(0,-(l*n+c)),m=d>0?n:Math.min(Math.max(-n,-h),n),f=-d*d+m*(m+2*h)+u);else m=l>0?-n:n,d=Math.max(0,-(l*m+c)),f=-d*d+m*(m+2*h)+u;return i&&i.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(o).addScaledVector(s,m),f}intersectSphere(t,e){n.subVectors(t.center,this.origin);const i=n.dot(this.direction),r=n.dot(n)-i*i,o=t.radius*t.radius;if(r>o)return null;const s=Math.sqrt(o-r),a=i-s,l=i+s;return l<0?null:a<0?this.at(l,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,r,n,o,s,a;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(i=(t.min.x-u.x)*l,r=(t.max.x-u.x)*l):(i=(t.max.x-u.x)*l,r=(t.min.x-u.x)*l),c>=0?(n=(t.min.y-u.y)*c,o=(t.max.y-u.y)*c):(n=(t.max.y-u.y)*c,o=(t.min.y-u.y)*c),i>o||n>r?null:((n>i||isNaN(i))&&(i=n),(o<r||isNaN(r))&&(r=o),h>=0?(s=(t.min.z-u.z)*h,a=(t.max.z-u.z)*h):(s=(t.max.z-u.z)*h,a=(t.min.z-u.z)*h),i>a||s>r?null:((s>i||i!=i)&&(i=s),(a<r||r!=r)&&(r=a),r<0?null:this.at(i>=0?i:r,e)))}intersectsBox(t){return null!==this.intersectBox(t,n)}intersectTriangle(t,e,i,r,n){l.subVectors(e,t),c.subVectors(i,t),h.crossVectors(l,c);let o,s=this.direction.dot(h);if(s>0){if(r)return null;o=1}else{if(!(s<0))return null;o=-1,s=-s}a.subVectors(this.origin,t);const u=o*this.direction.dot(c.crossVectors(a,c));if(u<0)return null;const p=o*this.direction.dot(l.cross(a));if(p<0)return null;if(u+p>s)return null;const d=-o*a.dot(h);return d<0?null:this.at(d/s,n)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}},5381:(t,e,i)=>{i.r(e),i.d(e,{Sphere:()=>l});var r=i(2754),n=i(6815);const o=new r.Box3,s=new n.Vector3,a=new n.Vector3;class l{constructor(t=new n.Vector3,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;void 0!==e?i.copy(e):o.setFromPoints(t).getCenter(i);let r=0;for(let e=0,n=t.length;e<n;e++)r=Math.max(r,i.distanceToSquared(t[e]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const i=this.center.distanceToSquared(t);return e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;s.subVectors(t,this.center);const e=s.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),i=.5*(t-this.radius);this.center.addScaledVector(s,i/t),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(a.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(s.copy(t.center).add(a)),this.expandByPoint(s.copy(t.center).sub(a))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}},5448:(t,e,i)=>{i.r(e),i.d(e,{Vector2:()=>n});var r=i(3334);class n{constructor(t=0,e=0){n.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6],this.y=r[1]*e+r[4]*i+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,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(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(r.clamp(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}
vendor: 7,015 bytes, line 2
2rotateAround(t,e){const i=Math.cos(e),r=Math.sin(e),n=this.x-t.x,o=this.y-t.y;return this.x=n*i-o*r+t.x,this.y=n*r+o*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}},6815:(t,e,i)=>{i.r(e),i.d(e,{Vector3:()=>o});var r=i(3334),n=i(9747);class o{constructor(t=0,e=0,i=0){o.prototype.isVector3=!0,this.x=t,this.y=e,this.z=i}set(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(a.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(a.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,r=this.z,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6]*r,this.y=n[1]*e+n[4]*i+n[7]*r,this.z=n[2]*e+n[5]*i+n[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,r=this.z,n=t.elements,o=1/(n[3]*e+n[7]*i+n[11]*r+n[15]);return this.x=(n[0]*e+n[4]*i+n[8]*r+n[12])*o,this.y=(n[1]*e+n[5]*i+n[9]*r+n[13])*o,this.z=(n[2]*e+n[6]*i+n[10]*r+n[14])*o,this}applyQuaternion(t){const e=this.x,i=this.y,r=this.z,n=t.x,o=t.y,s=t.z,a=t.w,l=a*e+o*r-s*i,c=a*i+s*e-n*r,h=a*r+n*i-o*e,u=-n*e-o*i-s*r;return this.x=l*a+u*-n+c*-s-h*-o,this.y=c*a+u*-o+h*-n-l*-s,this.z=h*a+u*-s+l*-o-c*-n,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,r=this.z,n=t.elements;return this.x=n[0]*e+n[4]*i+n[8]*r,this.y=n[1]*e+n[5]*i+n[9]*r,this.z=n[2]*e+n[6]*i+n[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,r=t.y,n=t.z,o=e.x,s=e.y,a=e.z;return this.x=r*a-n*s,this.y=n*o-i*a,this.z=i*s-r*o,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return s.copy(this).projectOnVector(t),this.sub(s)}reflect(t){return this.sub(s.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(r.clamp(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return e*e+i*i+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const r=Math.sin(e)*t;return this.x=r*Math.sin(i),this.y=Math.cos(e)*t,this.z=r*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=2*(Math.random()-.5),e=Math.random()*Math.PI*2,i=Math.sqrt(1-t**2);return this.x=i*Math.cos(e),this.y=i*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const s=new o,a=new n.Quaternion},6577:(t,e,i)=>{i.r(e),i.d(e,{Vector4:()=>r});
vendor: 5,474 bytes, line 2
2class r{constructor(t=0,e=0,i=0,n=1){r.prototype.isVector4=!0,this.x=t,this.y=e,this.z=i,this.w=n}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){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: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,r=this.z,n=this.w,o=t.elements;return this.x=o[0]*e+o[4]*i+o[8]*r+o[12]*n,this.y=o[1]*e+o[5]*i+o[9]*r+o[13]*n,this.z=o[2]*e+o[6]*i+o[10]*r+o[14]*n,this.w=o[3]*e+o[7]*i+o[11]*r+o[15]*n,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,r,n;const o=.01,s=.1,a=t.elements,l=a[0],c=a[4],h=a[8],u=a[1],p=a[5],d=a[9],m=a[2],f=a[6],g=a[10];if(Math.abs(c-u)<o&&Math.abs(h-m)<o&&Math.abs(d-f)<o){if(Math.abs(c+u)<s&&Math.abs(h+m)<s&&Math.abs(d+f)<s&&Math.abs(l+p+g-3)<s)return this.set(1,0,0,0),this;e=Math.PI;const t=(l+1)/2,a=(p+1)/2,y=(g+1)/2,v=(c+u)/4,_=(h+m)/4,b=(d+f)/4;return t>a&&t>y?t<o?(i=0,r=.707106781,n=.707106781):(i=Math.sqrt(t),r=v/i,n=_/i):a>y?a<o?(i=.707106781,r=0,n=.707106781):(r=Math.sqrt(a),i=v/r,n=b/r):y<o?(i=.707106781,r=.707106781,n=0):(n=Math.sqrt(y),i=_/n,r=b/n),this.set(i,r,n,e),this}let y=Math.sqrt((f-d)*(f-d)+(h-m)*(h-m)+(u-c)*(u-c));return Math.abs(y)<.001&&(y=1),this.x=(f-d)/y,this.y=(h-m)/y,this.z=(u-c)/y,this.w=Math.acos((l+p+g-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,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(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),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}}},9698:(t,e,i)=>{i.d(e,{l:()=>n});var r=i(4116);
2class n extends r._{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t,e,i,r){const n=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,l=a-s,c=(i-e)/(r-e),h=1-c;for(let t=0;t!==s;++t)n[t]=o[l+t]*h+o[a+t]*c;return n}}},4246:(t,e,i)=>{i.r(e),i.d(e,{Line:()=>g});var r=i(5381),n=i(2309),o=i(8333),s=i(2481),a=i(6815),l=i(6307),c=i(3148),h=i(9365);const u=new a.Vector3,p=new a.Vector3,d=new o.Matrix4,m=new n.Ray,f=new r.Sphere;class g extends s.Object3D{constructor(t=new c.BufferGeometry,e=new l.LineBasicMaterial){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,i=[0];for(let t=1,r=e.count;t<r;t++)u.fromBufferAttribute(e,t-1),p.fromBufferAttribute(e,t),i[t]=i[t-1],i[t]+=u.distanceTo(p);t.setAttribute("lineDistance",new h.Float32BufferAttribute(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){const i=this.geometry,r=this.matrixWorld,n=t.params.Line.threshold,o=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),f.copy(i.boundingSphere),f.applyMatrix4(r),f.radius+=n,!1===t.ray.intersectsSphere(f))return;d.copy(r).invert(),m.copy(t.ray).applyMatrix4(d);const s=n/((this.scale.x+this.scale.y+this.scale.z)/3),l=s*s,c=new a.Vector3,h=new a.Vector3,u=new a.Vector3,p=new a.Vector3,g=this.isLineSegments?2:1,y=i.index,v=i.attributes.position;if(null!==y)for(let i=Math.max(0,o.start),r=Math.min(y.count,o.start+o.count)-1;i<r;i+=g){const r=y.getX(i),n=y.getX(i+1);if(c.fromBufferAttribute(v,r),h.fromBufferAttribute(v,n),m.distanceSqToSegment(c,h,p,u)>l)continue;p.applyMatrix4(this.matrixWorld);const o=t.ray.origin.distanceTo(p);o<t.near||o>t.far||e.push({distance:o,point:u.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}else for(let i=Math.max(0,o.start),r=Math.min(v.count,o.start+o.count)-1;i<r;i+=g){if(c.fromBufferAttribute(v,i),h.fromBufferAttribute(v,i+1),m.distanceSqToSegment(c,h,p,u)>l)continue;p.applyMatrix4(this.matrixWorld);const r=t.ray.origin.distanceTo(p);r<t.near||r>t.far||e.push({distance:r,point:u.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){const e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}},4760:(t,e,i)=>{i.r(e),i.d(e,{LineSegments:()=>l});var r=i(4246),n=i(6815),o=i(9365);const s=new n.Vector3,a=new n.Vector3;class l extends r.Line{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,i=[];for(let t=0,r=e.count;t<r;t+=2)s.fromBufferAttribute(e,t),a.fromBufferAttribute(e,t+1),i[t]=0===t?0:i[t-1],i[t+1]=i[t]+s.distanceTo(a);t.setAttribute("lineDistance",new o.Float32BufferAttribute(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}},5269:(t,e,i)=>{i.r(e),i.d(e,{Mesh:()=>B});var r=i(6815),n=i(5448),o=i(5381),s=i(2309),a=i(8333),l=i(2481);const c=new r.Vector3,h=new r.Vector3,u=new r.Vector3,p=new r.Vector3,d=new r.Vector3,m=new r.Vector3,f=new r.Vector3,g=new r.Vector3,y=new r.Vector3,v=new r.Vector3;let _=!1;class b{constructor(t=new r.Vector3,e=new r.Vector3,i=new r.Vector3){this.a=t,this.b=e,this.c=i}static getNormal(t,e,i,r){r.subVectors(i,e),c.subVectors(t,e),r.cross(c);const n=r.lengthSq();return n>0?r.multiplyScalar(1/Math.sqrt(n)):r.set(0,0,0)}static getBarycoord(t,e,i,r,n){c.subVectors(r,e),h.subVectors(i,e),u.subVectors(t,e);const o=c.dot(c),s=c.dot(h),a=c.dot(u),l=h.dot(h),p=h.dot(u),d=o*l-s*s;if(0===d)return n.set(-2,-1,-1);const m=1/d,f=(l*a-s*p)*m,g=(o*p-s*a)*m;return n.set(1-f-g,g,f)}static containsPoint(t,e,i,r){return this.getBarycoord(t,e,i,r,p),p.x>=0&&p.y>=0&&p.x+p.y<=1}static getUV(t,e,i,r,n,o,s,a){return!1===_&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),_=!0),this.getInterpolation(t,e,
vendor: 5,580 bytes, line 2
2i,r,n,o,s,a)}static getInterpolation(t,e,i,r,n,o,s,a){return this.getBarycoord(t,e,i,r,p),a.setScalar(0),a.addScaledVector(n,p.x),a.addScaledVector(o,p.y),a.addScaledVector(s,p.z),a}static isFrontFacing(t,e,i,r){return c.subVectors(i,e),h.subVectors(t,e),c.cross(h).dot(r)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,r){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,i,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,r),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return c.subVectors(this.c,this.b),h.subVectors(this.a,this.b),.5*c.cross(h).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return b.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return b.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,i,r,n){return!1===_&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),_=!0),b.getInterpolation(t,this.a,this.b,this.c,e,i,r,n)}getInterpolation(t,e,i,r,n){return b.getInterpolation(t,this.a,this.b,this.c,e,i,r,n)}containsPoint(t){return b.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return b.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,r=this.b,n=this.c;let o,s;d.subVectors(r,i),m.subVectors(n,i),g.subVectors(t,i);const a=d.dot(g),l=m.dot(g);if(a<=0&&l<=0)return e.copy(i);y.subVectors(t,r);const c=d.dot(y),h=m.dot(y);if(c>=0&&h<=c)return e.copy(r);const u=a*h-c*l;if(u<=0&&a>=0&&c<=0)return o=a/(a-c),e.copy(i).addScaledVector(d,o);v.subVectors(t,n);const p=d.dot(v),_=m.dot(v);if(_>=0&&p<=_)return e.copy(n);const b=p*l-a*_;if(b<=0&&l>=0&&_<=0)return s=l/(l-_),e.copy(i).addScaledVector(m,s);const x=c*_-p*h;if(x<=0&&h-c>=0&&p-_>=0)return f.subVectors(n,r),s=(h-c)/(h-c+(p-_)),e.copy(r).addScaledVector(f,s);const w=1/(x+b+u);return o=b*w,s=u*w,e.copy(i).addScaledVector(d,o).addScaledVector(m,s)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}var x=i(6271),w=i(977),S=i(3148);const T=new a.Matrix4,E=new s.Ray,M=new o.Sphere,A=new r.Vector3,C=new r.Vector3,P=new r.Vector3,L=new r.Vector3,R=new r.Vector3,I=new r.Vector3,O=new n.Vector2,D=new n.Vector2,k=new n.Vector2,N=new r.Vector3,F=new r.Vector3,U=new r.Vector3,z=new r.Vector3,j=new r.Vector3;class B extends l.Object3D{constructor(t=new S.BufferGeometry,e=new w.MeshBasicMaterial){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){const e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}getVertexPosition(t,e){const i=this.geometry,r=i.attributes.position,n=i.morphAttributes.position,o=i.morphTargetsRelative;e.fromBufferAttribute(r,t);const s=this.morphTargetInfluences;if(n&&s){I.set(0,0,0);for(let i=0,r=n.length;i<r;i++){const r=s[i],a=n[i];0!==r&&(R.fromBufferAttribute(a,t),o?I.addScaledVector(R,r):I.addScaledVector(R.sub(e),r))}e.add(I)}return e}raycast(t,e){const i=this.geometry,r=this.material,n=this.matrixWorld;if(void 0!==r){if(null===i.boundingSphere&&i.computeBoundingSphere(),M.copy(i.boundingSphere),M.applyMatrix4(n),E.copy(t.ray).recast(t.near),!1===M.containsPoint(E.origin)){if(null===E.intersectSphere(M,A))return;if(E.origin.distanceToSquared(A)>(t.far-t.near)**2)return}T.copy(n).invert(),E.copy(t.ray).applyMatrix4(T),null!==i.boundingBox&&!1===E.intersectsBox(i.boundingBox)||this._computeIntersections(t,e)}}_computeIntersections(t,e){let i;const r=this.geometry,n=this.material,o=r.index,s=r.attributes.position,a=r.attributes.uv,l=r.attributes.uv1,c=r.attributes.normal,h=r.groups,u=r.drawRange;if(null!==o)if(Array.isArray(n))for(let r=0,s=h.length;r<s;r++){const s=h[r],p=n[s.materialIndex];for(let r=Math.max(s.start,u.start),n=Math.min(o.count,Math.min(s.start+s.count,u.start+u.count));r<n;r+=3){const n=o.getX(r),h=o.getX(r+1),u=o.getX(r+2);i=V(this,p,t,E,a,l,c,n,h,u),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=s.materialIndex,e.push(i))}}else for(let r=Math.max(0,u.start),s=Math.min(o.count,u.start+u.count);r<s;r+=3){const s=o.getX(r),h=o.getX(r+1),u=o.getX(r+2);i=V(this,n,t,E,a,l,c,s,h,u),i&&(i.faceIndex=Math.floor(r/3),e.push(i))}else if(void 0!==s)if(Array.isArray(n))for(let r=0,o=h.length;r<o;r++){const o=h[r],p=n[o.materialIndex];for(let r=Math.max(o.start,u.start),n=Math.min(s.count,Math.min(o.start+o.count,u.start+u.count));r<n;r+=3)i=V(this,p,t,E,a,l,c,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=o.materialIndex,e.push(i))}else for(let r=Math.max(0,u.start),o=Math.min(s.count,u.start+u.count);r<o;r+=3)i=V(this,n,t,E,a,l,c,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),e.push(i))}}function V(t,e,i,o,s,a,l,c,h,u){t.getVertexPosition(c,C),t.getVertexPosition(h,P),t.getVertexPosition(u,L);
2const p=function(t,e,i,r,n,o,s,a){let l;if(l=e.side===x.BackSide?r.intersectTriangle(s,o,n,!0,a):r.intersectTriangle(n,o,s,e.side===x.FrontSide,a),null===l)return null;j.copy(a),j.applyMatrix4(t.matrixWorld);const c=i.ray.origin.distanceTo(j);return c<i.near||c>i.far?null:{distance:c,point:j.clone(),object:t}}(t,e,i,o,C,P,L,z);if(p){s&&(O.fromBufferAttribute(s,c),D.fromBufferAttribute(s,h),k.fromBufferAttribute(s,u),p.uv=b.getInterpolation(z,C,P,L,O,D,k,new n.Vector2)),a&&(O.fromBufferAttribute(a,c),D.fromBufferAttribute(a,h),k.fromBufferAttribute(a,u),p.uv1=b.getInterpolation(z,C,P,L,O,D,k,new n.Vector2),p.uv2=p.uv1),l&&(N.fromBufferAttribute(l,c),F.fromBufferAttribute(l,h),U.fromBufferAttribute(l,u),p.normal=b.getInterpolation(z,C,P,L,N,F,U,new r.Vector3),p.normal.dot(o.direction)>0&&p.normal.multiplyScalar(-1));const t={a:c,b:h,c:u,normal:new r.Vector3,materialIndex:0};b.getNormal(C,P,L,t.normal),p.face=t}return p}},4994:(t,e,i)=>{i.r(e),i.d(e,{Points:()=>m});var r=i(5381),n=i(2309),o=i(8333),s=i(2481),a=i(6815),l=i(3905),c=i(3148);const h=new o.Matrix4,u=new n.Ray,p=new r.Sphere,d=new a.Vector3;class m extends s.Object3D{constructor(t=new c.BufferGeometry,e=new l.PointsMaterial){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=t.material,this.geometry=t.geometry,this}raycast(t,e){const i=this.geometry,r=this.matrixWorld,n=t.params.Points.threshold,o=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),p.copy(i.boundingSphere),p.applyMatrix4(r),p.radius+=n,!1===t.ray.intersectsSphere(p))return;h.copy(r).invert(),u.copy(t.ray).applyMatrix4(h);const s=n/((this.scale.x+this.scale.y+this.scale.z)/3),a=s*s,l=i.index,c=i.attributes.position;if(null!==l)for(let i=Math.max(0,o.start),n=Math.min(l.count,o.start+o.count);i<n;i++){const n=l.getX(i);d.fromBufferAttribute(c,n),f(d,n,a,r,t,e,this)}else for(let i=Math.max(0,o.start),n=Math.min(c.count,o.start+o.count);i<n;i++)d.fromBufferAttribute(c,i),f(d,i,a,r,t,e,this)}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){const e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}function f(t,e,i,r,n,o,s){const l=u.distanceSqToPoint(t);if(l<i){const i=new a.Vector3;u.closestPointToPoint(t,i),i.applyMatrix4(r);const c=n.ray.origin.distanceTo(i);if(c<n.near||c>n.far)return;o.push({distance:c,distanceToRay:Math.sqrt(l),point:i,index:e,face:null,object:s})}}},4814:(t,e,i)=>{i.r(e),i.d(e,{WebGL1Renderer:()=>n});var r=i(5700);class n extends r.WebGLRenderer{}n.prototype.isWebGL1Renderer=!0},5117:(t,e,i)=>{i.r(e),i.d(e,{WebGLRenderTarget:()=>c});var r=i(2356),n=i(394),o=i(6271),s=i(6577),a=i(4791),l=i(1968);class c extends r.EventDispatcher{constructor(t=1,e=1,i={}){super(),this.isWebGLRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new s.Vector4(0,0,t,e),this.scissorTest=!1,this.viewport=new s.Vector4(0,0,t,e);const r={width:t,height:e,depth:1};void 0!==i.encoding&&((0,l.O4)("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace
2=i.encoding===o.sRGBEncoding?o.SRGBColorSpace:o.NoColorSpace),this.texture=new n.Texture(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!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:o.LinearFilter,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,this.samples=void 0!==i.samples?i.samples:0}setSize(t,e,i=1){this.width===t&&this.height===e&&this.depth===i||(this.width=t,this.height=e,this.depth=i,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.isRenderTargetTexture=!0;const e=Object.assign({},t.texture.image);return this.texture.source=new a.H(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}},5700:(t,e,i)=>{i.r(e),i.d(e,{WebGLRenderer:()=>pi});var r=i(6271),n=i(6084),o=i(8333),s=i(6815),a=i(6577);function l(){let t=null,e=!1,i=null,r=null;function n(e,o){i(e,o),r=t.requestAnimationFrame(n)}return{start:function(){!0!==e&&null!==i&&(r=t.requestAnimationFrame(n),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(t){i=t},setContext:function(e){t=e}}}function c(t,e){const i=e.isWebGL2,r=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),r.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const i=r.get(e);i&&(t.deleteBuffer(i.buffer),r.delete(e))},update:function(e,n){if(e.isGLBufferAttribute){const t=r.get(e);return void((!t||t.version<e.version)&&r.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version}))}e.isInterleavedBufferAttribute&&(e=e.data);const o=r.get(e);void 0===o?r.set(e,function(e,r){const n=e.array,o=e.usage,s=t.createBuffer();let a;if(t.bindBuffer(r,s),t.bufferData(r,n,o),e.onUploadCallback(),n instanceof Float32Array)a=t.FLOAT;else if(n instanceof Uint16Array)if(e.isFloat16BufferAttribute){if(!i)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");a=t.HALF_FLOAT}else a=t.UNSIGNED_SHORT;else if(n instanceof Int16Array)a=t.SHORT;else if(n instanceof Uint32Array)a=t.UNSIGNED_INT;else if(n instanceof Int32Array)a=t.INT;else if(n instanceof Int8Array)a=t.BYTE;else if(n instanceof Uint8Array)a=t.UNSIGNED_BYTE;else{if(!(n instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+n);a=t.UNSIGNED_BYTE}return{buffer:s,type:a,bytesPerElement:n.BYTES_PER_ELEMENT,version:e.version}}(e,n)):o.version<e.version&&(function(e,r,n){const o=r.array,s=r.updateRange;t.bindBuffer(n,e),-1===s.count?t.bufferSubData(n,0,o):(i?t.bufferSubData(n,s.offset*o.BYTES_PER_ELEMENT,o,s.offset,s.count):t.bufferSubData(n,s.offset*o.BYTES_PER_ELEMENT,o.subarray(s.offset,s.offset+s.count)),s.count=-1),r.onUploadCallback()}(o.buffer,e,n),o.version=e.version)}}}var h=i(3148),u=i(9365);class p extends h.BufferGeometry{constructor(t=1,e=1,i=1,r=1,n=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:r,heightSegments:n,depthSegments:o};const a=this;r=Math.floor(r),n=Math.floor(n),o=Math.floor(o);const l=[],c=[],h=[],p=[];let d=0,m=0;function f(t,e,i,r,n,o,u,f,g,y,v){const _=o/g,b=u/y,x=o/2,w=u/2,S=f/2,T=g+1,E=y+1;let M=0,A=0;const C=new s.Vector3;for(let o=0;o<E;o++){const s=o*b-w;for(let a=0;a<T;a++){const l=a*_-x;C[t]=l*r,C[e]=s*n,C[i]=S,c.push(C.x,C.y,C.z),C[t]=0,C[e]=0,C[i]=f>0?1:-1,h.push(C.x,C.y,C.z),p.push(a/g),p.push(1-o/y),M+=1}}for(let t=0;t<y;t++)for(let e=0;e<g;e++){const i=d+e+T*t,r=d+e+T*(t+1),n=d+(e+1)+T*(t+1),o=d+(e+1)+T*t;l.push(i,r,o),l.push(r,n,o),A+=6}
2a.addGroup(m,A,v),m+=A,d+=M}f("z","y","x",-1,-1,i,e,t,o,n,0),f("z","y","x",1,-1,i,e,-t,o,n,1),f("x","z","y",1,1,t,i,e,r,o,2),f("x","z","y",1,-1,t,i,-e,r,o,3),f("x","y","z",1,-1,t,e,i,r,n,4),f("x","y","z",-1,-1,t,e,-i,r,n,5),this.setIndex(l),this.setAttribute("position",new u.Float32BufferAttribute(c,3)),this.setAttribute("normal",new u.Float32BufferAttribute(h,3)),this.setAttribute("uv",new u.Float32BufferAttribute(p,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new p(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}var d=i(8817),m=i(1498),f=i(5971),g=i(5269),y=i(9984),v=i(5143);const _={r:0,b:0,g:0};function b(t,e,i,n,o,s,a){const l=new f.Color(0);let c,h,u=!0===s?0:1,b=null,x=0,w=null;function S(e,i){e.getRGB(_,(0,v.getUnlitUniformColorSpace)(t)),n.buffers.color.setClear(_.r,_.g,_.b,i,a)}return{getClearColor:function(){return l},setClearColor:function(t,e=1){l.set(t),u=e,S(l,u)},getClearAlpha:function(){return u},setClearAlpha:function(t){u=t,S(l,u)},render:function(s,f){let _=!1,T=!0===f.isScene?f.background:null;switch(T&&T.isTexture&&(T=(f.backgroundBlurriness>0?i:e).get(T)),null===T?S(l,u):T&&T.isColor&&(S(T,1),_=!0),t.xr.getEnvironmentBlendMode()){case"opaque":_=!0;break;case"additive":n.buffers.color.setClear(0,0,0,1,a),_=!0;break;case"alpha-blend":n.buffers.color.setClear(0,0,0,0,a),_=!0}(t.autoClear||_)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),T&&(T.isCubeTexture||T.mapping===r.CubeUVReflectionMapping)?(void 0===h&&(h=new g.Mesh(new p(1,1,1),new m.ShaderMaterial({name:"BackgroundCubeMaterial",uniforms:(0,v.cloneUniforms)(y.ShaderLib.backgroundCube.uniforms),vertexShader:y.ShaderLib.backgroundCube.vertexShader,fragmentShader:y.ShaderLib.backgroundCube.fragmentShader,side:r.BackSide,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(t,e,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),o.update(h)),h.material.uniforms.envMap.value=T,h.material.uniforms.flipEnvMap.value=T.isCubeTexture&&!1===T.isRenderTargetTexture?-1:1,h.material.uniforms.backgroundBlurriness.value=f.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=f.backgroundIntensity,h.material.toneMapped=T.colorSpace!==r.SRGBColorSpace,b===T&&x===T.version&&w===t.toneMapping||(h.material.needsUpdate=!0,b=T,x=T.version,w=t.toneMapping),h.layers.enableAll(),s.unshift(h,h.geometry,h.material,0,0,null)):T&&T.isTexture&&(void 0===c&&(c=new g.Mesh(new d.PlaneGeometry(2,2),new m.ShaderMaterial({name:"BackgroundMaterial",uniforms:(0,v.cloneUniforms)(y.ShaderLib.background.uniforms),vertexShader:y.ShaderLib.background.vertexShader,fragmentShader:y.ShaderLib.background.fragmentShader,side:r.FrontSide,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),o.update(c)),c.material.uniforms.t2D.value=T,c.material.uniforms.backgroundIntensity.value=f.backgroundIntensity,c.material.toneMapped=T.colorSpace!==r.SRGBColorSpace,!0===T.matrixAutoUpdate&&T.updateMatrix(),c.material.uniforms.uvTransform.value.copy(T.matrix),b===T&&x===T.version&&w===t.toneMapping||(c.material.needsUpdate=!0,b=T,x=T.version,w=t.toneMapping),c.layers.enableAll(),s.unshift(c,c.geometry,c.material,0,0,null))}}}function x(t,e,i,r){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),o=r.isWebGL2?null:e.get("OES_vertex_array_object"),s=r.isWebGL2||null!==o,a={},l=d(null);let c=l,h=!1;function u(e){return r.isWebGL2?t.bindVertexArray(e):o.bindVertexArrayOES(e)}function p(e){return r.isWebGL2?t.deleteVertexArray(e):o.deleteVertexArrayOES(e)}function d(t){const e=[],i=[],r=[];for(let t=0;t<n;t++)e[t]=0,i[t]=0,r[t]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:i,attributeDivisors:r,object:t,attributes:{},index:null}}function m(){const t=c.newAttributes;for(let e=0,i=t.length;e<i;e++)t[e]=0}function f(t){g(t,0)}function g(i,n){const o=c.newAttributes,s=c.enabledAttributes,a=c.attributeDivisors;o[i]=1,0===s[i]&&(t.enableVertexAttribArray(i),s[i]=1),a[i]!==n&&((r.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](i,n),a[i]=n)}function y(){const e=c.newAttributes,i=c.enabledAttributes;for(let r=0,n=i.length;r<n;r++)i[r]!==e[r]&&(t.disableVertexAttribArray(r),i[r]=0)}function v(e,i,n,o,s,a){!0!==r.isWebGL2||n!==t.INT&&n!==t.UNSIGNED_INT?t.vertexAttribPointer(e,i,n,o,s,a):t.vertexAttribIPointer(e,i,n,s,a)}function _(){b(),h=!0,c!==l&&(c=l,u(c.object))}function b(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(n,l,p,_,b){let x=!1;if(s){const e=function(e,i,n){const s=!0===n.wireframe;let l=a[e.id];void 0===l&&(l={},a[e.id]=l);let c=l[i.id];void 0===c&&(c={},l[i.id]=c);let h=c[s];return void 0===h&&(h=d(r.isWebGL2?t.createVertexArray():o.createVertexArrayOES()),c[s]=h),h}(_,p,l);
2c!==e&&(c=e,u(c.object)),x=function(t,e,i,r){const n=c.attributes,o=e.attributes;let s=0;const a=i.getAttributes();for(const e in a)if(a[e].location>=0){const i=n[e];let r=o[e];if(void 0===r&&("instanceMatrix"===e&&t.instanceMatrix&&(r=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(r=t.instanceColor)),void 0===i)return!0;if(i.attribute!==r)return!0;if(r&&i.data!==r.data)return!0;s++}return c.attributesNum!==s||c.index!==r}(n,_,p,b),x&&function(t,e,i,r){const n={},o=e.attributes;let s=0;const a=i.getAttributes();for(const e in a)if(a[e].location>=0){let i=o[e];void 0===i&&("instanceMatrix"===e&&t.instanceMatrix&&(i=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(i=t.instanceColor));const r={};r.attribute=i,i&&i.data&&(r.data=i.data),n[e]=r,s++}c.attributes=n,c.attributesNum=s,c.index=r}(n,_,p,b)}else{const t=!0===l.wireframe;c.geometry===_.id&&c.program===p.id&&c.wireframe===t||(c.geometry=_.id,c.program=p.id,c.wireframe=t,x=!0)}null!==b&&i.update(b,t.ELEMENT_ARRAY_BUFFER),(x||h)&&(h=!1,function(n,o,s,a){if(!1===r.isWebGL2&&(n.isInstancedMesh||a.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;m();const l=a.attributes,c=s.getAttributes(),h=o.defaultAttributeValues;for(const e in c){const r=c[e];if(r.location>=0){let o=l[e];if(void 0===o&&("instanceMatrix"===e&&n.instanceMatrix&&(o=n.instanceMatrix),"instanceColor"===e&&n.instanceColor&&(o=n.instanceColor)),void 0!==o){const e=o.normalized,s=o.itemSize,l=i.get(o);if(void 0===l)continue;const c=l.buffer,h=l.type,u=l.bytesPerElement;if(o.isInterleavedBufferAttribute){const i=o.data,l=i.stride,p=o.offset;if(i.isInstancedInterleavedBuffer){for(let t=0;t<r.locationSize;t++)g(r.location+t,i.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=i.meshPerAttribute*i.count)}else for(let t=0;t<r.locationSize;t++)f(r.location+t);t.bindBuffer(t.ARRAY_BUFFER,c);for(let t=0;t<r.locationSize;t++)v(r.location+t,s/r.locationSize,h,e,l*u,(p+s/r.locationSize*t)*u)}else{if(o.isInstancedBufferAttribute){for(let t=0;t<r.locationSize;t++)g(r.location+t,o.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=o.meshPerAttribute*o.count)}else for(let t=0;t<r.locationSize;t++)f(r.location+t);t.bindBuffer(t.ARRAY_BUFFER,c);for(let t=0;t<r.locationSize;t++)v(r.location+t,s/r.locationSize,h,e,s*u,s/r.locationSize*t*u)}}else if(void 0!==h){const i=h[e];if(void 0!==i)switch(i.length){case 2:t.vertexAttrib2fv(r.location,i);break;case 3:t.vertexAttrib3fv(r.location,i);break;case 4:t.vertexAttrib4fv(r.location,i);break;default:t.vertexAttrib1fv(r.location,i)}}}}y()}(n,l,p,_),null!==b&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.get(b).buffer))},reset:_,resetDefaultState:b,dispose:function(){_();for(const t in a){const e=a[t];for(const t in e){const i=e[t];for(const t in i)p(i[t].object),delete i[t];delete e[t]}delete a[t]}},releaseStatesOfGeometry:function(t){if(void 0===a[t.id])return;const e=a[t.id];for(const t in e){const i=e[t];for(const t in i)p(i[t].object),delete i[t];delete e[t]}delete a[t.id]},releaseStatesOfProgram:function(t){for(const e in a){const i=a[e];if(void 0===i[t.id])continue;const r=i[t.id];for(const t in r)p(r[t].object),delete r[t];delete i[t.id]}},initAttributes:m,enableAttribute:f,disableUnusedAttributes:y}}function w(t,e,i,r){const n=r.isWebGL2;let o;this.setMode=function(t){o=t},this.render=function(e,r){t.drawArrays(o,e,r),i.update(r,o,1)},this.renderInstances=function(r,s,a){if(0===a)return;let l,c;if(n)l=t,c="drawArraysInstanced";else if(l=e.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,r,s,a),i.update(s,o,a)}}function S(t,e,i){let r;function n(e){if("highp"===e){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name;let s=void 0!==i.precision?i.precision:"highp";const a=n(s);a!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",a,"instead."),s=a);const l=o||e.has("WEBGL_draw_buffers"),c=!0===i.logarithmicDepthBuffer,h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),p=t.getParameter(t.MAX_TEXTURE_SIZE),d=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),m=t.getParameter(t.MAX_VERTEX_ATTRIBS),f=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),g=t.getParameter(t.MAX_VARYING_VECTORS),y=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),v=u>0,_=o||e.has("OES_texture_float");return{isWebGL2:o,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===e.has("EXT_texture_filter_anisotropic")){const i=e.get("EXT_texture_filter_anisotropic");r=t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:n,precision:s,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:p,maxCubemapSize:d,maxAttributes:m,maxVertexUniforms:f,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:v,floatFragmentTextures:_,floatVertexTextures:v&&_,maxSamples:o?t.getParameter(t.MAX_SAMPLES):0}}var T=i(8955),E=i(3850);function M(t){const e=this;let i=null,r=0,n=!1,o=!1;const s=new E.Plane,a=new T.Matrix3,l={value:null,needsUpdate:!1};function c(t,i,r,n){const o=null!==t?t.length:0;let c=null;if(0!==o){if(c=l.value,!0!==n||null===c){const e=r+4*o,n=i.matrixWorldInverse;a.getNormalMatrix(n),(null===c||c.length<e)&&(c=new Float32Array(e));for(let e=0,i=r;e!==o;++e,i+=4)s.copy(t[e]).applyMatrix4(n,a),s.normal.toArray(c,i),c[i+3]=s.constant}l.value=c,l.needsUpdate=!0}return e.numPlanes=o,e.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e){const i=0!==t.length||e||0!==r||n;return n=e,r=t.length,i},this.beginShadows=function(){o=!0,c(null)},this.endShadows=function(){o=!1}
2,this.setGlobalState=function(t,e){i=c(t,e,0)},this.setState=function(s,a,h){const u=s.clippingPlanes,p=s.clipIntersection,d=s.clipShadows,m=t.get(s);if(!n||null===u||0===u.length||o&&!d)o?c(null):(l.value!==i&&(l.value=i,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0);else{const t=o?0:r,e=4*t;let n=m.clippingState||null;l.value=n,n=c(u,a,e,h);for(let t=0;t!==e;++t)n[t]=i[t];m.clippingState=n,this.numIntersection=p?this.numPlanes:0,this.numPlanes+=t}}}var A=i(5117),C=i(2481),P=i(2479);const L=-90;class R extends C.Object3D{constructor(t,e,i){super(),this.type="CubeCamera",this.renderTarget=i;const r=new P.PerspectiveCamera(L,1,t,e);r.layers=this.layers,r.up.set(0,1,0),r.lookAt(1,0,0),this.add(r);const n=new P.PerspectiveCamera(L,1,t,e);n.layers=this.layers,n.up.set(0,1,0),n.lookAt(-1,0,0),this.add(n);const o=new P.PerspectiveCamera(L,1,t,e);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(0,1,0),this.add(o);const s=new P.PerspectiveCamera(L,1,t,e);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(0,-1,0),this.add(s);const a=new P.PerspectiveCamera(L,1,t,e);a.layers=this.layers,a.up.set(0,1,0),a.lookAt(0,0,1),this.add(a);const l=new P.PerspectiveCamera(L,1,t,e);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,-1),this.add(l)}update(t,e){null===this.parent&&this.updateMatrixWorld();const i=this.renderTarget,[n,o,s,a,l,c]=this.children,h=t.getRenderTarget(),u=t.toneMapping,p=t.xr.enabled;t.toneMapping=r.NoToneMapping,t.xr.enabled=!1;const d=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,n),t.setRenderTarget(i,1),t.render(e,o),t.setRenderTarget(i,2),t.render(e,s),t.setRenderTarget(i,3),t.render(e,a),t.setRenderTarget(i,4),t.render(e,l),i.texture.generateMipmaps=d,t.setRenderTarget(i,5),t.render(e,c),t.setRenderTarget(h),t.toneMapping=u,t.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}var I=i(862),O=i(1968);class D extends A.WebGLRenderTarget{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const i={width:t,height:t,depth:1},n=[i,i,i,i,i,i];void 0!==e.encoding&&((0,O.O4)("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),e.colorSpace=e.encoding===r.sRGBEncoding?r.SRGBColorSpace:r.NoColorSpace),this.texture=new I.CubeTexture(n,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:r.LinearFilter}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const i=new p(5,5,5),n=new m.ShaderMaterial({name:"CubemapFromEquirect",uniforms:(0,v.cloneUniforms)({tEquirect:{value:null}}),vertexShader:"\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",fragmentShader:"\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",side:r.BackSide,blending:r.NoBlending});n.uniforms.tEquirect.value=e;const o=new g.Mesh(i,n),s=e.minFilter;return e.minFilter===r.LinearMipmapLinearFilter&&(e.minFilter=r.LinearFilter),new R(1,10,this).update(t,o),e.minFilter=s,o.geometry.dispose(),o.material.dispose(),this}clear(t,e,i,r){const n=t.getRenderTarget();for(let n=0;n<6;n++)t.setRenderTarget(this,n),t.clear(e,i,r);t.setRenderTarget(n)}}function k(t){let e=new WeakMap;function i(t,e){return e===r.EquirectangularReflectionMapping?t.mapping=r.CubeReflectionMapping:e===r.EquirectangularRefractionMapping&&(t.mapping=r.CubeRefractionMapping),t}function n(t){const i=t.target;i.removeEventListener("dispose",n);const r=e.get(i);void 0!==r&&(e.delete(i),r.dispose())}
2return{get:function(o){if(o&&o.isTexture&&!1===o.isRenderTargetTexture){const s=o.mapping;if(s===r.EquirectangularReflectionMapping||s===r.EquirectangularRefractionMapping){if(e.has(o))return i(e.get(o).texture,o.mapping);{const r=o.image;if(r&&r.height>0){const s=new D(r.height/2);return s.fromEquirectangularTexture(t,o),e.set(o,s),o.addEventListener("dispose",n),i(s.texture,o.mapping)}return null}}}return o},dispose:function(){e=new WeakMap}}}var N=i(9896),F=i(977);const U=[.125,.215,.35,.446,.526,.582],z=new N.OrthographicCamera,j=new f.Color;let B=null;const V=(1+Math.sqrt(5))/2,G=1/V,H=[new s.Vector3(1,1,1),new s.Vector3(-1,1,1),new s.Vector3(1,1,-1),new s.Vector3(-1,1,-1),new s.Vector3(0,V,G),new s.Vector3(0,V,-G),new s.Vector3(G,0,V),new s.Vector3(-G,0,V),new s.Vector3(V,G,0),new s.Vector3(-V,G,0)];class q{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,i=.1,r=100){B=this._renderer.getRenderTarget(),this._setSize(256);const n=this._allocateTargets();return n.depthBuffer=!0,this._sceneToCubeUV(t,i,r,n),e>0&&this._blur(n,0,0,e),this._applyPMREM(n),this._cleanup(n),n}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=K(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Y(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(B),t.scissorTest=!1,X(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===r.CubeReflectionMapping||t.mapping===r.CubeRefractionMapping?this._setSize(0===t.image.length?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),B=this._renderer.getRenderTarget();const i=e||this._allocateTargets();return this._textureToCubeUV(t,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,i={magFilter:r.LinearFilter,minFilter:r.LinearFilter,generateMipmaps:!1,type:r.HalfFloatType,format:r.RGBAFormat,colorSpace:r.LinearSRGBColorSpace,depthBuffer:!1},n=W(t,e,i);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=W(t,e,i);const{_lodMax:n}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(t){const e=[],i=[],r=[];let n=t;const o=t-4+1+U.length;for(let s=0;s<o;s++){const o=Math.pow(2,n);i.push(o);let a=1/o;s>t-4?a=U[s-t+4-1]:0===s&&(a=0),r.push(a);const l=1/(o-2),c=-l,p=1+l,d=[c,c,p,c,p,p,c,c,p,p,c,p],m=6,f=6,g=3,y=2,v=1,_=new Float32Array(g*f*m),b=new Float32Array(y*f*m),x=new Float32Array(v*f*m);for(let t=0;t<m;t++){const e=t%3*2/3-1,i=t>2?0:-1,r=[e,i,0,e+2/3,i,0,e+2/3,i+1,0,e,i,0,e+2/3,i+1,0,e,i+1,0];_.set(r,g*f*t),b.set(d,y*f*t);const n=[t,t,t,t,t,t];x.set(n,v*f*t)}const w=new h.BufferGeometry;w.setAttribute("position",new u.BufferAttribute(_,g)),w.setAttribute("uv",new u.BufferAttribute(b,y)),w.setAttribute("faceIndex",new u.BufferAttribute(x,v)),e.push(w),n>4&&n--}return{lodPlanes:e,sizeLods:i,sigmas:r}}(n)),this._blurMaterial=function(t,e,i){const n=new Float32Array(20),o=new s.Vector3(0,1,0);return new m.ShaderMaterial({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:o}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\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#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}\n\t\t",blending:r.NoBlending,depthTest:!1,depthWrite:!1})}(n,t,e)}return n}_compileMaterial(t){const e=new g.Mesh(this._lodPlanes[0],t);this._renderer.compile(e,z)}_sceneToCubeUV(t,e,i,n){const o=new P.PerspectiveCamera(90,1,e,i),s=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],l=this._renderer,c=l.autoClear,h=l.toneMapping;l.getClearColor(j),l.toneMapping=r.NoToneMapping,l.autoClear=!1;
vendor: 4,223 bytes, line 2
2const u=new F.MeshBasicMaterial({name:"PMREM.Background",side:r.BackSide,depthWrite:!1,depthTest:!1}),d=new g.Mesh(new p,u);let m=!1;const f=t.background;f?f.isColor&&(u.color.copy(f),t.background=null,m=!0):(u.color.copy(j),m=!0);for(let e=0;e<6;e++){const i=e%3;0===i?(o.up.set(0,s[e],0),o.lookAt(a[e],0,0)):1===i?(o.up.set(0,0,s[e]),o.lookAt(0,a[e],0)):(o.up.set(0,s[e],0),o.lookAt(0,0,a[e]));const r=this._cubeSize;X(n,i*r,e>2?r:0,r,r),l.setRenderTarget(n),m&&l.render(d,o),l.render(t,o)}d.geometry.dispose(),d.material.dispose(),l.toneMapping=h,l.autoClear=c,t.background=f}_textureToCubeUV(t,e){const i=this._renderer,n=t.mapping===r.CubeReflectionMapping||t.mapping===r.CubeRefractionMapping;n?(null===this._cubemapMaterial&&(this._cubemapMaterial=K()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Y());const o=n?this._cubemapMaterial:this._equirectMaterial,s=new g.Mesh(this._lodPlanes[0],o);o.uniforms.envMap.value=t;const a=this._cubeSize;X(e,0,0,3*a,2*a),i.setRenderTarget(e),i.render(s,z)}_applyPMREM(t){const e=this._renderer,i=e.autoClear;e.autoClear=!1;for(let e=1;e<this._lodPlanes.length;e++){const i=Math.sqrt(this._sigmas[e]*this._sigmas[e]-this._sigmas[e-1]*this._sigmas[e-1]),r=H[(e-1)%H.length];this._blur(t,e-1,e,i,r)}e.autoClear=i}_blur(t,e,i,r,n){const o=this._pingPongRenderTarget;this._halfBlur(t,o,e,i,r,"latitudinal",n),this._halfBlur(o,t,i,i,r,"longitudinal",n)}_halfBlur(t,e,i,r,n,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 g.Mesh(this._lodPlanes[r],l),h=l.uniforms,u=this._sizeLods[i]-1,p=isFinite(n)?Math.PI/(2*u):2*Math.PI/39,d=n/p,m=isFinite(n)?1+Math.floor(3*d):20;m>20&&console.warn(`sigmaRadians, ${n}, is too large and will clip, as it requested ${m} samples when the maximum is set to 20`);const f=[];let y=0;for(let t=0;t<20;++t){const e=t/d,i=Math.exp(-e*e/2);f.push(i),0===t?y+=i:t<m&&(y+=2*i)}for(let t=0;t<f.length;t++)f[t]=f[t]/y;h.envMap.value=t.texture,h.samples.value=m,h.weights.value=f,h.latitudinal.value="latitudinal"===o,s&&(h.poleAxis.value=s);const{_lodMax:v}=this;h.dTheta.value=p,h.mipInt.value=v-i;const _=this._sizeLods[r];X(e,3*_*(r>v-4?r-v+4:0),4*(this._cubeSize-_),3*_,2*_),a.setRenderTarget(e),a.render(c,z)}}function W(t,e,i){const n=new A.WebGLRenderTarget(t,e,i);return n.texture.mapping=r.CubeUVReflectionMapping,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function X(t,e,i,r,n){t.viewport.set(e,i,r,n),t.scissor.set(e,i,r,n)}function Y(){return new m.ShaderMaterial({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\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\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );
2\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:r.NoBlending,depthTest:!1,depthWrite:!1})}function K(){return new m.ShaderMaterial({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\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\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:r.NoBlending,depthTest:!1,depthWrite:!1})}function Z(t){let e=new WeakMap,i=null;function n(t){const i=t.target;i.removeEventListener("dispose",n);const r=e.get(i);void 0!==r&&(e.delete(i),r.dispose())}return{get:function(o){if(o&&o.isTexture){const s=o.mapping,a=s===r.EquirectangularReflectionMapping||s===r.EquirectangularRefractionMapping,l=s===r.CubeReflectionMapping||s===r.CubeRefractionMapping;if(a||l){if(o.isRenderTargetTexture&&!0===o.needsPMREMUpdate){o.needsPMREMUpdate=!1;let r=e.get(o);return null===i&&(i=new q(t)),r=a?i.fromEquirectangular(o,r):i.fromCubemap(o,r),e.set(o,r),r.texture}if(e.has(o))return e.get(o).texture;{const r=o.image;if(a&&r&&r.height>0||l&&r&&function(t){let e=0;for(let i=0;i<6;i++)void 0!==t[i]&&e++;return 6===e}(r)){null===i&&(i=new q(t));const r=a?i.fromEquirectangular(o):i.fromCubemap(o);return e.set(o,r),o.addEventListener("dispose",n),r.texture}return null}}}return o},dispose:function(){e=new WeakMap,null!==i&&(i.dispose(),i=null)}}}function $(t){const e={};function i(i){if(void 0!==e[i])return e[i];let r;switch(i){case"WEBGL_depth_texture":r=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=t.getExtension(i)}return e[i]=r,r}return{has:function(t){return null!==i(t)},init:function(t){t.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"),i("WEBGL_multisampled_render_to_texture")},get:function(t){const e=i(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function J(t,e,i,r){const n={},o=new WeakMap;function s(t){const a=t.target;null!==a.index&&e.remove(a.index);for(const t in a.attributes)e.remove(a.attributes[t]);a.removeEventListener("dispose",s),delete n[a.id];const l=o.get(a);l&&(e.remove(l),o.delete(a)),r.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,i.memory.geometries--}function a(t){const i=[],r=t.index,n=t.attributes.position;let s=0;if(null!==r){const t=r.array;s=r.version;for(let e=0,r=t.length;e<r;e+=3){const r=t[e+0],n=t[e+1],o=t[e+2];i.push(r,n,n,o,o,r)}}else{const t=n.array;s=n.version;for(let e=0,r=t.length/3-1;e<r;e+=3){const t=e+0,r=e+1,n=e+2;i.push(t,r,r,n,n,t)}}const a=new((0,O.H7)(i)?u.Uint32BufferAttribute:u.Uint16BufferAttribute)(i,1);a.version=s;const l=o.get(t);l&&e.remove(l),o.set(t,a)}return{get:function(t,e){return!0===n[e.id]||(e.addEventListener("dispose",s),n[e.id]=!0,i.memory.geometries++),e},update:function(i){const r=i.attributes;for(const i in r)e.update(r[i],t.ARRAY_BUFFER);const n=i.morphAttributes;for(const i in n){const r=n[i];for(let i=0,n=r.length;i<n;i++)e.update(r[i],t.ARRAY_BUFFER)}},getWireframeAttribute:function(t){const e=o.get(t);if(e){const i=t.index;null!==i&&e.version<i.version&&a(t)}else a(t);return o.get(t)}}}function Q(t,e,i,r){const n=r.isWebGL2;let o,s,a;this.setMode=function(t){o=t},this.setIndex=function(t){s=t.type,a=t.bytesPerElement},this.render=function(e,r){t.drawElements(o,r,s,e*a),i.update(r,o,1)},this.renderInstances=function(r,l,c){if(0===c)return;let h,u;if(n)h=t,u="drawElementsInstanced";else if(h=e.get("ANGLE_instanced_arrays"),u="drawElementsInstancedANGLE",
vendor: 11,265 bytes, line 2
2null===h)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[u](o,l,s,r*a,c),i.update(l,o,c)}}function tt(t){const e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(i,r,n){switch(e.calls++,r){case t.TRIANGLES:e.triangles+=n*(i/3);break;case t.LINES:e.lines+=n*(i/2);break;case t.LINE_STRIP:e.lines+=n*(i-1);break;case t.LINE_LOOP:e.lines+=n*i;break;case t.POINTS:e.points+=n*i;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",r)}}}}var et=i(394);class it extends et.Texture{constructor(t=null,e=1,i=1,n=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:i,depth:n},this.magFilter=r.NearestFilter,this.minFilter=r.NearestFilter,this.wrapR=r.ClampToEdgeWrapping,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}var rt=i(5448);function nt(t,e){return t[0]-e[0]}function ot(t,e){return Math.abs(e[1])-Math.abs(t[1])}function st(t,e,i){const n={},o=new Float32Array(8),s=new WeakMap,l=new a.Vector4,c=[];for(let t=0;t<8;t++)c[t]=[t,0];return{update:function(a,h,u){const p=a.morphTargetInfluences;if(!0===e.isWebGL2){const d=h.morphAttributes.position||h.morphAttributes.normal||h.morphAttributes.color,m=void 0!==d?d.length:0;let f=s.get(h);if(void 0===f||f.count!==m){void 0!==f&&f.texture.dispose();const v=void 0!==h.morphAttributes.position,_=void 0!==h.morphAttributes.normal,b=void 0!==h.morphAttributes.color,x=h.morphAttributes.position||[],w=h.morphAttributes.normal||[],S=h.morphAttributes.color||[];let T=0;!0===v&&(T=1),!0===_&&(T=2),!0===b&&(T=3);let E=h.attributes.position.count*T,M=1;E>e.maxTextureSize&&(M=Math.ceil(E/e.maxTextureSize),E=e.maxTextureSize);const A=new Float32Array(E*M*4*m),C=new it(A,E,M,m);C.type=r.FloatType,C.needsUpdate=!0;const P=4*T;for(let R=0;R<m;R++){const I=x[R],O=w[R],D=S[R],k=E*M*4*R;for(let N=0;N<I.count;N++){const F=N*P;!0===v&&(l.fromBufferAttribute(I,N),A[k+F+0]=l.x,A[k+F+1]=l.y,A[k+F+2]=l.z,A[k+F+3]=0),!0===_&&(l.fromBufferAttribute(O,N),A[k+F+4]=l.x,A[k+F+5]=l.y,A[k+F+6]=l.z,A[k+F+7]=0),!0===b&&(l.fromBufferAttribute(D,N),A[k+F+8]=l.x,A[k+F+9]=l.y,A[k+F+10]=l.z,A[k+F+11]=4===D.itemSize?l.w:1)}}function L(){C.dispose(),s.delete(h),h.removeEventListener("dispose",L)}f={count:m,texture:C,size:new rt.Vector2(E,M)},s.set(h,f),h.addEventListener("dispose",L)}let g=0;for(let U=0;U<p.length;U++)g+=p[U];const y=h.morphTargetsRelative?1:1-g;u.getUniforms().setValue(t,"morphTargetBaseInfluence",y),u.getUniforms().setValue(t,"morphTargetInfluences",p),u.getUniforms().setValue(t,"morphTargetsTexture",f.texture,i),u.getUniforms().setValue(t,"morphTargetsTextureSize",f.size)}else{const z=void 0===p?0:p.length;let j=n[h.id];if(void 0===j||j.length!==z){j=[];for(let q=0;q<z;q++)j[q]=[q,0];n[h.id]=j}for(let W=0;W<z;W++){const X=j[W];X[0]=W,X[1]=p[W]}j.sort(ot);for(let Y=0;Y<8;Y++)Y<z&&j[Y][1]?(c[Y][0]=j[Y][0],c[Y][1]=j[Y][1]):(c[Y][0]=Number.MAX_SAFE_INTEGER,c[Y][1]=0);c.sort(nt);const B=h.morphAttributes.position,V=h.morphAttributes.normal;let G=0;for(let K=0;K<8;K++){const Z=c[K],$=Z[0],J=Z[1];$!==Number.MAX_SAFE_INTEGER&&J?(B&&h.getAttribute("morphTarget"+K)!==B[$]&&h.setAttribute("morphTarget"+K,B[$]),V&&h.getAttribute("morphNormal"+K)!==V[$]&&h.setAttribute("morphNormal"+K,V[$]),o[K]=J,G+=J):(B&&!0===h.hasAttribute("morphTarget"+K)&&h.deleteAttribute("morphTarget"+K),V&&!0===h.hasAttribute("morphNormal"+K)&&h.deleteAttribute("morphNormal"+K),o[K]=0)}const H=h.morphTargetsRelative?1:1-G;u.getUniforms().setValue(t,"morphTargetBaseInfluence",H),u.getUniforms().setValue(t,"morphTargetInfluences",o)}}}}function at(t,e,i,r){let n=new WeakMap;function o(t){const e=t.target;e.removeEventListener("dispose",o),i.remove(e.instanceMatrix),null!==e.instanceColor&&i.remove(e.instanceColor)}return{update:function(s){const a=r.render.frame,l=s.geometry,c=e.get(s,l);return n.get(c)!==a&&(e.update(c),n.set(c,a)),s.isInstancedMesh&&(!1===s.hasEventListener("dispose",o)&&s.addEventListener("dispose",o),i.update(s.instanceMatrix,t.ARRAY_BUFFER),null!==s.instanceColor&&i.update(s.instanceColor,t.ARRAY_BUFFER)),c},dispose:function(){n=new WeakMap}}}var lt=i(1389);class ct extends et.Texture{constructor(t=null,e=1,i=1,n=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:i,depth:n},this.magFilter=r.NearestFilter,this.minFilter=r.NearestFilter,this.wrapR=r.ClampToEdgeWrapping,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const ht=new et.Texture,ut=new it,pt=new ct,dt=new I.CubeTexture,mt=[],ft=[],gt=new Float32Array(16),yt=new Float32Array(9),vt=new Float32Array(4);function _t(t,e,i){const r=t[0];if(r<=0||r>0)return t;const n=e*i;let o=mt[n];if(void 0===o&&(o=new Float32Array(n),mt[n]=o),0!==e){r.toArray(o,0);for(let r=1,n=0;r!==e;++r)n+=i,t[r].toArray(o,n)}return o}function bt(t,e){if(t.length!==e.length)return!1;for(let i=0,r=t.length;i<r;i++)if(t[i]!==e[i])return!1;return!0}function xt(t,e){for(let i=0,r=e.length;i<r;i++)t[i]=e[i]}function wt(t,e){let i=ft[e];void 0===i&&(i=new Int32Array(e),ft[e]=i);for(let r=0;r!==e;++r)i[r]=t.allocateTextureUnit();return i}function St(t,e){const i=this.cache;i[0]!==e&&(t.uniform1f(this.addr,e),i[0]=e)}function Tt(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),i[0]=e.x,i[1]=e.y);else{if(bt(i,e))return;t.uniform2fv(this.addr,e),xt(i,e)}}function Et(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),i[0]=e.x,i[1]=e.y,i[2]=e.z);else if(void 0!==e.r)i[0]===e.r&&i[1]===e.g&&i[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),i[0]=e.r,i[1]=e.g,i[2]=e.b);else{if(bt(i,e))return;t.uniform3fv(this.addr,e),xt(i,e)}}function Mt(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z&&i[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=e.w);else{if(bt(i,e))return;t.uniform4fv(this.addr,e),xt(i,e)}}function At(t,e){const i=this.cache,r=e.elements;if(void 0===r){if(bt(i,e))return;t.uniformMatrix2fv(this.addr,!1,e),xt(i,e)}else{if(bt(i,r))return;vt.set(r),t.uniformMatrix2fv(this.addr,!1,vt),xt(i,r)}}function Ct(t,e){const i=this.cache,r=e.elements;if(void 0===r){if(bt(i,e))return;t.uniformMatrix3fv(this.addr,!1,e),xt(i,e)}else{if(bt(i,r))return;yt.set(r),t.uniformMatrix3fv(this.addr,!1,yt),xt(i,r)}}function Pt(t,e){const i=this.cache,r=e.elements;if(void 0===r){if(bt(i,e))return;t.uniformMatrix4fv(this.addr,!1,e),xt(i,e)}else{if(bt(i,r))return;gt.set(r),t.uniformMatrix4fv(this.addr,!1,gt),xt(i,r)}}function Lt(t,e){const i=this.cache;i[0]!==e&&(t.uniform1i(this.addr,e),i[0]=e)}function Rt(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y||(t.uniform2i(this.addr,e.x,e.y),i[0]=e.x,i[1]=e.y);else{if(bt(i,e))return;t.uniform2iv(this.addr,e),xt(i,e)}}function It(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z||(t.uniform3i(this.addr,e.x,e.y,e.z),i[0]=e.x,i[1]=e.y,i[2]=e.z);else{if(bt(i,e))return;t.uniform3iv(this.addr,e),xt(i,e)}}function Ot(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z&&i[3]===e.w||(t.uniform4i(this.addr,e.x,e.y,e.z,e.w),i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=e.w);else{if(bt(i,e))return;t.uniform4iv(this.addr,e),xt(i,e)}}function Dt(t,e){const i=this.cache;i[0]!==e&&(t.uniform1ui(this.addr,e),i[0]=e)}function kt(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y||(t.uniform2ui(this.addr,e.x,e.y),i[0]=e.x,i[1]=e.y);else{if(bt(i,e))return;t.uniform2uiv(this.addr,e),xt(i,e)}}function Nt(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z||(t.uniform3ui(this.addr,e.x,e.y,e.z),i[0]=e.x,i[1]=e.y,i[2]=e.z);else{if(bt(i,e))return;t.uniform3uiv(this.addr,e),xt(i,e)}}function Ft(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z&&i[3]===e.w||(t.uniform4ui(this.addr,e.x,e.y,e.z,e.w),i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=e.w);else{if(bt(i,e))return;t.uniform4uiv(this.addr,e),xt(i,e)}}function Ut(t,e,i){const r=this.cache,n=i.allocateTextureUnit();r[0]!==n&&(t.uniform1i(this.addr,n),r[0]=n),i.setTexture2D(e||ht,n)}function zt(t,e,i){const r=this.cache,n=i.allocateTextureUnit();r[0]!==n&&(t.uniform1i(this.addr,n),r[0]=n),i.setTexture3D(e||pt,n)}function jt(t,e,i){const r=this.cache,n=i.allocateTextureUnit();r[0]!==n&&(t.uniform1i(this.addr,n),r[0]=n),i.setTextureCube(e||dt,n)}function Bt(t,e,i){const r=this.cache,n=i.allocateTextureUnit();r[0]!==n&&(t.uniform1i(this.addr,n),r[0]=n),i.setTexture2DArray(e||ut,n)}function Vt(t,e){t.uniform1fv(this.addr,e)}function Gt(t,e){const i=_t(e,this.size,2);t.uniform2fv(this.addr,i)}function Ht(t,e){const i=_t(e,this.size,3);t.uniform3fv(this.addr,i)}function qt(t,e){const i=_t(e,this.size,4);t.uniform4fv(this.addr,i)}function Wt(t,e){const i=_t(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,i)}function Xt(t,e){const i=_t(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,i)}function Yt(t,e){const i=_t(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,i)}function Kt(t,e){t.uniform1iv(this.addr,e)}function Zt(t,e){t.uniform2iv(this.addr,e)}function $t(t,e){t.uniform3iv(this.addr,e)}function Jt(t,e){t.uniform4iv(this.addr,e)}function Qt(t,e){t.uniform1uiv(this.addr,e)}function te(t,e){t.uniform2uiv(this.addr,e)}function ee(t,e){t.uniform3uiv(this.addr,e)}function ie(t,e){t.uniform4uiv(this.addr,e)}function re(t,e,i){const r=this.cache,n=e.length,o=wt(i,n);bt(r,o)||(t.uniform1iv(this.addr,o),xt(r,o));for(let t=0;t!==n;++t)i.setTexture2D(e[t]||ht,o[t])}function ne(t,e,i){const r=this.cache,n=e.length,o=wt(i,n);bt(r,o)||(t.uniform1iv(this.addr,o),xt(r,o));for(let t=0;t!==n;++t)i.setTexture3D(e[t]||pt,o[t])}function oe(t,e,i){const r=this.cache,n=e.length,o=wt(i,n);bt(r,o)||(t.uniform1iv(this.addr,o),xt(r,o));for(let t=0;t!==n;++t)i.setTextureCube(e[t]||dt,o[t])}function se(t,e,i){const r=this.cache,n=e.length,o=wt(i,n);bt(r,o)||(t.uniform1iv(this.addr,o),xt(r,o));for(let t=0;t!==n;++t)i.setTexture2DArray(e[t]||ut,o[t])}class ae{constructor(t,e,i){this.id=t,this.addr=i,this.cache=[],this.setValue=function(t){switch(t){case 5126:return St;case 35664:return Tt;case 35665:return Et;case 35666:return Mt;case 35674:return At;case 35675:return Ct;case 35676:return Pt;case 5124:case 35670:return Lt;case 35667:case 35671:return Rt;case 35668:case 35672:return It;case 35669:case 35673:return Ot;case 5125:return Dt;case 36294:return kt;case 36295:return Nt;case 36296:return Ft;case 35678:case 36198:case 36298:case 36306:case 35682:return Ut;case 35679:case 36299:case 36307:return zt;case 35680:case 36300:case 36308:case 36293:return jt;case 36289:case 36303:case 36311:case 36292:return Bt}}(e.type)}}class le{constructor(t,e,i){this.id=t,this.addr=i,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Vt;case 35664:return Gt;case 35665:return Ht;case 35666:return qt;case 35674:return Wt;case 35675:return Xt;case 35676:return Yt;case 5124:case 35670:return Kt;case 35667:case 35671:return Zt;case 35668:case 35672:return $t;case 35669:case 35673:return Jt;case 5125:return Qt;
2case 36294:return te;case 36295:return ee;case 36296:return ie;case 35678:case 36198:case 36298:case 36306:case 35682:return re;case 35679:case 36299:case 36307:return ne;case 35680:case 36300:case 36308:case 36293:return oe;case 36289:case 36303:case 36311:case 36292:return se}}(e.type)}}class ce{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,i){const r=this.seq;for(let n=0,o=r.length;n!==o;++n){const o=r[n];o.setValue(t,e[o.id],i)}}}const he=/(\w+)(\])?(\[|\.)?/g;function ue(t,e){t.seq.push(e),t.map[e.id]=e}function pe(t,e,i){const r=t.name,n=r.length;for(he.lastIndex=0;;){const o=he.exec(r),s=he.lastIndex;let a=o[1];const l="]"===o[2],c=o[3];if(l&&(a|=0),void 0===c||"["===c&&s+2===n){ue(i,void 0===c?new ae(a,t,e):new le(a,t,e));break}{let t=i.map[a];void 0===t&&(t=new ce(a),ue(i,t)),i=t}}}class de{constructor(t,e){this.seq=[],this.map={};const i=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let r=0;r<i;++r){const i=t.getActiveUniform(e,r);pe(i,t.getUniformLocation(e,i.name),this)}}setValue(t,e,i,r){const n=this.map[e];void 0!==n&&n.setValue(t,i,r)}setOptional(t,e,i){const r=e[i];void 0!==r&&this.setValue(t,i,r)}static upload(t,e,i,r){for(let n=0,o=e.length;n!==o;++n){const o=e[n],s=i[o.id];!1!==s.needsUpdate&&o.setValue(t,s.value,r)}}static seqWithValue(t,e){const i=[];for(let r=0,n=t.length;r!==n;++r){const n=t[r];n.id in e&&i.push(n)}return i}}function me(t,e,i){const r=t.createShader(e);return t.shaderSource(r,i),t.compileShader(r),r}var fe=i(576);let ge=0;function ye(t,e,i){const r=t.getShaderParameter(e,t.COMPILE_STATUS),n=t.getShaderInfoLog(e).trim();if(r&&""===n)return"";const o=/ERROR: 0:(\d+)/.exec(n);if(o){const r=parseInt(o[1]);return i.toUpperCase()+"\n\n"+n+"\n\n"+function(t,e){const i=t.split("\n"),r=[],n=Math.max(e-6,0),o=Math.min(e+6,i.length);for(let t=n;t<o;t++){const n=t+1;r.push(`${n===e?">":" "} ${n}: ${i[t]}`)}return r.join("\n")}(t.getShaderSource(e),r)}return n}function ve(t,e){const i=function(t){switch(t){case r.LinearSRGBColorSpace:return["Linear","( value )"];case r.SRGBColorSpace:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),["Linear","( value )"]}}(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function _e(t,e){let i;switch(e){case r.LinearToneMapping:i="Linear";break;case r.ReinhardToneMapping:i="Reinhard";break;case r.CineonToneMapping:i="OptimizedCineon";break;case r.ACESFilmicToneMapping:i="ACESFilmic";break;case r.CustomToneMapping:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),i="Linear"}return"vec3 "+t+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function be(t){return""!==t}function xe(t,e){const i=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,i).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function we(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Se=/^[ \t]*#include +<([\w\d./]+)>/gm;function Te(t){return t.replace(Se,Ee)}function Ee(t,e){const i=fe.ShaderChunk[e];if(void 0===i)throw new Error("Can not resolve #include <"+e+">");return Te(i)}const Me=/#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 Ae(t){return t.replace(Me,Ce)}function Ce(t,e,i,r){let n="";for(let t=parseInt(e);t<parseInt(i);t++)n+=r.replace(/\[\s*i\s*\]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t);return n}function Pe(t){let e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function Le(t,e,i,n){const o=t.getContext(),s=i.defines;let a=i.vertexShader,l=i.fragmentShader;const c=function(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===r.PCFShadowMap?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===r.PCFSoftShadowMap?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===r.VSMShadowMap&&(e="SHADOWMAP_TYPE_VSM"),e}(i),h=function(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case r.CubeReflectionMapping:case r.CubeRefractionMapping:e="ENVMAP_TYPE_CUBE";break;case r.CubeUVReflectionMapping:e="ENVMAP_TYPE_CUBE_UV"}return e}(i),u=function(t){let e="ENVMAP_MODE_REFLECTION";return t.envMap&&t.envMapMode===r.CubeRefractionMapping&&(e="ENVMAP_MODE_REFRACTION"),e}(i),p=function(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case r.MultiplyOperation:e="ENVMAP_BLENDING_MULTIPLY";break;case r.MixOperation:e="ENVMAP_BLENDING_MIX";break;case r.AddOperation:e="ENVMAP_BLENDING_ADD"}return e}(i),d=function(t){const e=t.envMapCubeUVHeight;if(null===e)return null;const i=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,i),112)),texelHeight:r,max
vendor: 7,420 bytes, line 2
2Mip:i}}(i),m=i.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.normalMapTangentSpace||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(be).join("\n")}(i),f=function(t){const e=[];for(const i in t){const r=t[i];!1!==r&&e.push("#define "+i+" "+r)}return e.join("\n")}(s),g=o.createProgram();let y,v,_=i.glslVersion?"#version "+i.glslVersion+"\n":"";i.isRawShaderMaterial?(y=[f].filter(be).join("\n"),y.length>0&&(y+="\n"),v=[m,f].filter(be).join("\n"),v.length>0&&(v+="\n")):(y=[Pe(i),"#define SHADER_NAME "+i.shaderName,f,i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",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 "+u:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.displacementMap?"#define USE_DISPLACEMENTMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",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_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.mapUv?"#define MAP_UV "+i.mapUv:"",i.alphaMapUv?"#define ALPHAMAP_UV "+i.alphaMapUv:"",i.lightMapUv?"#define LIGHTMAP_UV "+i.lightMapUv:"",i.aoMapUv?"#define AOMAP_UV "+i.aoMapUv:"",i.emissiveMapUv?"#define EMISSIVEMAP_UV "+i.emissiveMapUv:"",i.bumpMapUv?"#define BUMPMAP_UV "+i.bumpMapUv:"",i.normalMapUv?"#define NORMALMAP_UV "+i.normalMapUv:"",i.displacementMapUv?"#define DISPLACEMENTMAP_UV "+i.displacementMapUv:"",i.metalnessMapUv?"#define METALNESSMAP_UV "+i.metalnessMapUv:"",i.roughnessMapUv?"#define ROUGHNESSMAP_UV "+i.roughnessMapUv:"",i.clearcoatMapUv?"#define CLEARCOATMAP_UV "+i.clearcoatMapUv:"",i.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+i.clearcoatNormalMapUv:"",i.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+i.clearcoatRoughnessMapUv:"",i.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+i.iridescenceMapUv:"",i.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+i.iridescenceThicknessMapUv:"",i.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+i.sheenColorMapUv:"",i.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+i.sheenRoughnessMapUv:"",i.specularMapUv?"#define SPECULARMAP_UV "+i.specularMapUv:"",i.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+i.specularColorMapUv:"",i.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+i.specularIntensityMapUv:"",i.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+i.transmissionMapUv:"",i.thicknessMapUv?"#define THICKNESSMAP_UV "+i.thicknessMapUv:"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.morphColors&&i.isWebGL2?"#define USE_MORPHCOLORS":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+i.morphTextureStride:"",i.morphTargetsCount>0&&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 "+c:"",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_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#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(be).join("\n"),v=[m,Pe(i),"#define SHADER_NAME "+i.shaderName,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 "+h:"",i.envMap?"#define "+u:"",i.envMap?"#define "+p:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescence?"#define USE_IR
2IDESCENCE":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",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_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",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.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",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 "+c:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.useLegacyLights?"#define LEGACY_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==r.NoToneMapping?"#define TONE_MAPPING":"",i.toneMapping!==r.NoToneMapping?fe.ShaderChunk.tonemapping_pars_fragment:"",i.toneMapping!==r.NoToneMapping?_e("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.opaque?"#define OPAQUE":"",fe.ShaderChunk.encodings_pars_fragment,ve("linearToOutputTexel",i.outputColorSpace),i.useDepthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(be).join("\n")),a=Te(a),a=xe(a,i),a=we(a,i),l=Te(l),l=xe(l,i),l=we(l,i),a=Ae(a),l=Ae(l),i.isWebGL2&&!0!==i.isRawShaderMaterial&&(_="#version 300 es\n",y=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+y,v=["#define varying in",i.glslVersion===r.GLSL3?"":"layout(location = 0) out highp vec4 pc_fragColor;",i.glslVersion===r.GLSL3?"":"#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"+v);const b=_+y+a,x=_+v+l,w=me(o,o.VERTEX_SHADER,b),S=me(o,o.FRAGMENT_SHADER,x);if(o.attachShader(g,w),o.attachShader(g,S),void 0!==i.index0AttributeName?o.bindAttribLocation(g,0,i.index0AttributeName):!0===i.morphTargets&&o.bindAttribLocation(g,0,"position"),o.linkProgram(g),t.debug.checkShaderErrors){const e=o.getProgramInfoLog(g).trim(),i=o.getShaderInfoLog(w).trim(),r=o.getShaderInfoLog(S).trim();let n=!0,s=!0;if(!1===o.getProgramParameter(g,o.LINK_STATUS))if(n=!1,"function"==typeof t.debug.onShaderError)t.debug.onShaderError(o,g,w,S);else{const t=ye(o,w,"vertex"),i=ye(o,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+o.getError()+" - VALIDATE_STATUS "+o.getProgramParameter(g,o.VALIDATE_STATUS)+"\n\nProgram Info Log: "+e+"\n"+t+"\n"+i)}else""!==e?console.warn("THREE.WebGLProgram: Program Info Log:",e):""!==i&&""!==r||(s=!1);s&&(this.diagnostics={runnable:n,programLog:e,vertexShader:{log:i,prefix:y},fragmentShader:{log:r,prefix:v}})}let T,E;return o.deleteShader(w),o.deleteShader(S),this.getUniforms=function(){return void 0===T&&(T=new de(o,g)),T},this.getAttributes=function(){return void 0===E&&(E=function(t,e){const i={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let n=0;n<r;n++){const r=t.getActiveAttrib(e,n),o=r.name;let s=1;r.type===t.FLOAT_MAT2&&(s=2),r.type===t.FLOAT_MAT3&&(s=3),r.type===t.FLOAT_MAT4&&(s=4),i[o]={type:r.type,location:t.getAttribLocation(e,o),locationSize:s}}return i}(o,g)),E},this.destroy=function(){n.releaseStatesOfProgram(this),o.deleteProgram(g),this.program=void 0},this.name=i.shaderName,this.id=ge++,this.cacheKey=e,this.usedTimes=1,this.program=g,this.vertexShader=w,this.fragmentShader=S,this}let Re=0;class Ie{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,i=t.fragmentShader,r=this._getShaderStage(e),n=this._getShaderStage(i),o=this._getShaderCacheForMaterial(t);return!1===o.has(r)&&(o.add(r),r.usedTimes++),!1===o.has(n)&&(o.add(n),n.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const t of e)t.usedTimes--,0===t.usedTimes&&this.shaderCache.delete(t.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let i=e.get(t);return void 0===i&&(i=new Set,e.set(t,i)),i}_getShaderStage(t){const e=this.shaderCache;let i=e.get(t);return void 0===i&&(i=new Oe(t),e.set(t,i)),i}}class Oe{constructor(t){this.id=Re++,this.code=t,this.usedTimes=0}}function De(t,e,i,n,o,s,a){const l=new lt.S,c=new Ie,h=[],u=o.isWebGL2,p=o.logarithmicDepthBuffer,d=o.vertexTextures;let m=o.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"};function g(t){return 1===t?"uv1":2===t?"uv2":3===t?"uv3":"uv"}return{getParameters:function(s,l,h,v,_){const b=v.fog,x=_.geometry,w=s.isMeshStandardMaterial?v.environment:null,S=(s.isMeshStandardMaterial?i:e).get(s.envMap||w),T=S&&S.mapping===r.CubeUVReflectionMapping?S.image.height:null,E=f[s.type];null!==s.precision&&(m=o.getMaxPrecision(s.precision),m!==s.precision&&console.warn("THREE.WebGLProgram.getParameters:",
2s.precision,"not supported, using",m,"instead."));const M=x.morphAttributes.position||x.morphAttributes.normal||x.morphAttributes.color,A=void 0!==M?M.length:0;let C,P,L,R,I=0;if(void 0!==x.morphAttributes.position&&(I=1),void 0!==x.morphAttributes.normal&&(I=2),void 0!==x.morphAttributes.color&&(I=3),E){const t=y.ShaderLib[E];C=t.vertexShader,P=t.fragmentShader}else C=s.vertexShader,P=s.fragmentShader,c.update(s),L=c.getVertexShaderID(s),R=c.getFragmentShaderID(s);const O=t.getRenderTarget(),D=!0===_.isInstancedMesh,k=!!s.map,N=!!s.matcap,F=!!S,U=!!s.aoMap,z=!!s.lightMap,j=!!s.bumpMap,B=!!s.normalMap,V=!!s.displacementMap,G=!!s.emissiveMap,H=!!s.metalnessMap,q=!!s.roughnessMap,W=s.clearcoat>0,X=s.iridescence>0,Y=s.sheen>0,K=s.transmission>0,Z=W&&!!s.clearcoatMap,$=W&&!!s.clearcoatNormalMap,J=W&&!!s.clearcoatRoughnessMap,Q=X&&!!s.iridescenceMap,tt=X&&!!s.iridescenceThicknessMap,et=Y&&!!s.sheenColorMap,it=Y&&!!s.sheenRoughnessMap,rt=!!s.specularMap,nt=!!s.specularColorMap,ot=!!s.specularIntensityMap,st=K&&!!s.transmissionMap,at=K&&!!s.thicknessMap,lt=!!s.gradientMap,ct=!!s.alphaMap,ht=s.alphaTest>0,ut=!!s.extensions,pt=!!x.attributes.uv1,dt=!!x.attributes.uv2,mt=!!x.attributes.uv3;return{isWebGL2:u,shaderID:E,shaderName:s.type,vertexShader:C,fragmentShader:P,defines:s.defines,customVertexShaderID:L,customFragmentShaderID:R,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:m,instancing:D,instancingColor:D&&null!==_.instanceColor,supportsVertexTextures:d,outputColorSpace:null===O?t.outputColorSpace:!0===O.isXRRenderTarget?O.texture.colorSpace:r.LinearSRGBColorSpace,map:k,matcap:N,envMap:F,envMapMode:F&&S.mapping,envMapCubeUVHeight:T,aoMap:U,lightMap:z,bumpMap:j,normalMap:B,displacementMap:d&&V,emissiveMap:G,normalMapObjectSpace:B&&s.normalMapType===r.ObjectSpaceNormalMap,normalMapTangentSpace:B&&s.normalMapType===r.TangentSpaceNormalMap,metalnessMap:H,roughnessMap:q,clearcoat:W,clearcoatMap:Z,clearcoatNormalMap:$,clearcoatRoughnessMap:J,iridescence:X,iridescenceMap:Q,iridescenceThicknessMap:tt,sheen:Y,sheenColorMap:et,sheenRoughnessMap:it,specularMap:rt,specularColorMap:nt,specularIntensityMap:ot,transmission:K,transmissionMap:st,thicknessMap:at,gradientMap:lt,opaque:!1===s.transparent&&s.blending===r.NormalBlending,alphaMap:ct,alphaTest:ht,combine:s.combine,mapUv:k&&g(s.map.channel),aoMapUv:U&&g(s.aoMap.channel),lightMapUv:z&&g(s.lightMap.channel),bumpMapUv:j&&g(s.bumpMap.channel),normalMapUv:B&&g(s.normalMap.channel),displacementMapUv:V&&g(s.displacementMap.channel),emissiveMapUv:G&&g(s.emissiveMap.channel),metalnessMapUv:H&&g(s.metalnessMap.channel),roughnessMapUv:q&&g(s.roughnessMap.channel),clearcoatMapUv:Z&&g(s.clearcoatMap.channel),clearcoatNormalMapUv:$&&g(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:J&&g(s.clearcoatRoughnessMap.channel),iridescenceMapUv:Q&&g(s.iridescenceMap.channel),iridescenceThicknessMapUv:tt&&g(s.iridescenceThicknessMap.channel),sheenColorMapUv:et&&g(s.sheenColorMap.channel),sheenRoughnessMapUv:it&&g(s.sheenRoughnessMap.channel),specularMapUv:rt&&g(s.specularMap.channel),specularColorMapUv:nt&&g(s.specularColorMap.channel),specularIntensityMapUv:ot&&g(s.specularIntensityMap.channel),transmissionMapUv:st&&g(s.transmissionMap.channel),thicknessMapUv:at&&g(s.thicknessMap.channel),alphaMapUv:ct&&g(s.alphaMap.channel),vertexTangents:B&&!!x.attributes.tangent,vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!x.attributes.color&&4===x.attributes.color.itemSize,vertexUv1s:pt,vertexUv2s:dt,vertexUv3s:mt,pointsUvs:!0===_.isPoints&&!!x.attributes.uv&&(k||ct),fog:!!b,useFog:!0===s.fog,fogExp2:b&&b.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:p,skinning:!0===_.isSkinnedMesh,morphTargets:void 0!==x.morphAttributes.position,morphNormals:void 0!==x.morphAttributes.normal,morphColors:void 0!==x.morphAttributes.color,morphTargetsCount:A,morphTextureStride:I,numDirLights:l.directional.length,numPointLights:l.point.length,numSpotLights:l.spot.length,numSpotLightMaps:l.spotLightMap.length,numRectAreaLights:l.rectArea.length,numHemiLights:l.hemi.length,numDirLightShadows:l.directionalShadowMap.length,numPointLightShadows:l.pointShadowMap.length,numSpotLightShadows:l.spotShadowMap.length,numSpotLightShadowsWithMaps:l.numSpotLightShadowsWithMaps,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&h.length>0,shadowMapType:t.shadowMap.type,toneMapping:s.toneMapped?t.toneMapping:r.NoToneMapping,useLegacyLights:t.useLegacyLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===r.DoubleSide,flipSided:s.side===r.BackSide,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:ut&&!0===s.extensions.derivatives,extensionFragDepth:ut&&!0===s.extensions.fragDepth,extensionDrawBuffers:ut&&!0===s.extensions.drawBuffers,extensionShaderTextureLOD:ut&&!0===s.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||n.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(e){const i=[];if(e.shaderID?i.push(e.shaderID):(i.push(e.customVertexShaderID),i.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)i.push(t),i.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(function(t,e){t.push(e.precision),t.push(e.outputColorSpace),t.push(e.envMapMode),t.pu
vendor: 6,693 bytes, line 2
2sh(e.envMapCubeUVHeight),t.push(e.mapUv),t.push(e.alphaMapUv),t.push(e.lightMapUv),t.push(e.aoMapUv),t.push(e.bumpMapUv),t.push(e.normalMapUv),t.push(e.displacementMapUv),t.push(e.emissiveMapUv),t.push(e.metalnessMapUv),t.push(e.roughnessMapUv),t.push(e.clearcoatMapUv),t.push(e.clearcoatNormalMapUv),t.push(e.clearcoatRoughnessMapUv),t.push(e.iridescenceMapUv),t.push(e.iridescenceThicknessMapUv),t.push(e.sheenColorMapUv),t.push(e.sheenRoughnessMapUv),t.push(e.specularMapUv),t.push(e.specularColorMapUv),t.push(e.specularIntensityMapUv),t.push(e.transmissionMapUv),t.push(e.thicknessMapUv),t.push(e.combine),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numSpotLightMaps),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.numSpotLightShadowsWithMaps),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(i,e),function(t,e){l.disableAll(),e.isWebGL2&&l.enable(0),e.supportsVertexTextures&&l.enable(1),e.instancing&&l.enable(2),e.instancingColor&&l.enable(3),e.matcap&&l.enable(4),e.envMap&&l.enable(5),e.normalMapObjectSpace&&l.enable(6),e.normalMapTangentSpace&&l.enable(7),e.clearcoat&&l.enable(8),e.iridescence&&l.enable(9),e.alphaTest&&l.enable(10),e.vertexColors&&l.enable(11),e.vertexAlphas&&l.enable(12),e.vertexUv1s&&l.enable(13),e.vertexUv2s&&l.enable(14),e.vertexUv3s&&l.enable(15),e.vertexTangents&&l.enable(16),t.push(l.mask),l.disableAll(),e.fog&&l.enable(0),e.useFog&&l.enable(1),e.flatShading&&l.enable(2),e.logarithmicDepthBuffer&&l.enable(3),e.skinning&&l.enable(4),e.morphTargets&&l.enable(5),e.morphNormals&&l.enable(6),e.morphColors&&l.enable(7),e.premultipliedAlpha&&l.enable(8),e.shadowMapEnabled&&l.enable(9),e.useLegacyLights&&l.enable(10),e.doubleSided&&l.enable(11),e.flipSided&&l.enable(12),e.useDepthPacking&&l.enable(13),e.dithering&&l.enable(14),e.transmission&&l.enable(15),e.sheen&&l.enable(16),e.opaque&&l.enable(17),e.pointsUvs&&l.enable(18),t.push(l.mask)}(i,e),i.push(t.outputColorSpace)),i.push(e.customProgramCacheKey),i.join()},getUniforms:function(t){const e=f[t.type];let i;if(e){const t=y.ShaderLib[e];i=v.UniformsUtils.clone(t.uniforms)}else i=t.uniforms;return i},acquireProgram:function(e,i){let r;for(let t=0,e=h.length;t<e;t++){const e=h[t];if(e.cacheKey===i){r=e,++r.usedTimes;break}}return void 0===r&&(r=new Le(t,i,e,s),h.push(r)),r},releaseProgram:function(t){if(0==--t.usedTimes){const e=h.indexOf(t);h[e]=h[h.length-1],h.pop(),t.destroy()}},releaseShaderCache:function(t){c.remove(t)},programs:h,dispose:function(){c.dispose()}}}function ke(){let t=new WeakMap;return{get:function(e){let i=t.get(e);return void 0===i&&(i={},t.set(e,i)),i},remove:function(e){t.delete(e)},update:function(e,i,r){t.get(e)[i]=r},dispose:function(){t=new WeakMap}}}function Ne(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function Fe(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Ue(){const t=[];let e=0;const i=[],r=[],n=[];function o(i,r,n,o,s,a){let l=t[e];return void 0===l?(l={id:i.id,object:i,geometry:r,material:n,groupOrder:o,renderOrder:i.renderOrder,z:s,group:a},t[e]=l):(l.id=i.id,l.object=i,l.geometry=r,l.material=n,l.groupOrder=o,l.renderOrder=i.renderOrder,l.z=s,l.group=a),e++,l}return{opaque:i,transmissive:r,transparent:n,init:function(){e=0,i.length=0,r.length=0,n.length=0},push:function(t,e,s,a,l,c){const h=o(t,e,s,a,l,c);s.transmission>0?r.push(h):!0===s.transparent?n.push(h):i.push(h)},unshift:function(t,e,s,a,l,c){const h=o(t,e,s,a,l,c);s.transmission>0?r.unshift(h):!0===s.transparent?n.unshift(h):i.unshift(h)},finish:function(){for(let i=e,r=t.length;i<r;i++){const e=t[i];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.group=null}},sort:function(t,e){i.length>1&&i.sort(t||Ne),r.length>1&&r.sort(e||Fe),n.length>1&&n.sort(e||Fe)}}}function ze(){let t=new WeakMap;return{get:function(e,i){const r=t.get(e);let n;return void 0===r?(n=new Ue,t.set(e,[n])):i>=r.length?(n=new Ue,r.push(n)):n=r[i],n},dispose:function(){t=new WeakMap}}}var je=i(6729);function Be(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":i={direction:new s.Vector3,color:new f.Color};break;case"SpotLight":i={position:new s.Vector3,direction:new s.Vector3,color:new f.Color,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new s.Vector3,color:new f.Color,distance:0,decay:0};break;case"HemisphereLight":i={direction:new s.Vector3,skyColor:new f.Color,groundColor:new f.Color};break;case"RectAreaLight":i={color:new f.Color,position:new s.Vector3,halfWidth:new s.Vector3,halfHeight:new s.Vector3}}return t[e.id]=i,i}}}let Ve=0;function Ge(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function He(t,e){const i=new Be,r=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new rt.Vector2};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new rt.Vector2,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=i,i}}}(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let t=0;t<9;t++)n.probe.push(new s.Vector3);const a=new s.Vector3,l=new o.Matrix4,c=new o.Matrix4;return{setup:function(o,s){let a=0,l=0,c=0;for(let t=0;t<9;t++)n.probe[t].set(0,0,0);let h=0,u=0,p=0,d=0,m=0,f=0,g=0,y=0,v=0,_=0;o.sort(Ge);const b=!0===s?Math.PI:1;for(let t=0,e=o.length;t<e;t++){const e=o[t],s=e.color,x=e.intensity,w=e.distance,S=e.shadow&&e.shadow.map?e.shadow.map.texture:null;if(e.isAmbientLight)a+=s.r*x*b,l+=s.g*x*b,c+=s.b*x*b;else if(e.isLightProbe)for(let t=0;t<9;
2t++)n.probe[t].addScaledVector(e.sh.coefficients[t],x);else if(e.isDirectionalLight){const t=i.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*b),e.castShadow){const t=e.shadow,i=r.get(e);i.shadowBias=t.bias,i.shadowNormalBias=t.normalBias,i.shadowRadius=t.radius,i.shadowMapSize=t.mapSize,n.directionalShadow[h]=i,n.directionalShadowMap[h]=S,n.directionalShadowMatrix[h]=e.shadow.matrix,f++}n.directional[h]=t,h++}else if(e.isSpotLight){const t=i.get(e);t.position.setFromMatrixPosition(e.matrixWorld),t.color.copy(s).multiplyScalar(x*b),t.distance=w,t.coneCos=Math.cos(e.angle),t.penumbraCos=Math.cos(e.angle*(1-e.penumbra)),t.decay=e.decay,n.spot[p]=t;const o=e.shadow;if(e.map&&(n.spotLightMap[v]=e.map,v++,o.updateMatrices(e),e.castShadow&&_++),n.spotLightMatrix[p]=o.matrix,e.castShadow){const t=r.get(e);t.shadowBias=o.bias,t.shadowNormalBias=o.normalBias,t.shadowRadius=o.radius,t.shadowMapSize=o.mapSize,n.spotShadow[p]=t,n.spotShadowMap[p]=S,y++}p++}else if(e.isRectAreaLight){const t=i.get(e);t.color.copy(s).multiplyScalar(x),t.halfWidth.set(.5*e.width,0,0),t.halfHeight.set(0,.5*e.height,0),n.rectArea[d]=t,d++}else if(e.isPointLight){const t=i.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*b),t.distance=e.distance,t.decay=e.decay,e.castShadow){const t=e.shadow,i=r.get(e);i.shadowBias=t.bias,i.shadowNormalBias=t.normalBias,i.shadowRadius=t.radius,i.shadowMapSize=t.mapSize,i.shadowCameraNear=t.camera.near,i.shadowCameraFar=t.camera.far,n.pointShadow[u]=i,n.pointShadowMap[u]=S,n.pointShadowMatrix[u]=e.shadow.matrix,g++}n.point[u]=t,u++}else if(e.isHemisphereLight){const t=i.get(e);t.skyColor.copy(e.color).multiplyScalar(x*b),t.groundColor.copy(e.groundColor).multiplyScalar(x*b),n.hemi[m]=t,m++}}d>0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(n.rectAreaLTC1=je.UniformsLib.LTC_FLOAT_1,n.rectAreaLTC2=je.UniformsLib.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(n.rectAreaLTC1=je.UniformsLib.LTC_HALF_1,n.rectAreaLTC2=je.UniformsLib.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),n.ambient[0]=a,n.ambient[1]=l,n.ambient[2]=c;const x=n.hash;x.directionalLength===h&&x.pointLength===u&&x.spotLength===p&&x.rectAreaLength===d&&x.hemiLength===m&&x.numDirectionalShadows===f&&x.numPointShadows===g&&x.numSpotShadows===y&&x.numSpotMaps===v||(n.directional.length=h,n.spot.length=p,n.rectArea.length=d,n.point.length=u,n.hemi.length=m,n.directionalShadow.length=f,n.directionalShadowMap.length=f,n.pointShadow.length=g,n.pointShadowMap.length=g,n.spotShadow.length=y,n.spotShadowMap.length=y,n.directionalShadowMatrix.length=f,n.pointShadowMatrix.length=g,n.spotLightMatrix.length=y+v-_,n.spotLightMap.length=v,n.numSpotLightShadowsWithMaps=_,x.directionalLength=h,x.pointLength=u,x.spotLength=p,x.rectAreaLength=d,x.hemiLength=m,x.numDirectionalShadows=f,x.numPointShadows=g,x.numSpotShadows=y,x.numSpotMaps=v,n.version=Ve++)},setupView:function(t,e){let i=0,r=0,o=0,s=0,h=0;const u=e.matrixWorldInverse;for(let e=0,p=t.length;e<p;e++){const p=t[e];if(p.isDirectionalLight){const t=n.directional[i];t.direction.setFromMatrixPosition(p.matrixWorld),a.setFromMatrixPosition(p.target.matrixWorld),t.direction.sub(a),t.direction.transformDirection(u),i++}else if(p.isSpotLight){const t=n.spot[o];t.position.setFromMatrixPosition(p.matrixWorld),t.position.applyMatrix4(u),t.direction.setFromMatrixPosition(p.matrixWorld),a.setFromMatrixPosition(p.target.matrixWorld),t.direction.sub(a),t.direction.transformDirection(u),o++}else if(p.isRectAreaLight){const t=n.rectArea[s];t.position.setFromMatrixPosition(p.matrixWorld),t.position.applyMatrix4(u),c.identity(),l.copy(p.matrixWorld),l.premultiply(u),c.extractRotation(l),t.halfWidth.set(.5*p.width,0,0),t.halfHeight.set(0,.5*p.height,0),t.halfWidth.applyMatrix4(c),t.halfHeight.applyMatrix4(c),s++}else if(p.isPointLight){const t=n.point[r];t.position.setFromMatrixPosition(p.matrixWorld),t.position.applyMatrix4(u),r++}else if(p.isHemisphereLight){const t=n.hemi[h];t.direction.setFromMatrixPosition(p.matrixWorld),t.direction.transformDirection(u),h++}}},state:n}}function qe(t,e){const i=new He(t,e),r=[],n=[];return{init:function(){r.length=0,n.length=0},state:{lightsArray:r,shadowsArray:n,lights:i},setupLights:function(t){i.setup(r,t)},setupLightsView:function(t){i.setupView(r,t)},pushLight:function(t){r.push(t)},pushShadow:function(t){n.push(t)}}}function We(t,e){let i=new WeakMap;return{get:function(r,n=0){const o=i.get(r);let s;return void 0===o?(s=new qe(t,e),i.set(r,[s])):n>=o.length?(s=new qe(t,e),o.push(s)):s=o[n],s},dispose:function(){i=new WeakMap}}}var Xe=i(4127),Ye=i(7951);class Ke extends Ye.F{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function Ze(t,e,i){let o=new n.Frustum;const s=new rt.Vector2,l=new rt.Vector2,c=new a.Vector4,p=new Xe.MeshDepthMaterial({depthPacking:r.RGBADepthPacking}),d=new Ke,f={},y=i.maxTextureSize,v={[r.FrontSide]:r.BackSide,[r.BackSide]:r.FrontSide,[r.DoubleSide]:r.DoubleSide}
2,_=new m.ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new rt.Vector2},radius:{value:4}},vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}\n",fragmentShader:"\nuniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n\n#include <packing>\n\nvoid main() {\n\n\tconst float samples = float( VSM_SAMPLES );\n\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\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\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\n\t\t#ifdef HORIZONTAL_PASS\n\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\n\t\t#else\n\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\n\t\t#endif\n\n\t}\n\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n\n}\n"}),b=_.clone();b.defines.HORIZONTAL_PASS=1;const x=new h.BufferGeometry;x.setAttribute("position",new u.BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const w=new g.Mesh(x,_),S=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=r.PCFShadowMap;let T=this.type;function E(i,r){const n=e.update(w);_.defines.VSM_SAMPLES!==i.blurSamples&&(_.defines.VSM_SAMPLES=i.blurSamples,b.defines.VSM_SAMPLES=i.blurSamples,_.needsUpdate=!0,b.needsUpdate=!0),null===i.mapPass&&(i.mapPass=new A.WebGLRenderTarget(s.x,s.y)),_.uniforms.shadow_pass.value=i.map.texture,_.uniforms.resolution.value=i.mapSize,_.uniforms.radius.value=i.radius,t.setRenderTarget(i.mapPass),t.clear(),t.renderBufferDirect(r,null,n,_,w,null),b.uniforms.shadow_pass.value=i.mapPass.texture,b.uniforms.resolution.value=i.mapSize,b.uniforms.radius.value=i.radius,t.setRenderTarget(i.map),t.clear(),t.renderBufferDirect(r,null,n,b,w,null)}function M(e,i,n,o){let s=null;const a=!0===n.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(void 0!==a)s=a;else if(s=!0===n.isPointLight?d:p,t.localClippingEnabled&&!0===i.clipShadows&&Array.isArray(i.clippingPlanes)&&0!==i.clippingPlanes.length||i.displacementMap&&0!==i.displacementScale||i.alphaMap&&i.alphaTest>0||i.map&&i.alphaTest>0){const t=s.uuid,e=i.uuid;let r=f[t];void 0===r&&(r={},f[t]=r);let n=r[e];void 0===n&&(n=s.clone(),r[e]=n),s=n}return s.visible=i.visible,s.wireframe=i.wireframe,o===r.VSMShadowMap?s.side=null!==i.shadowSide?i.shadowSide:i.side:s.side=null!==i.shadowSide?i.shadowSide:v[i.side],s.alphaMap=i.alphaMap,s.alphaTest=i.alphaTest,s.map=i.map,s.clipShadows=i.clipShadows,s.clippingPlanes=i.clippingPlanes,s.clipIntersection=i.clipIntersection,s.displacementMap=i.displacementMap,s.displacementScale=i.displacementScale,s.displacementBias=i.displacementBias,s.wireframeLinewidth=i.wireframeLinewidth,s.linewidth=i.linewidth,!0===n.isPointLight&&!0===s.isMeshDistanceMaterial&&(t.properties.get(s).light=n),s}function C(i,n,s,a,l){if(!1===i.visible)return;if(i.layers.test(n.layers)&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&l===r.VSMShadowMap)&&(!i.frustumCulled||o.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,i.matrixWorld);const r=e.update(i),n=i.material;if(Array.isArray(n)){const e=r.groups;for(let o=0,c=e.length;o<c;o++){const c=e[o],h=n[c.materialIndex];if(h&&h.visible){const e=M(i,h,a,l);t.renderBufferDirect(s,null,r,e,i,c)}}}else if(n.visible){const e=M(i,n,a,l);t.renderBufferDirect(s,null,r,e,i,null)}}const c=i.children;for(let t=0,e=c.length;t<e;t++)C(c[t],n,s,a,l)}this.render=function(e,i,n){if(!1===S.enabled)return;if(!1===S.autoUpdate&&!1===S.needsUpdate)return;if(0===e.length)return;const a=t.getRenderTarget(),h=t.getActiveCubeFace(),u=t.getActiveMipmapLevel(),p=t.state;p.setBlending(r.NoBlending),p.buffers.color.setClear(1,1,1,1),p.buffers.depth.setTest(!0),p.setScissorTest(!1);const d=T!==r.VSMShadowMap&&this.type===r.VSMShadowMap,m=T===r.VSMShadowMap&&this.type!==r.VSMShadowMap;for(let a=0,h=e.length;a<h;a++){const h=e[a],u=h.shadow;if(void 0===u){console.warn("THREE.WebGLShadowMap:",h,"has no shadow.");continue}if(!1===u.autoUpdate&&!1===u.needsUpdate)continue;s.copy(u.mapSize);const f=u.getFrameExtents();if(s.multiply(f),l.copy(u.mapSize),(s.x>y||s.y>y)&&(s.x>y&&(l.x=Math.floor(y/f.x),s.x=l.x*f.x,u.mapSize.x=l.x),s.y>
2y&&(l.y=Math.floor(y/f.y),s.y=l.y*f.y,u.mapSize.y=l.y)),null===u.map||!0===d||!0===m){const t=this.type!==r.VSMShadowMap?{minFilter:r.NearestFilter,magFilter:r.NearestFilter}:{};null!==u.map&&u.map.dispose(),u.map=new A.WebGLRenderTarget(s.x,s.y,t),u.map.texture.name=h.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const g=u.getViewportCount();for(let t=0;t<g;t++){const e=u.getViewport(t);c.set(l.x*e.x,l.y*e.y,l.x*e.z,l.y*e.w),p.viewport(c),u.updateMatrices(h,t),o=u.getFrustum(),C(i,n,u.camera,h,this.type)}!0!==u.isPointLightShadow&&this.type===r.VSMShadowMap&&E(u,n),u.needsUpdate=!1}T=this.type,S.needsUpdate=!1,t.setRenderTarget(a,h,u)}}function $e(t,e,i){const n=i.isWebGL2,o=new function(){let e=!1;const i=new a.Vector4;let r=null;const n=new a.Vector4(0,0,0,0);return{setMask:function(i){r===i||e||(t.colorMask(i,i,i,i),r=i)},setLocked:function(t){e=t},setClear:function(e,r,o,s,a){!0===a&&(e*=s,r*=s,o*=s),i.set(e,r,o,s),!1===n.equals(i)&&(t.clearColor(e,r,o,s),n.copy(i))},reset:function(){e=!1,r=null,n.set(-1,0,0,0)}}},s=new function(){let e=!1,i=null,n=null,o=null;return{setTest:function(e){e?V(t.DEPTH_TEST):G(t.DEPTH_TEST)},setMask:function(r){i===r||e||(t.depthMask(r),i=r)},setFunc:function(e){if(n!==e){switch(e){case r.NeverDepth:t.depthFunc(t.NEVER);break;case r.AlwaysDepth:t.depthFunc(t.ALWAYS);break;case r.LessDepth:t.depthFunc(t.LESS);break;case r.LessEqualDepth:t.depthFunc(t.LEQUAL);break;case r.EqualDepth:t.depthFunc(t.EQUAL);break;case r.GreaterEqualDepth:t.depthFunc(t.GEQUAL);break;case r.GreaterDepth:t.depthFunc(t.GREATER);break;case r.NotEqualDepth:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}n=e}},setLocked:function(t){e=t},setClear:function(e){o!==e&&(t.clearDepth(e),o=e)},reset:function(){e=!1,i=null,n=null,o=null}}},l=new function(){let e=!1,i=null,r=null,n=null,o=null,s=null,a=null,l=null,c=null;return{setTest:function(i){e||(i?V(t.STENCIL_TEST):G(t.STENCIL_TEST))},setMask:function(r){i===r||e||(t.stencilMask(r),i=r)},setFunc:function(e,i,s){r===e&&n===i&&o===s||(t.stencilFunc(e,i,s),r=e,n=i,o=s)},setOp:function(e,i,r){s===e&&a===i&&l===r||(t.stencilOp(e,i,r),s=e,a=i,l=r)},setLocked:function(t){e=t},setClear:function(e){c!==e&&(t.clearStencil(e),c=e)},reset:function(){e=!1,i=null,r=null,n=null,o=null,s=null,a=null,l=null,c=null}}},c=new WeakMap,h=new WeakMap;let u={},p={},d=new WeakMap,m=[],f=null,g=!1,y=null,v=null,_=null,b=null,x=null,w=null,S=null,T=!1,E=null,M=null,A=null,C=null,P=null;const L=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let R=!1,I=0;const O=t.getParameter(t.VERSION);-1!==O.indexOf("WebGL")?(I=parseFloat(/^WebGL (\d)/.exec(O)[1]),R=I>=1):-1!==O.indexOf("OpenGL ES")&&(I=parseFloat(/^OpenGL ES (\d)/.exec(O)[1]),R=I>=2);let D=null,k={};const N=t.getParameter(t.SCISSOR_BOX),F=t.getParameter(t.VIEWPORT),U=(new a.Vector4).fromArray(N),z=(new a.Vector4).fromArray(F);function j(e,i,r,o){const s=new Uint8Array(4),a=t.createTexture();t.bindTexture(e,a),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let a=0;a<r;a++)!n||e!==t.TEXTURE_3D&&e!==t.TEXTURE_2D_ARRAY?t.texImage2D(i+a,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,s):t.texImage3D(i,0,t.RGBA,1,1,o,0,t.RGBA,t.UNSIGNED_BYTE,s);return a}const B={};function V(e){!0!==u[e]&&(t.enable(e),u[e]=!0)}function G(e){!1!==u[e]&&(t.disable(e),u[e]=!1)}B[t.TEXTURE_2D]=j(t.TEXTURE_2D,t.TEXTURE_2D,1),B[t.TEXTURE_CUBE_MAP]=j(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),n&&(B[t.TEXTURE_2D_ARRAY]=j(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),B[t.TEXTURE_3D]=j(t.TEXTURE_3D,t.TEXTURE_3D,1,1)),o.setClear(0,0,0,1),s.setClear(1),l.setClear(0),V(t.DEPTH_TEST),s.setFunc(r.LessEqualDepth),X(!1),Y(r.CullFaceBack),V(t.CULL_FACE),W(r.NoBlending);const H={[r.AddEquation]:t.FUNC_ADD,[r.SubtractEquation]:t.FUNC_SUBTRACT,[r.ReverseSubtractEquation]:t.FUNC_REVERSE_SUBTRACT};if(n)H[r.MinEquation]=t.MIN,H[r.MaxEquation]=t.MAX;else{const t=e.get("EXT_blend_minmax");null!==t&&(H[r.MinEquation]=t.MIN_EXT,H[r.MaxEquation]=t.MAX_EXT)}const q={[r.ZeroFactor]:t.ZERO,[r.OneFactor]:t.ONE,[r.SrcColorFactor]:t.SRC_COLOR,[r.SrcAlphaFactor]:t.SRC_ALPHA,[r.SrcAlphaSaturateFactor]:t.SRC_ALPHA_SATURATE,[r.DstColorFactor]:t.DST_COLOR,[r.DstAlphaFactor]:t.DST_ALPHA,[r.OneMinusSrcColorFactor]:t.ONE_MINUS_SRC_COLOR,[r.OneMinusSrcAlphaFactor]:t.ONE_MINUS_SRC_ALPHA,[r.OneMinusDstColorFactor]:t.ONE_MINUS_DST_COLOR,[r.OneMinusDstAlphaFactor]:t.ONE_MINUS_DST_ALPHA};function W(e,i,n,o,s,a,l,c){if(e!==r.NoBlending){if(!1===g&&(V(t.BLEND),g=!0),e===r.CustomBlending)s=s||i,a=a||n,l=l||o,i===v&&s===x||(t.blendEquationSeparate(H[i],H[s]),v=i,x=s),n===_&&o===b&&a===w&&l===S||(t.blendFuncSeparate(q[n],q[o],q[a],q[l]),_=n,b=o,w=a,S=l),y=e,T=!1;else if(e!==y||c!==T){if(v===r.AddEquation&&x===r.AddEquation||(t.blendEquation(t.FUNC_ADD),v=r.AddEquation,x=r.AddEquation),c)switch(e){case r.NormalBlending:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case r.AdditiveBlending:t.blendFunc(t.ONE,t.ONE);break;case r.SubtractiveBlending:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case r.MultiplyBlending:t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case r.NormalBlending:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case r.AdditiveBlending:t.blendFunc(t.SRC_ALPHA,t.ONE);break;case r.SubtractiveBlending:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case r.MultiplyBlending:t.blendFunc(t.ZERO,t.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}_=null,b=null,w=null,S=null,y=e,T=c}}else!0===g&&(G(t.BLEND),g=!1)}function X(e){E!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),E=e)}function Y(e){e!==r.CullFaceNone?(V(t.CULL_FACE),e!==M&&(e===r.CullFaceBack?t.cullFace(t.BACK):e===r.CullFaceFront?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):G(t.CULL_FACE),M=e}function K(e,i,r){e?(V(t.POLYGON_OFFSET_FILL),C===i&&P===r||(t.polygonOffset(i,r),C=i,P=r)):G(t.POLYGON_OFFSET_FILL)}return{buffers:{color:o,depth:s,stencil:l},enable:V,disable:G,bindFramebuffer:function(e,i){return p[e]!==i&&(t.bindFramebuffer(e,i),p[e]=i,n&&(e===t.DRAW_FRAMEBUFFER&&(p[t.FRAMEBUFFER]=i),e===t.FRAMEBUFFER&&(p[t.DRAW_FRAMEBUFFER]=i)),!0)},drawBuffers:function(r,n){let o=m,s=!1;if(r)if(o=d.get(n),void 0===o&&(o=[],d.set(n,o)),r.isWebGLMultipleRenderTargets){const e=r.texture;if(o.length!==e.length||o[0]!==t.COLOR_ATTACHMENT0){for(let i=0,r=e.length;i<r;i++)o[i]=t.COLOR_ATTACHMENT0+i;o.length=e.length,s=!0}}else o[0]!==t.COLOR_ATTACHMENT0&&(o[0]=t.COLOR_ATTACHMENT0,s=!0);else o[0]!==t.BACK&&(o[0]=t.BACK,s=!0);
vendor: 5,391 bytes, line 2
2s&&(i.isWebGL2?t.drawBuffers(o):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(o))},useProgram:function(e){return f!==e&&(t.useProgram(e),f=e,!0)},setBlending:W,setMaterial:function(e,i){e.side===r.DoubleSide?G(t.CULL_FACE):V(t.CULL_FACE);let n=e.side===r.BackSide;i&&(n=!n),X(n),e.blending===r.NormalBlending&&!1===e.transparent?W(r.NoBlending):W(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),o.setMask(e.colorWrite);const a=e.stencilWrite;l.setTest(a),a&&(l.setMask(e.stencilWriteMask),l.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),l.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),K(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?V(t.SAMPLE_ALPHA_TO_COVERAGE):G(t.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:X,setCullFace:Y,setLineWidth:function(e){e!==A&&(R&&t.lineWidth(e),A=e)},setPolygonOffset:K,setScissorTest:function(e){e?V(t.SCISSOR_TEST):G(t.SCISSOR_TEST)},activeTexture:function(e){void 0===e&&(e=t.TEXTURE0+L-1),D!==e&&(t.activeTexture(e),D=e)},bindTexture:function(e,i,r){void 0===r&&(r=null===D?t.TEXTURE0+L-1:D);let n=k[r];void 0===n&&(n={type:void 0,texture:void 0},k[r]=n),n.type===e&&n.texture===i||(D!==r&&(t.activeTexture(r),D=r),t.bindTexture(e,i||B[e]),n.type=e,n.texture=i)},unbindTexture:function(){const e=k[D];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexImage3D:function(){try{t.compressedTexImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},updateUBOMapping:function(e,i){let r=h.get(i);void 0===r&&(r=new WeakMap,h.set(i,r));let n=r.get(e);void 0===n&&(n=t.getUniformBlockIndex(i,e.name),r.set(e,n))},uniformBlockBinding:function(e,i){const r=h.get(i).get(e);c.get(i)!==r&&(t.uniformBlockBinding(i,r,e.__bindingPointIndex),c.set(i,r))},texStorage2D:function(){try{t.texStorage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texStorage3D:function(){try{t.texStorage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage2D:function(){try{t.texSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage3D:function(){try{t.texSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage2D:function(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage3D:function(){try{t.compressedTexSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===U.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),U.copy(e))},viewport:function(e){!1===z.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),z.copy(e))},reset:function(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),!0===n&&(t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null)),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),u={},D=null,k={},p={},d=new WeakMap,m=[],f=null,g=!1,y=null,v=null,_=null,b=null,x=null,w=null,S=null,T=!1,E=null,M=null,A=null,C=null,P=null,U.set(0,0,t.canvas.width,t.canvas.height),z.set(0,0,t.canvas.width,t.canvas.height),o.reset(),s.reset(),l.reset()}}}var Je=i(3334),Qe=i(7300);function ti(t,e,i,n,o,s,a){const l=o.isWebGL2,c=o.maxTextures,h=o.maxCubemapSize,u=o.maxTextureSize,p=o.maxSamples,d=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,m="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let g;const y=new WeakMap;let v=!1;try{v="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function _(t,e){return v?new OffscreenCanvas(t,e):(0,O.c)("canvas")}function b(t,e,i,r){let n=1;if((t.width>r||t.height>r)&&(n=r/Math.max(t.width,t.height)),n<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const r=e?Je.floorPowerOfTwo:Math.floor,o=r(n*t.width),s=r(n*t.height);void 0===g&&(g=_(o,s));const a=i?_(o,s):g;return a.width=o,a.height=s,a.getContext("2d").drawImage(t,0,0,o,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+
2o+"x"+s+")."),a}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function x(t){return Je.isPowerOfTwo(t.width)&&Je.isPowerOfTwo(t.height)}function w(t,e){return t.generateMipmaps&&e&&t.minFilter!==r.NearestFilter&&t.minFilter!==r.LinearFilter}function S(e){t.generateMipmap(e)}function T(i,n,o,s,a=!1){if(!1===l)return n;if(null!==i){if(void 0!==t[i])return t[i];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+i+"'")}let c=n;return n===t.RED&&(o===t.FLOAT&&(c=t.R32F),o===t.HALF_FLOAT&&(c=t.R16F),o===t.UNSIGNED_BYTE&&(c=t.R8)),n===t.RG&&(o===t.FLOAT&&(c=t.RG32F),o===t.HALF_FLOAT&&(c=t.RG16F),o===t.UNSIGNED_BYTE&&(c=t.RG8)),n===t.RGBA&&(o===t.FLOAT&&(c=t.RGBA32F),o===t.HALF_FLOAT&&(c=t.RGBA16F),o===t.UNSIGNED_BYTE&&(c=s===r.SRGBColorSpace&&!1===a?t.SRGB8_ALPHA8:t.RGBA8),o===t.UNSIGNED_SHORT_4_4_4_4&&(c=t.RGBA4),o===t.UNSIGNED_SHORT_5_5_5_1&&(c=t.RGB5_A1)),c!==t.R16F&&c!==t.R32F&&c!==t.RG16F&&c!==t.RG32F&&c!==t.RGBA16F&&c!==t.RGBA32F||e.get("EXT_color_buffer_float"),c}function E(t,e,i){return!0===w(t,i)||t.isFramebufferTexture&&t.minFilter!==r.NearestFilter&&t.minFilter!==r.LinearFilter?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function M(e){return e===r.NearestFilter||e===r.NearestMipmapNearestFilter||e===r.NearestMipmapLinearFilter?t.NEAREST:t.LINEAR}function A(t){const e=t.target;e.removeEventListener("dispose",A),function(t){const e=n.get(t);if(void 0===e.__webglInit)return;const i=t.source,r=y.get(i);if(r){const n=r[e.__cacheKey];n.usedTimes--,0===n.usedTimes&&P(t),0===Object.keys(r).length&&y.delete(i)}n.remove(t)}(e),e.isVideoTexture&&f.delete(e)}function C(e){const i=e.target;i.removeEventListener("dispose",C),function(e){const i=e.texture,r=n.get(e),o=n.get(i);if(void 0!==o.__webglTexture&&(t.deleteTexture(o.__webglTexture),a.memory.textures--),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(r.__webglFramebuffer[e]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[e]);else{if(t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&t.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer)for(let e=0;e<r.__webglColorRenderbuffer.length;e++)r.__webglColorRenderbuffer[e]&&t.deleteRenderbuffer(r.__webglColorRenderbuffer[e]);r.__webglDepthRenderbuffer&&t.deleteRenderbuffer(r.__webglDepthRenderbuffer)}if(e.isWebGLMultipleRenderTargets)for(let e=0,r=i.length;e<r;e++){const r=n.get(i[e]);r.__webglTexture&&(t.deleteTexture(r.__webglTexture),a.memory.textures--),n.remove(i[e])}n.remove(i),n.remove(e)}(i)}function P(e){const i=n.get(e);t.deleteTexture(i.__webglTexture);const r=e.source;delete y.get(r)[i.__cacheKey],a.memory.textures--}let L=0;function R(e,r){const o=n.get(e);if(e.isVideoTexture&&function(t){const e=a.render.frame;f.get(t)!==e&&(f.set(t,e),t.update())}(e),!1===e.isRenderTargetTexture&&e.version>0&&o.__version!==e.version){const t=e.image;if(null===t)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==t.complete)return void F(o,e,r);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.bindTexture(t.TEXTURE_2D,o.__webglTexture,t.TEXTURE0+r)}const I={[r.RepeatWrapping]:t.REPEAT,[r.ClampToEdgeWrapping]:t.CLAMP_TO_EDGE,[r.MirroredRepeatWrapping]:t.MIRRORED_REPEAT},D={[r.NearestFilter]:t.NEAREST,[r.NearestMipmapNearestFilter]:t.NEAREST_MIPMAP_NEAREST,[r.NearestMipmapLinearFilter]:t.NEAREST_MIPMAP_LINEAR,[r.LinearFilter]:t.LINEAR,[r.LinearMipmapNearestFilter]:t.LINEAR_MIPMAP_NEAREST,[r.LinearMipmapLinearFilter]:t.LINEAR_MIPMAP_LINEAR};function k(i,s,a){if(a?(t.texParameteri(i,t.TEXTURE_WRAP_S,I[s.wrapS]),t.texParameteri(i,t.TEXTURE_WRAP_T,I[s.wrapT]),i!==t.TEXTURE_3D&&i!==t.TEXTURE_2D_ARRAY||t.texParameteri(i,t.TEXTURE_WRAP_R,I[s.wrapR]),t.texParameteri(i,t.TEXTURE_MAG_FILTER,D[s.magFilter]),t.texParameteri(i,t.TEXTURE_MIN_FILTER,D[s.minFilter])):(t.texParameteri(i,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(i,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),i!==t.TEXTURE_3D&&i!==t.TEXTURE_2D_ARRAY||t.texParameteri(i,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),s.wrapS===r.ClampToEdgeWrapping&&s.wrapT===r.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(i,t.TEXTURE_MAG_FILTER,M(s.magFilter)),t.texParameteri(i,t.TEXTURE_MIN_FILTER,M(s.minFilter)),s.minFilter!==r.NearestFilter&&s.minFilter!==r.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===e.has("EXT_texture_filter_anisotropic")){const a=e.get("EXT_texture_filter_anisotropic");if(s.magFilter===r.NearestFilter)return;if(s.minFilter!==r.NearestMipmapLinearFilter&&s.minFilter!==r.LinearMipmapLinearFilter)return;if(s.type===r.FloatType&&!1===e.has("OES_texture_float_linear"))return;if(!1===l&&s.type===r.HalfFloatType&&!1===e.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||n.get(s).__currentAnisotropy)&&(t.texParameterf(i,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,o.getMaxAnisotropy())),n.get(s).__currentAnisotropy=s.anisotropy)}}function N(e,i){let r=!1;void 0===e.__webglInit&&(e.__webglInit=!0,i.addEventListener("dispose",A));const n=i.source;let o=y.get(n);void 0===o&&(o={},y.set(n,o));const s=function(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.wrapR||0),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.colorSpace),e.join()}(i);if(s!==e.__cacheKey){void 0===o[s]&&(o[s]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,r=!0),o[s].usedTimes++;const n=o[e.__cacheKey];void 0!==n&&(o[e.__cacheKey].usedTimes--,0===n.usedTimes&&P(i)),e.__cacheKey=s,e.__webglTexture=o[s].texture}return r}function F(e,o,a){let c=t.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(c=t.TEXTURE_2D_ARRAY),o.isData3DTexture&&(c=t.TEXTURE_3D);const h=N(e,o),p=o.source;i.bindTexture(c,e.__webglTexture,t.TEXTURE0+a);const d=n.get(p);if(p.version!==d.__version||!0===h){i.activeTexture(t.TEXTURE0+a),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,o.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,o.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const e=function(t){return!l&&(t.wrapS!==r.ClampToEdgeWrapping||t.wrapT!==r.ClampToEdgeWrapping||t.minFilter!==r.NearestFilter&&t.minFilter!==r.LinearFilter)}(o)&&!1===x(o.image);let n=b(o.image,e,!1,u);n=G(o,n);const m=x(n)||l,f=s.convert(o.format,o.colorSpace);
2let g,y=s.convert(o.type),v=T(o.internalFormat,f,y,o.colorSpace);k(c,o,m);const _=o.mipmaps,M=l&&!0!==o.isVideoTexture,A=void 0===d.__version||!0===h,C=E(o,n,m);if(o.isDepthTexture)v=t.DEPTH_COMPONENT,l?v=o.type===r.FloatType?t.DEPTH_COMPONENT32F:o.type===r.UnsignedIntType?t.DEPTH_COMPONENT24:o.type===r.UnsignedInt248Type?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT16:o.type===r.FloatType&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),o.format===r.DepthFormat&&v===t.DEPTH_COMPONENT&&o.type!==r.UnsignedShortType&&o.type!==r.UnsignedIntType&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),o.type=r.UnsignedIntType,y=s.convert(o.type)),o.format===r.DepthStencilFormat&&v===t.DEPTH_COMPONENT&&(v=t.DEPTH_STENCIL,o.type!==r.UnsignedInt248Type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),o.type=r.UnsignedInt248Type,y=s.convert(o.type))),A&&(M?i.texStorage2D(t.TEXTURE_2D,1,v,n.width,n.height):i.texImage2D(t.TEXTURE_2D,0,v,n.width,n.height,0,f,y,null));else if(o.isDataTexture)if(_.length>0&&m){M&&A&&i.texStorage2D(t.TEXTURE_2D,C,v,_[0].width,_[0].height);for(let e=0,r=_.length;e<r;e++)g=_[e],M?i.texSubImage2D(t.TEXTURE_2D,e,0,0,g.width,g.height,f,y,g.data):i.texImage2D(t.TEXTURE_2D,e,v,g.width,g.height,0,f,y,g.data);o.generateMipmaps=!1}else M?(A&&i.texStorage2D(t.TEXTURE_2D,C,v,n.width,n.height),i.texSubImage2D(t.TEXTURE_2D,0,0,0,n.width,n.height,f,y,n.data)):i.texImage2D(t.TEXTURE_2D,0,v,n.width,n.height,0,f,y,n.data);else if(o.isCompressedTexture)if(o.isCompressedArrayTexture){M&&A&&i.texStorage3D(t.TEXTURE_2D_ARRAY,C,v,_[0].width,_[0].height,n.depth);for(let e=0,s=_.length;e<s;e++)g=_[e],o.format!==r.RGBAFormat?null!==f?M?i.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,g.width,g.height,n.depth,f,g.data,0,0):i.compressedTexImage3D(t.TEXTURE_2D_ARRAY,e,v,g.width,g.height,n.depth,0,g.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):M?i.texSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,g.width,g.height,n.depth,f,y,g.data):i.texImage3D(t.TEXTURE_2D_ARRAY,e,v,g.width,g.height,n.depth,0,f,y,g.data)}else{M&&A&&i.texStorage2D(t.TEXTURE_2D,C,v,_[0].width,_[0].height);for(let e=0,n=_.length;e<n;e++)g=_[e],o.format!==r.RGBAFormat?null!==f?M?i.compressedTexSubImage2D(t.TEXTURE_2D,e,0,0,g.width,g.height,f,g.data):i.compressedTexImage2D(t.TEXTURE_2D,e,v,g.width,g.height,0,g.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):M?i.texSubImage2D(t.TEXTURE_2D,e,0,0,g.width,g.height,f,y,g.data):i.texImage2D(t.TEXTURE_2D,e,v,g.width,g.height,0,f,y,g.data)}else if(o.isDataArrayTexture)M?(A&&i.texStorage3D(t.TEXTURE_2D_ARRAY,C,v,n.width,n.height,n.depth),i.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,n.width,n.height,n.depth,f,y,n.data)):i.texImage3D(t.TEXTURE_2D_ARRAY,0,v,n.width,n.height,n.depth,0,f,y,n.data);else if(o.isData3DTexture)M?(A&&i.texStorage3D(t.TEXTURE_3D,C,v,n.width,n.height,n.depth),i.texSubImage3D(t.TEXTURE_3D,0,0,0,0,n.width,n.height,n.depth,f,y,n.data)):i.texImage3D(t.TEXTURE_3D,0,v,n.width,n.height,n.depth,0,f,y,n.data);else if(o.isFramebufferTexture){if(A)if(M)i.texStorage2D(t.TEXTURE_2D,C,v,n.width,n.height);else{let e=n.width,r=n.height;for(let n=0;n<C;n++)i.texImage2D(t.TEXTURE_2D,n,v,e,r,0,f,y,null),e>>=1,r>>=1}}else if(_.length>0&&m){M&&A&&i.texStorage2D(t.TEXTURE_2D,C,v,_[0].width,_[0].height);for(let e=0,r=_.length;e<r;e++)g=_[e],M?i.texSubImage2D(t.TEXTURE_2D,e,0,0,f,y,g):i.texImage2D(t.TEXTURE_2D,e,v,f,y,g);o.generateMipmaps=!1}else M?(A&&i.texStorage2D(t.TEXTURE_2D,C,v,n.width,n.height),i.texSubImage2D(t.TEXTURE_2D,0,0,0,f,y,n)):i.texImage2D(t.TEXTURE_2D,0,v,f,y,n);w(o,m)&&S(c),d.__version=p.version,o.onUpdate&&o.onUpdate(o)}e.__version=o.version}function U(e,r,o,a,l){const c=s.convert(o.format,o.colorSpace),h=s.convert(o.type),u=T(o.internalFormat,c,h,o.colorSpace);n.get(r).__hasExternalTextures||(l===t.TEXTURE_3D||l===t.TEXTURE_2D_ARRAY?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(t.FRAMEBUFFER,e),V(r)?d.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,a,l,
2n.get(o).__webglTexture,0,B(r)):(l===t.TEXTURE_2D||l>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,a,l,n.get(o).__webglTexture,0),i.bindFramebuffer(t.FRAMEBUFFER,null)}function z(e,i,n){if(t.bindRenderbuffer(t.RENDERBUFFER,e),i.depthBuffer&&!i.stencilBuffer){let o=t.DEPTH_COMPONENT16;if(n||V(i)){const e=i.depthTexture;e&&e.isDepthTexture&&(e.type===r.FloatType?o=t.DEPTH_COMPONENT32F:e.type===r.UnsignedIntType&&(o=t.DEPTH_COMPONENT24));const n=B(i);V(i)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,n,o,i.width,i.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,n,o,i.width,i.height)}else t.renderbufferStorage(t.RENDERBUFFER,o,i.width,i.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)}else if(i.depthBuffer&&i.stencilBuffer){const r=B(i);n&&!1===V(i)?t.renderbufferStorageMultisample(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,i.width,i.height):V(i)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,r,t.DEPTH24_STENCIL8,i.width,i.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,i.width,i.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)}else{const e=!0===i.isWebGLMultipleRenderTargets?i.texture:[i.texture];for(let r=0;r<e.length;r++){const o=e[r],a=s.convert(o.format,o.colorSpace),l=s.convert(o.type),c=T(o.internalFormat,a,l,o.colorSpace),h=B(i);n&&!1===V(i)?t.renderbufferStorageMultisample(t.RENDERBUFFER,h,c,i.width,i.height):V(i)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,h,c,i.width,i.height):t.renderbufferStorage(t.RENDERBUFFER,c,i.width,i.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function j(e){const o=n.get(e),s=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture&&!o.__autoAllocateDepthBuffer){if(s)throw new Error("target.depthTexture not supported in Cube render targets");
2!function(e,o){if(o&&o.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(i.bindFramebuffer(t.FRAMEBUFFER,e),!o.depthTexture||!o.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(o.depthTexture).__webglTexture&&o.depthTexture.image.width===o.width&&o.depthTexture.image.height===o.height||(o.depthTexture.image.width=o.width,o.depthTexture.image.height=o.height,o.depthTexture.needsUpdate=!0),R(o.depthTexture,0);const s=n.get(o.depthTexture).__webglTexture,a=B(o);if(o.depthTexture.format===r.DepthFormat)V(o)?d.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,s,0,a):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,s,0);else{if(o.depthTexture.format!==r.DepthStencilFormat)throw new Error("Unknown depthTexture format");V(o)?d.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,s,0,a):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,s,0)}}(o.__webglFramebuffer,e)}else if(s){o.__webglDepthbuffer=[];for(let r=0;r<6;r++)i.bindFramebuffer(t.FRAMEBUFFER,o.__webglFramebuffer[r]),o.__webglDepthbuffer[r]=t.createRenderbuffer(),z(o.__webglDepthbuffer[r],e,!1)}else i.bindFramebuffer(t.FRAMEBUFFER,o.__webglFramebuffer),o.__webglDepthbuffer=t.createRenderbuffer(),z(o.__webglDepthbuffer,e,!1);i.bindFramebuffer(t.FRAMEBUFFER,null)}function B(t){return Math.min(p,t.samples)}function V(t){const i=n.get(t);return l&&t.samples>0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==i.__useRenderToTexture}function G(t,i){const n=t.colorSpace,o=t.format,s=t.type;return!0===t.isCompressedTexture||t.format===r._SRGBAFormat||n!==r.LinearSRGBColorSpace&&n!==r.NoColorSpace&&(n===r.SRGBColorSpace?!1===l?!0===e.has("EXT_sRGB")&&o===r.RGBAFormat?(t.format=r._SRGBAFormat,t.minFilter=r.LinearFilter,t.generateMipmaps=!1):i=Qe.P.sRGBToLinear(i):o===r.RGBAFormat&&s===r.UnsignedByteType||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",n)),i}this.allocateTextureUnit=function(){const t=L;return t>=c&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+c),L+=1,t},this.resetTextureUnits=function(){L=0},this.setTexture2D=R,this.setTexture2DArray=function(e,r){const o=n.get(e);e.version>0&&o.__version!==e.version?F(o,e,r):i.bindTexture(t.TEXTURE_2D_ARRAY,o.__webglTexture,t.TEXTURE0+r)},this.setTexture3D=function(e,r){const o=n.get(e);e.version>0&&o.__version!==e.version?F(o,e,r):i.bindTexture(t.TEXTURE_3D,o.__webglTexture,t.TEXTURE0+r)},this.setTextureCube=function(e,o){const a=n.get(e);e.version>0&&a.__version!==e.version?function(e,o,a){if(6!==o.image.length)return;const c=N(e,o),u=o.source;i.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+a);const p=n.get(u);if(u.version!==p.__version||!0===c){i.activeTexture(t.TEXTURE0+a),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,o.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,o.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE);const e=o.isCompressedTexture||o.image[0].isCompressedTexture,n=o.image[0]&&o.image[0].isDataTexture,d=[];for(let t=0;t<6;t++)d[t]=e||n?n?o.image[t].image:o.image[t]:b(o.image[t],!1,!0,h),d[t]=G(o,d[t]);
2const m=d[0],f=x(m)||l,g=s.convert(o.format,o.colorSpace),y=s.convert(o.type),v=T(o.internalFormat,g,y,o.colorSpace),_=l&&!0!==o.isVideoTexture,M=void 0===p.__version||!0===c;let A,C=E(o,m,f);if(k(t.TEXTURE_CUBE_MAP,o,f),e){_&&M&&i.texStorage2D(t.TEXTURE_CUBE_MAP,C,v,m.width,m.height);for(let e=0;e<6;e++){A=d[e].mipmaps;for(let n=0;n<A.length;n++){const s=A[n];o.format!==r.RGBAFormat?null!==g?_?i.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,n,0,0,s.width,s.height,g,s.data):i.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,n,v,s.width,s.height,0,s.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):_?i.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,n,0,0,s.width,s.height,g,y,s.data):i.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,n,v,s.width,s.height,0,g,y,s.data)}}}else{A=o.mipmaps,_&&M&&(A.length>0&&C++,i.texStorage2D(t.TEXTURE_CUBE_MAP,C,v,d[0].width,d[0].height));for(let e=0;e<6;e++)if(n){_?i.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,d[e].width,d[e].height,g,y,d[e].data):i.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,v,d[e].width,d[e].height,0,g,y,d[e].data);for(let r=0;r<A.length;r++){const n=A[r].image[e].image;_?i.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,0,0,n.width,n.height,g,y,n.data):i.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,v,n.width,n.height,0,g,y,n.data)}}else{_?i.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,g,y,d[e]):i.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,v,g,y,d[e]);for(let r=0;r<A.length;r++){const n=A[r];_?i.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,0,0,g,y,n.image[e]):i.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,v,g,y,n.image[e])}}}w(o,f)&&S(t.TEXTURE_CUBE_MAP),p.__version=u.version,o.onUpdate&&o.onUpdate(o)}e.__version=o.version}(a,e,o):i.bindTexture(t.TEXTURE_CUBE_MAP,a.__webglTexture,t.TEXTURE0+o)},this.rebindTextures=function(e,i,r){const o=n.get(e);void 0!==i&&U(o.__webglFramebuffer,e,e.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D),void 0!==r&&j(e)},this.setupRenderTarget=function(e){const r=e.texture,c=n.get(e),h=n.get(r);e.addEventListener("dispose",C),!0!==e.isWebGLMultipleRenderTargets&&(void 0===h.__webglTexture&&(h.__webglTexture=t.createTexture()),h.__version=r.version,a.memory.textures++);const u=!0===e.isWebGLCubeRenderTarget,p=!0===e.isWebGLMultipleRenderTargets,d=x(e)||l;if(u){c.__webglFramebuffer=[];for(let e=0;e<6;e++)c.__webglFramebuffer[e]=t.createFramebuffer()}else{if(c.__webglFramebuffer=t.createFramebuffer(),p)if(o.drawBuffers){const i=e.texture;for(let e=0,r=i.length;e<r;e++){const r=n.get(i[e]);void 0===r.__webglTexture&&(r.__webglTexture=t.createTexture(),a.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(l&&e.samples>0&&!1===V(e)){const n=p?r:[r];c.__webglMultisampledFramebuffer=t.createFramebuffer(),c.__webglColorRenderbuffer=[],i.bindFramebuffer(t.FRAMEBUFFER,c.__webglMultisampledFramebuffer);for(let i=0;i<n.length;i++){const r=n[i];c.__webglColorRenderbuffer[i]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,c.__webglColorRenderbuffer[i]);const o=s.convert(r.format,r.colorSpace),a=s.convert(r.type),l=T(r.internalFormat,o,a,r.colorSpace,!0===e.isXRRenderTarget),h=B(e);t.renderbufferStorageMultisample(t.RENDERBUFFER,h,l,e.width,e.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+i,t.RENDERBUFFER,c.__webglColorRenderbuffer[i])}t.bindRenderbuffer(t.RENDERBUFFER,null),e.depthBuffer&&(c.__webglDepthRenderbuffer=t.createRenderbuffer(),z(c.__webglDepthRenderbuffer,e,!0)),i.bindFramebuffer(t.FRAMEBUFFER,null)}}if(u){i.bindTexture(t.TEXTURE_CUBE_MAP,h.__webglTexture),k(t.TEXTURE_CUBE_MAP,r,d);for(let i=0;i<6;i++)U(c.__webglFramebuffer[i],e,r,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+i);w(r,d)&&S(t.TEXTURE_CUBE_MAP),i.unbindTexture()}else if(p){const r=e.texture;for(let o=0,s=r.length;o<s;o++){const s=r[o],a=n.get(s);i.bindTexture(t.TEXTURE_2D,a.__webglTexture),k(t.TEXTURE_2D,s,d),U(c.__webglFramebuffer,e,s,t.COLOR_ATTACHMENT0+o,t.TEXTURE_2D),w(s,d)&&S(t.TEXTURE_2D)}i.unbindTexture()}else{let n=t.TEXTURE_2D;(e.isWebGL3DRenderTarget||e.isWebGLArrayRenderTarget)&&(l?n=e.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),i.bindTexture(n,h.__webglTexture),k(n,r,d),U(c.__webglFramebuffer,e,r,t.COLOR_ATTACHMENT0,n),w(r,d)&&S(n),i.unbindTexture()}e.depthBuffer&&j(e)},this.updateRenderTargetMipmap=function(e){const r=x(e)||l,o=!0===e.isWebGLMultipleRenderTargets?e.texture:[e.texture];for(let s=0,a=o.length;s<a;s++){const a=o[s];
2if(w(a,r)){const r=e.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,o=n.get(a).__webglTexture;i.bindTexture(r,o),S(r),i.unbindTexture()}}},this.updateMultisampleRenderTarget=function(e){if(l&&e.samples>0&&!1===V(e)){const r=e.isWebGLMultipleRenderTargets?e.texture:[e.texture],o=e.width,s=e.height;let a=t.COLOR_BUFFER_BIT;const l=[],c=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,h=n.get(e),u=!0===e.isWebGLMultipleRenderTargets;if(u)for(let e=0;e<r.length;e++)i.bindFramebuffer(t.FRAMEBUFFER,h.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,null),i.bindFramebuffer(t.FRAMEBUFFER,h.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,null,0);i.bindFramebuffer(t.READ_FRAMEBUFFER,h.__webglMultisampledFramebuffer),i.bindFramebuffer(t.DRAW_FRAMEBUFFER,h.__webglFramebuffer);for(let i=0;i<r.length;i++){l.push(t.COLOR_ATTACHMENT0+i),e.depthBuffer&&l.push(c);const p=void 0!==h.__ignoreDepthValues&&h.__ignoreDepthValues;if(!1===p&&(e.depthBuffer&&(a|=t.DEPTH_BUFFER_BIT),e.stencilBuffer&&(a|=t.STENCIL_BUFFER_BIT)),u&&t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,h.__webglColorRenderbuffer[i]),!0===p&&(t.invalidateFramebuffer(t.READ_FRAMEBUFFER,[c]),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[c])),u){const e=n.get(r[i]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0)}t.blitFramebuffer(0,0,o,s,0,0,o,s,a,t.NEAREST),m&&t.invalidateFramebuffer(t.READ_FRAMEBUFFER,l)}if(i.bindFramebuffer(t.READ_FRAMEBUFFER,null),i.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),u)for(let e=0;e<r.length;e++){i.bindFramebuffer(t.FRAMEBUFFER,h.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,h.__webglColorRenderbuffer[e]);const o=n.get(r[e]).__webglTexture;i.bindFramebuffer(t.FRAMEBUFFER,h.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,o,0)}i.bindFramebuffer(t.DRAW_FRAMEBUFFER,h.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=j,this.setupFrameBufferTexture=U,this.useMultisampledRTT=V}function ei(t,e,i){const n=i.isWebGL2;return{convert:function(i,o=r.NoColorSpace){let s;if(i===r.UnsignedByteType)return t.UNSIGNED_BYTE;if(i===r.UnsignedShort4444Type)return t.UNSIGNED_SHORT_4_4_4_4;if(i===r.UnsignedShort5551Type)return t.UNSIGNED_SHORT_5_5_5_1;if(i===r.ByteType)return t.BYTE;if(i===r.ShortType)return t.SHORT;if(i===r.UnsignedShortType)return t.UNSIGNED_SHORT;if(i===r.IntType)return t.INT;if(i===r.UnsignedIntType)return t.UNSIGNED_INT;if(i===r.FloatType)return t.FLOAT;if(i===r.HalfFloatType)return n?t.HALF_FLOAT:(s=e.get("OES_texture_half_float"),null!==s?s.HALF_FLOAT_OES:null);if(i===r.AlphaFormat)return t.ALPHA;if(i===r.RGBAFormat)return t.RGBA;if(i===r.LuminanceFormat)return t.LUMINANCE;if(i===r.LuminanceAlphaFormat)return t.LUMINANCE_ALPHA;if(i===r.DepthFormat)return t.DEPTH_COMPONENT;if(i===r.DepthStencilFormat)return t.DEPTH_STENCIL;if(i===r._SRGBAFormat)return s=e.get("EXT_sRGB"),null!==s?s.SRGB_ALPHA_EXT:null;if(i===r.RedFormat)return t.RED;if(i===r.RedIntegerFormat)return t.RED_INTEGER;if(i===r.RGFormat)return t.RG;if(i===r.RGIntegerFormat)return t.RG_INTEGER;if(i===r.RGBAIntegerFormat)return t.RGBA_INTEGER;if(i===r.RGB_S3TC_DXT1_Format||i===r.RGBA_S3TC_DXT1_Format||i===r.RGBA_S3TC_DXT3_Format||i===r.RGBA_S3TC_DXT5_Format)if(o===r.SRGBColorSpace){if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),null===s)return null;if(i===r.RGB_S3TC_DXT1_Format)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===r.RGBA_S3TC_DXT1_Format)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===r.RGBA_S3TC_DXT3_Format)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===r.RGBA_S3TC_DXT5_Format)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(s=e.get("WEBGL_compressed_texture_s3tc"),null===s)return null;if(i===r.RGB_S3TC_DXT1_Format)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===r.RGBA_S3TC_DXT1_Format)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===r.RGBA_S3TC_DXT3_Format)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===r.RGBA_S3TC_DXT5_Format)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(i===r.RGB_PVRTC_4BPPV1_Format||i===r.RGB_PVRTC_2BPPV1_Format||i===r.RGBA_PVRTC_4BPPV1_Format||i===r.RGBA_PVRTC_2BPPV1_Format){if(s=e.get("WEBGL_compressed_texture_pvrtc"),null===s)return null;if(i===r.RGB_PVRTC_4BPPV1_Format)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===r.RGB_PVRTC_2BPPV1_Format)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===r.RGBA_PVRTC_4BPPV1_Format)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===r.RGBA_PVRTC_2BPPV1_Format)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(i===r.RGB_ETC1_Format)return s=e.get("WEBGL_compressed_texture_etc1"),null!==s?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(i===r.RGB_ETC2_Format||i===r.RGBA_ETC2_EAC_Format){if(s=e.get("WEBGL_compressed_texture_etc"),null===s)return null;if(i===r.RGB_ETC2_Format)return o===r.SRGBColorSpace?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===r.RGBA_ETC2_EAC_Format)return o===r.SRGBColorSpace?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}if(i===r.RGBA_ASTC_4x4_Format||i===r.RGBA_ASTC_5x4_Format||i===r.RGBA_ASTC_5x5_Format||i===r.RGBA_ASTC_6x5_Format||i===r.RGBA_ASTC_6x6_Format||i===r.RGBA_ASTC_8x5_Format||i===r.RGBA_ASTC_8x6_Format||i===r.RGBA_ASTC_8x8_Format||i===r.RGBA_ASTC_10x5_Format||i===r.RGBA_ASTC_10x6_Format||i===r.RGBA_ASTC_10x8_Format||i===r.RGBA_ASTC_10x10_Format||i===r.RGBA_ASTC_12x10_Format||i===r.RGBA_ASTC_12x12_Format){if(s=e.get("WEBGL_compressed_texture_astc"),null===s)return null;if(i===r.RGBA_ASTC_4x4_Format)return o===r.SRGBColorSpace?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===r.RGBA_ASTC_5x4_Format)return o===r.SRGBColorSpace?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===r.RGBA_ASTC_5x5_Format)return o===r.SRGBColorSpace?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===r.RGBA_ASTC_6x5_Format)return o===r.SRGBColorSpace?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===r.RGBA_ASTC_6x6_Format)return o===r.SRGBColorSpace?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===r.RGBA_ASTC_8x5_Format)return o===r.SRGBColorSpace?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===r.RGBA_ASTC_8x6_Format)return o===r.SRGBColorSpace?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===r.RGBA_ASTC_8x8_Format)return o===r.SRGBColorSpace?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===r.RGBA_ASTC_10x5_Format)return o===r.SRGBColorSpace?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===r.RGBA_ASTC_10x6_Format)return o===r.SRGBColorSpace?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===r.RGBA_ASTC_10x8_Format)return o===r.SRGBColorSpace?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===r.RGBA_ASTC_10x10_Format)return o===r.SRGBColorSpace?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===r.RGBA_ASTC_12x10_Format)return o===r.SRGBColorSpace?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===r.RGBA_ASTC_12x12_Format)return o===r.SRGBColorSpace?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}if(i===r.RGBA_BPTC_Format){if(s=e.get("EXT_texture_compression_bptc"),null===s)return null;if(i===r.RGBA_BPTC_Format)return o===r.SRGBColorSpace?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT}
2if(i===r.RED_RGTC1_Format||i===r.SIGNED_RED_RGTC1_Format||i===r.RED_GREEN_RGTC2_Format||i===r.SIGNED_RED_GREEN_RGTC2_Format){if(s=e.get("EXT_texture_compression_rgtc"),null===s)return null;if(i===r.RGBA_BPTC_Format)return s.COMPRESSED_RED_RGTC1_EXT;if(i===r.SIGNED_RED_RGTC1_Format)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===r.RED_GREEN_RGTC2_Format)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===r.SIGNED_RED_GREEN_RGTC2_Format)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return i===r.UnsignedInt248Type?n?t.UNSIGNED_INT_24_8:(s=e.get("WEBGL_depth_texture"),null!==s?s.UNSIGNED_INT_24_8_WEBGL:null):void 0!==t[i]?t[i]:null}}}class ii extends P.PerspectiveCamera{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}var ri=i(2356);class ni extends C.Object3D{constructor(){super(),this.isGroup=!0,this.type="Group"}}const oi={type:"move"};class si{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new ni,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 ni,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new s.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new s.Vector3),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new ni,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new s.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new s.Vector3),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const i of t.hand.values())this._getHandJoint(e,i)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,i){let r=null,n=null,o=null;const s=this._targetRay,a=this._grip,l=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState){if(l&&t.hand){o=!0;for(const r of t.hand.values()){const t=e.getJointPose(r,i),n=this._getHandJoint(l,r);null!==t&&(n.matrix.fromArray(t.transform.matrix),n.matrix.decompose(n.position,n.rotation,n.scale),n.jointRadius=t.radius),n.visible=null!==t}const r=l.joints["index-finger-tip"],n=l.joints["thumb-tip"],s=r.position.distanceTo(n.position),a=.02,c=.005;l.inputState.pinching&&s>a+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&s<=a-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==a&&t.gripSpace&&(n=e.getPose(t.gripSpace,i),null!==n&&(a.matrix.fromArray(n.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),n.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(n.linearVelocity)):a.hasLinearVelocity=!1,n.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(n.angularVelocity)):a.hasAngularVelocity=!1));null!==s&&(r=e.getPose(t.targetRaySpace,i),null===r&&null!==n&&(r=n),null!==r&&(s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),r.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(r.linearVelocity)):s.hasLinearVelocity=!1,r.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(r.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(oi)))}return null!==s&&(s.visible=null!==r),null!==a&&(a.visible=null!==n),null!==l&&(l.visible=null!==o),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const i=new ni;i.matrixAutoUpdate=!1,i.visible=!1,t.joints[e.jointName]=i,t.add(i)}return t.joints[e.jointName]}}class ai extends et.Texture{constructor(t,e,i,n,o,s,a,l,c,h){if((h=void 0!==h?h:r.DepthFormat)!==r.DepthFormat&&h!==r.DepthStencilFormat)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&h===r.DepthFormat&&(i=r.UnsignedIntType),void 0===i&&h===r.DepthStencilFormat&&(i=r.UnsignedInt248Type),super(null,n,o,s,a,l,h,i,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==a?a:r.NearestFilter,this.minFilter=void 0!==l?l:r.NearestFilter,this.flipY=!1,this.generateMipmaps=!1}}class li extends ri.EventDispatcher{constructor(t,e){super();const i=this;let n=null,o=1,c=null,h="local-floor",u=1,p=null,d=null,m=null,f=null,g=null,y=null;const v=e.getContextAttributes();let _=null,b=null;const x=[],w=[],S=new Set,T=new Map,E=new P.PerspectiveCamera;E.layers.enable(1),E.viewport=new a.Vector4;const M=new P.PerspectiveCamera;M.layers.enable(2),M.viewport=new a.Vector4;const C=[E,M],L=new ii;L.layers.enable(1),L.layers.enable(2);let R=null,I=null;function O(t){const e=w.indexOf(t.inputSource);if(-1===e)return;const i=x[e];void 0!==i&&i.dispatchEvent({type:t.type,data:t.inputSource})}function D(){n.removeEventListener("select",O),n.removeEventListener("selectstart",O),n.removeEventListener("selectend",O),n.removeEventListener("squeeze",O),n.removeEventListener("squeezestart",O),n.removeEventListener("squeezeend",O),n.removeEventListener("end",D),n.removeEventListener("inputsourceschange",k);for(let t=0;t<x.length;t++){const e=w[t];null!==e&&(w[t]=null,x[t].disconnect(e))}R=null,I=null,t.setRenderTarget(_),g=null,f=null,m=null,n=null,b=null,j.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function k(t){for(let e=0;e<t.removed.length;e++){const i=t.removed[e],r=w.indexOf(i);r>=0&&(w[r]=null,x[r].disconnect(i))}for(let e=0;e<t.added.length;e++){const i=t.added[e];let r=w.indexOf(i);if(-1===r){for(let t=0;t<x.length;t++){if(t>=w.length){w.push(i),r=t;break}if(null===w[t]){w[t]=i,r=t;break}}if(-1===r)break}const n=x[r];n&&n.connect(i)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=x[t];return void 0===e&&(e=new si,x[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=x[t];return void 0===e&&(e=new si,x[t]=e),e.getGripSpace()},this.getHand=function(t){let e=x[t];return void 0===e&&(e=new si,x[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){o=t,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){h=t,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return p||c},this.setReferenceSpace=function(t){p=t},this.getBaseLayer=function(){return null!==f?f:g},this.getBinding=function(){return m},this.getFrame=function(){return y}
2,this.getSession=function(){return n},this.setSession=async function(s){if(n=s,null!==n){if(_=t.getRenderTarget(),n.addEventListener("select",O),n.addEventListener("selectstart",O),n.addEventListener("selectend",O),n.addEventListener("squeeze",O),n.addEventListener("squeezestart",O),n.addEventListener("squeezeend",O),n.addEventListener("end",D),n.addEventListener("inputsourceschange",k),!0!==v.xrCompatible&&await e.makeXRCompatible(),void 0===n.renderState.layers||!1===t.capabilities.isWebGL2){const i={antialias:void 0!==n.renderState.layers||v.antialias,alpha:!0,depth:v.depth,stencil:v.stencil,framebufferScaleFactor:o};g=new XRWebGLLayer(n,e,i),n.updateRenderState({baseLayer:g}),b=new A.WebGLRenderTarget(g.framebufferWidth,g.framebufferHeight,{format:r.RGBAFormat,type:r.UnsignedByteType,colorSpace:t.outputColorSpace,stencilBuffer:v.stencil})}else{let i=null,s=null,a=null;v.depth&&(a=v.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,i=v.stencil?r.DepthStencilFormat:r.DepthFormat,s=v.stencil?r.UnsignedInt248Type:r.UnsignedIntType);const l={colorFormat:e.RGBA8,depthFormat:a,scaleFactor:o};m=new XRWebGLBinding(n,e),f=m.createProjectionLayer(l),n.updateRenderState({layers:[f]}),b=new A.WebGLRenderTarget(f.textureWidth,f.textureHeight,{format:r.RGBAFormat,type:r.UnsignedByteType,depthTexture:new ai(f.textureWidth,f.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,i),stencilBuffer:v.stencil,colorSpace:t.outputColorSpace,samples:v.antialias?4:0}),t.properties.get(b).__ignoreDepthValues=f.ignoreDepthValues}b.isXRRenderTarget=!0,this.setFoveation(u),p=null,c=await n.requestReferenceSpace(h),j.setContext(n),j.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==n)return n.environmentBlendMode};const N=new s.Vector3,F=new s.Vector3;function U(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCamera=function(t){if(null===n)return;L.near=M.near=E.near=t.near,L.far=M.far=E.far=t.far,R===L.near&&I===L.far||(n.updateRenderState({depthNear:L.near,depthFar:L.far}),R=L.near,I=L.far);const e=t.parent,i=L.cameras;U(L,e);for(let t=0;t<i.length;t++)U(i[t],e);2===i.length?function(t,e,i){N.setFromMatrixPosition(e.matrixWorld),F.setFromMatrixPosition(i.matrixWorld);const r=N.distanceTo(F),n=e.projectionMatrix.elements,o=i.projectionMatrix.elements,s=n[14]/(n[10]-1),a=n[14]/(n[10]+1),l=(n[9]+1)/n[5],c=(n[9]-1)/n[5],h=(n[8]-1)/n[0],u=(o[8]+1)/o[0],p=s*h,d=s*u,m=r/(-h+u),f=m*-h;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(f),t.translateZ(m),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert();const g=s+m,y=a+m,v=p-f,_=d+(r-f),b=l*a/y*g,x=c*a/y*g;t.projectionMatrix.makePerspective(v,_,b,x,g,y),t.projectionMatrixInverse.copy(t.projectionMatrix).invert()}(L,E,M):L.projectionMatrix.copy(E.projectionMatrix),function(t,e,i){null===i?t.matrix.copy(e.matrixWorld):(t.matrix.copy(i.matrixWorld),t.matrix.invert(),t.matrix.multiply(e.matrixWorld)),t.matrix.decompose(t.position,t.quaternion,t.scale),t.updateMatrixWorld(!0);const r=t.children;for(let t=0,e=r.length;t<e;t++)r[t].updateMatrixWorld(!0);t.projectionMatrix.copy(e.projectionMatrix),t.projectionMatrixInverse.copy(e.projectionMatrixInverse),t.isPerspectiveCamera&&(t.fov=2*Je.RAD2DEG*Math.atan(1/t.projectionMatrix.elements[5]),t.zoom=1)}(t,L,e)},this.getCamera=function(){return L},this.getFoveation=function(){if(null!==f||null!==g)return u},this.setFoveation=function(t){u=t,null!==f&&(f.fixedFoveation=t),null!==g&&void 0!==g.fixedFoveation&&(g.fixedFoveation=t)},this.getPlanes=function(){return S};let z=null;const j=new l;j.setAnimationLoop(function(e,r){if(d=r.getViewerPose(p||c),y=r,null!==d){const e=d.views;null!==g&&(t.setRenderTargetFramebuffer(b,g.framebuffer),t.setRenderTarget(b));let i=!1;e.length!==L.cameras.length&&(L.cameras.length=0,i=!0);for(let r=0;r<e.length;r++){const n=e[r];let o=null;if(null!==g)o=g.getViewport(n);else{const e=m.getViewSubImage(f,n);o=e.viewport,0===r&&(t.setRenderTargetTextures(b,e.colorTexture,f.ignoreDepthValues?void 0:e.depthStencilTexture),t.setRenderTarget(b))}let s=C[r];void 0===s&&(s=new P.PerspectiveCamera,s.layers.enable(r),s.viewport=new a.Vector4,C[r]=s),s.matrix.fromArray(n.transform.matrix),s.matrix.decompose(s.position,s.quaternion,s.scale),s.projectionMatrix.fromArray(n.projectionMatrix),s.projectionMatrixInverse.copy(s.projectionMatrix).invert(),s.viewport.set(o.x,o.y,o.width,o.height),0===r&&(L.matrix.copy(s.matrix
2),L.matrix.decompose(L.position,L.quaternion,L.scale)),!0===i&&L.cameras.push(s)}}for(let t=0;t<x.length;t++){const e=w[t],i=x[t];null!==e&&void 0!==i&&i.update(e,r,p||c)}if(z&&z(e,r),r.detectedPlanes){i.dispatchEvent({type:"planesdetected",data:r.detectedPlanes});let t=null;for(const e of S)r.detectedPlanes.has(e)||(null===t&&(t=[]),t.push(e));if(null!==t)for(const e of t)S.delete(e),T.delete(e),i.dispatchEvent({type:"planeremoved",data:e});for(const t of r.detectedPlanes)if(S.has(t)){const e=T.get(t);t.lastChangedTime>e&&(T.set(t,t.lastChangedTime),i.dispatchEvent({type:"planechanged",data:t}))}else S.add(t),T.set(t,r.lastChangedTime),i.dispatchEvent({type:"planeadded",data:t})}y=null}),this.setAnimationLoop=function(t){z=t},this.dispose=function(){}}}function ci(t,e){function i(t,e){!0===t.matrixAutoUpdate&&t.updateMatrix(),e.value.copy(t.matrix)}function n(n,o){n.opacity.value=o.opacity,o.color&&n.diffuse.value.copy(o.color),o.emissive&&n.emissive.value.copy(o.emissive).multiplyScalar(o.emissiveIntensity),o.map&&(n.map.value=o.map,i(o.map,n.mapTransform)),o.alphaMap&&(n.alphaMap.value=o.alphaMap,i(o.alphaMap,n.alphaMapTransform)),o.bumpMap&&(n.bumpMap.value=o.bumpMap,i(o.bumpMap,n.bumpMapTransform),n.bumpScale.value=o.bumpScale,o.side===r.BackSide&&(n.bumpScale.value*=-1)),o.normalMap&&(n.normalMap.value=o.normalMap,i(o.normalMap,n.normalMapTransform),n.normalScale.value.copy(o.normalScale),o.side===r.BackSide&&n.normalScale.value.negate()),o.displacementMap&&(n.displacementMap.value=o.displacementMap,i(o.displacementMap,n.displacementMapTransform),n.displacementScale.value=o.displacementScale,n.displacementBias.value=o.displacementBias),o.emissiveMap&&(n.emissiveMap.value=o.emissiveMap,i(o.emissiveMap,n.emissiveMapTransform)),o.specularMap&&(n.specularMap.value=o.specularMap,i(o.specularMap,n.specularMapTransform)),o.alphaTest>0&&(n.alphaTest.value=o.alphaTest);const s=e.get(o).envMap;if(s&&(n.envMap.value=s,n.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,n.reflectivity.value=o.reflectivity,n.ior.value=o.ior,n.refractionRatio.value=o.refractionRatio),o.lightMap){n.lightMap.value=o.lightMap;const e=!0===t.useLegacyLights?Math.PI:1;n.lightMapIntensity.value=o.lightMapIntensity*e,i(o.lightMap,n.lightMapTransform)}o.aoMap&&(n.aoMap.value=o.aoMap,n.aoMapIntensity.value=o.aoMapIntensity,i(o.aoMap,n.aoMapTransform))}return{refreshFogUniforms:function(e,i){i.color.getRGB(e.fogColor.value,(0,v.getUnlitUniformColorSpace)(t)),i.isFog?(e.fogNear.value=i.near,e.fogFar.value=i.far):i.isFogExp2&&(e.fogDensity.value=i.density)},refreshMaterialUniforms:function(t,o,s,a,l){o.isMeshBasicMaterial||o.isMeshLambertMaterial?n(t,o):o.isMeshToonMaterial?(n(t,o),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,o)):o.isMeshPhongMaterial?(n(t,o),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,o)):o.isMeshStandardMaterial?(n(t,o),function(t,r){t.metalness.value=r.metalness,r.metalnessMap&&(t.metalnessMap.value=r.metalnessMap,i(r.metalnessMap,t.metalnessMapTransform)),t.roughness.value=r.roughness,r.roughnessMap&&(t.roughnessMap.value=r.roughnessMap,i(r.roughnessMap,t.roughnessMapTransform)),e.get(r).envMap&&(t.envMapIntensity.value=r.envMapIntensity)}(t,o),o.isMeshPhysicalMaterial&&function(t,e,n){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap,i(e.sheenColorMap,t.sheenColorMapTransform)),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap,i(e.sheenRoughnessMap,t.sheenRoughnessMapTransform))),e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap,i(e.clearcoatMap,t.clearcoatMapTransform)),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap,i(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)),e.clearcoatNormalMap&&(t.clearcoatNormalMap.value=e.clearcoatNormalMap,i(e.clearcoatNormalMap,t.clearcoatNormalMapTransform),t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),e.side===r.BackSide&&t.clearcoatNormalScale.value.negate())),e.iridescence>0&&(t.iridescence.value=e.iridescence,t.iridescenceIOR.value=e.iridescenceIOR,t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0],t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1],e.iridescenceMap&&(t.iridescenceMap.value=e.iridescenceMap,i(e.iridescenceMap,t.iridescenceMapTransform)),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap,i(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform))),e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=n.texture,t.transmissionSamplerSize.value.set(n.width,n.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap,i(e.transmissionMap,t.transmissionMapTransform)),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap,i(e.thicknessMap,t.thicknessMapTransform)),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor)),t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap,i(e.specularColorMap,t.specularColorMapTransform)),e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap,i(e.specularIntensityMap,t.specularIntensityMapTransform))}
vendor: 1,202 bytes, line 2
2(t,o,l)):o.isMeshMatcapMaterial?(n(t,o),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,o)):o.isMeshDepthMaterial?n(t,o):o.isMeshDistanceMaterial?(n(t,o),function(t,i){const r=e.get(i).light;t.referencePosition.value.setFromMatrixPosition(r.matrixWorld),t.nearDistance.value=r.shadow.camera.near,t.farDistance.value=r.shadow.camera.far}(t,o)):o.isMeshNormalMaterial?n(t,o):o.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,e.map&&(t.map.value=e.map,i(e.map,t.mapTransform))}(t,o),o.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,o)):o.isPointsMaterial?function(t,e,r,n){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*r,t.scale.value=.5*n,e.map&&(t.map.value=e.map,i(e.map,t.uvTransform)),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,o,s,a):o.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map,i(e.map,t.mapTransform)),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}
2(t,o):o.isShadowMaterial?(t.color.value.copy(o.color),t.opacity.value=o.opacity):o.isShaderMaterial&&(o.uniformsNeedUpdate=!1)}}}function hi(t,e,i,r){let n={},o={},s=[];const a=i.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(t,e,i){const r=t.value;if(void 0===i[e]){if("number"==typeof r)i[e]=r;else{const t=Array.isArray(r)?r:[r],n=[];for(let e=0;e<t.length;e++)n.push(t[e].clone());i[e]=n}return!0}if("number"==typeof r){if(i[e]!==r)return i[e]=r,!0}else{const t=Array.isArray(i[e])?i[e]:[i[e]],n=Array.isArray(r)?r:[r];for(let e=0;e<t.length;e++){const i=t[e];if(!1===i.equals(n[e]))return i.copy(n[e]),!0}}return!1}function c(t){const e={boundary:0,storage:0};return"number"==typeof t?(e.boundary=4,e.storage=4):t.isVector2?(e.boundary=8,e.storage=8):t.isVector3||t.isColor?(e.boundary=16,e.storage=12):t.isVector4?(e.boundary=16,e.storage=16):t.isMatrix3?(e.boundary=48,e.storage=48):t.isMatrix4?(e.boundary=64,e.storage=64):t.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",t),e}function h(e){const i=e.target;i.removeEventListener("dispose",h);const r=s.indexOf(i.__bindingPointIndex);s.splice(r,1),t.deleteBuffer(n[i.id]),delete n[i.id],delete o[i.id]}return{bind:function(t,e){const i=e.program;r.uniformBlockBinding(t,i)},update:function(i,u){let p=n[i.id];void 0===p&&(function(t){const e=t.uniforms;let i=0,r=0;for(let t=0,n=e.length;t<n;t++){const n=e[t],o={boundary:0,storage:0},s=Array.isArray(n.value)?n.value:[n.value];for(let t=0,e=s.length;t<e;t++){const e=c(s[t]);o.boundary+=e.boundary,o.storage+=e.storage}n.__data=new Float32Array(o.storage/Float32Array.BYTES_PER_ELEMENT),n.__offset=i,t>0&&(r=i%16,0!==r&&16-r-o.boundary<0&&(i+=16-r,n.__offset=i)),i+=o.storage}r=i%16,r>0&&(i+=16-r),t.__size=i,t.__cache={}}(i),p=function(e){const i=function(){for(let t=0;t<a;t++)if(-1===s.indexOf(t))return s.push(t),t;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();e.__bindingPointIndex=i;const r=t.createBuffer(),n=e.__size,o=e.usage;return t.bindBuffer(t.UNIFORM_BUFFER,r),t.bufferData(t.UNIFORM_BUFFER,n,o),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,i,r),r}(i),n[i.id]=p,i.addEventListener("dispose",h));const d=u.program;r.updateUBOMapping(i,d);const m=e.render.frame;o[i.id]!==m&&(function(e){const i=n[e.id],r=e.uniforms,o=e.__cache;t.bindBuffer(t.UNIFORM_BUFFER,i);for(let e=0,i=r.length;e<i;e++){const i=r[e];if(!0===l(i,e,o)){const e=i.__offset,r=Array.isArray(i.value)?i.value:[i.value];let n=0;for(let o=0;o<r.length;o++){const s=r[o],a=c(s);"number"==typeof s?(i.__data[0]=s,t.bufferSubData(t.UNIFORM_BUFFER,e+n,i.__data)):s.isMatrix3?(i.__data[0]=s.elements[0],i.__data[1]=s.elements[1],i.__data[2]=s.elements[2],i.__data[3]=s.elements[0],i.__data[4]=s.elements[3],i.__data[5]=s.elements[4],i.__data[6]=s.elements[5],i.__data[7]=s.elements[0],i.__data[8]=s.elements[6],i.__data[9]=s.elements[7],i.__data[10]=s.elements[8],i.__data[11]=s.elements[0]):(s.toArray(i.__data,n),n+=a.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(t.UNIFORM_BUFFER,e,i.__data)}}t.bindBuffer(t.UNIFORM_BUFFER,null)}(i),o[i.id]=m)},dispose:function(){for(const e in n)t.deleteBuffer(n[e]);s=[],n={},o={}}}}function ui(){const t=(0,O.c)("canvas");return t.style.display="block",t}class pi{constructor(t={}){const{canvas:e=ui(),context:i=null,depth:h=!0,stencil:u=!0,alpha:p=!1,antialias:d=!1,premultipliedAlpha:m=!0,preserveDrawingBuffer:f=!1,powerPreference:g="default",failIfMajorPerformanceCaveat:y=!1}=t;let v;this.isWebGLRenderer=!0,v=null!==i?i.getContextAttributes().alpha:p;let _=null,T=null;const E=[],C=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputColorSpace=r.SRGBColorSpace,this.useLegacyLights=!0,this.toneMapping=r.NoToneMapping,this.toneMappingExposure=1;const P=this;let L=!1,R=0,I=0,O=null,D=-1,N=null;const F=new a.Vector4,U=new a.Vector4;let z=null,j=e.width,B=e.height,V=1,G=null,H=null;const q=new a.Vector4(0,0,j,B),W=new a.Vector4(0,0,j,B);let X=!1;const Y=new n.Frustum;let K=!1,et=!1,it=null;const rt=new o.Matrix4,nt=new s.Vector3,ot={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function lt(){return null===O?V:1}let ct,ht,ut,pt,dt,mt,ft,gt,yt,vt,_t,bt,xt,wt,St,Tt,Et,Mt,At,Ct,Pt,Lt,Rt,It,Ot=i;function Dt(t,i){for(let r=0;r<t.length;r++){const n=t[r],o=e.getContext(n,i);if(null!==o)return o}return null}try{const t={alpha:!0,depth:h,stencil:u,antialias:d,premultipliedAlpha:m,preserveDrawingBuffer:f,powerPreference:g,failIfMajorPerformanceCaveat:y};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${r.REVISION}`),e.addEventListener("webglcontextlost",Ft,!1),e.addEventListener("webglcontextrestored",Ut,!1),e.addEventListener("webglcontextcreationerror",zt,!1),null===Ot){const e=["webgl2","webgl","experimental-webgl"];if(!0===P.isWebGL1Renderer&&e.shift(),Ot=Dt(e,t),null===Ot)throw Dt(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===Ot.getShaderPrecisionFormat&&(Ot.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}
vendor: 4,742 bytes, line 2
2function kt(){ct=new $(Ot),ht=new S(Ot,ct,t),ct.init(ht),Lt=new ei(Ot,ct,ht),ut=new $e(Ot,ct,ht),pt=new tt(Ot),dt=new ke,mt=new ti(Ot,ct,ut,dt,ht,Lt,pt),ft=new k(P),gt=new Z(P),yt=new c(Ot,ht),Rt=new x(Ot,ct,yt,ht),vt=new J(Ot,yt,pt,Rt),_t=new at(Ot,vt,yt,pt),At=new st(Ot,ht,mt),Tt=new M(dt),bt=new De(P,ft,gt,ct,ht,Rt,Tt),xt=new ci(P,dt),wt=new ze,St=new We(ct,ht),Mt=new b(P,ft,gt,ut,_t,v,m),Et=new Ze(P,_t,ht),It=new hi(Ot,pt,ht,ut),Ct=new w(Ot,ct,pt,ht),Pt=new Q(Ot,ct,pt,ht),pt.programs=bt.programs,P.capabilities=ht,P.extensions=ct,P.properties=dt,P.renderLists=wt,P.shadowMap=Et,P.state=ut,P.info=pt}kt();const Nt=new li(P,Ot);function Ft(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),L=!0}function Ut(){console.log("THREE.WebGLRenderer: Context Restored."),L=!1;const t=pt.autoReset,e=Et.enabled,i=Et.autoUpdate,r=Et.needsUpdate,n=Et.type;kt(),pt.autoReset=t,Et.enabled=e,Et.autoUpdate=i,Et.needsUpdate=r,Et.type=n}function zt(t){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",t.statusMessage)}function jt(t){const e=t.target;e.removeEventListener("dispose",jt),function(t){(function(t){const e=dt.get(t).programs;void 0!==e&&(e.forEach(function(t){bt.releaseProgram(t)}),t.isShaderMaterial&&bt.releaseShaderCache(t))})(t),dt.remove(t)}(e)}this.xr=Nt,this.getContext=function(){return Ot},this.getContextAttributes=function(){return Ot.getContextAttributes()},this.forceContextLoss=function(){const t=ct.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=ct.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return V},this.setPixelRatio=function(t){void 0!==t&&(V=t,this.setSize(j,B,!1))},this.getSize=function(t){return t.set(j,B)},this.setSize=function(t,i,r=!0){Nt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(j=t,B=i,e.width=Math.floor(t*V),e.height=Math.floor(i*V),!0===r&&(e.style.width=t+"px",e.style.height=i+"px"),this.setViewport(0,0,t,i))},this.getDrawingBufferSize=function(t){return t.set(j*V,B*V).floor()},this.setDrawingBufferSize=function(t,i,r){j=t,B=i,V=r,e.width=Math.floor(t*r),e.height=Math.floor(i*r),this.setViewport(0,0,t,i)},this.getCurrentViewport=function(t){return t.copy(F)},this.getViewport=function(t){return t.copy(q)},this.setViewport=function(t,e,i,r){t.isVector4?q.set(t.x,t.y,t.z,t.w):q.set(t,e,i,r),ut.viewport(F.copy(q).multiplyScalar(V).floor())},this.getScissor=function(t){return t.copy(W)},this.setScissor=function(t,e,i,r){t.isVector4?W.set(t.x,t.y,t.z,t.w):W.set(t,e,i,r),ut.scissor(U.copy(W).multiplyScalar(V).floor())},this.getScissorTest=function(){return X},this.setScissorTest=function(t){ut.setScissorTest(X=t)},this.setOpaqueSort=function(t){G=t},this.setTransparentSort=function(t){H=t},this.getClearColor=function(t){return t.copy(Mt.getClearColor())},this.setClearColor=function(){Mt.setClearColor.apply(Mt,arguments)},this.getClearAlpha=function(){return Mt.getClearAlpha()},this.setClearAlpha=function(){Mt.setClearAlpha.apply(Mt,arguments)},this.clear=function(t=!0,e=!0,i=!0){let r=0;t&&(r|=Ot.COLOR_BUFFER_BIT),e&&(r|=Ot.DEPTH_BUFFER_BIT),i&&(r|=Ot.STENCIL_BUFFER_BIT),Ot.clear(r)},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(){e.removeEventListener("webglcontextlost",Ft,!1),e.removeEventListener("webglcontextrestored",Ut,!1),e.removeEventListener("webglcontextcreationerror",zt,!1),wt.dispose(),St.dispose(),dt.dispose(),ft.dispose(),gt.dispose(),_t.dispose(),Rt.dispose(),It.dispose(),bt.dispose(),Nt.dispose(),Nt.removeEventListener("sessionstart",Vt),Nt.removeEventListener("sessionend",Gt),it&&(it.dispose(),it=null),Ht.stop()},this.renderBufferDirect=function(t,e,i,n,o,s){null===e&&(e=ot);const a=o.isMesh&&o.matrixWorld.determinant()<0,l=function(t,e,i,n,o){!0!==e.isScene&&(e=ot),mt.resetTextureUnits();const s=e.fog,a=n.isMeshStandardMaterial?e.environment:null,l=null===O?P.outputColorSpace:!0===O.isXRRenderTarget?O.texture.colorSpace:r.LinearSRGBColorSpace,c=(n.isMeshStandardMaterial?gt:ft).get(n.envMap||a),h=!0===n.vertexColors&&!!i.attributes.color&&4===i.attributes.color.itemSize,u=!!n.normalMap&&!!i.attributes.tangent,p=!!i.morphAttributes.position,d=!!i.morphAttributes.normal,m=!!i.morphAttributes.color,f=n.toneMapped?P.toneMapping:r.NoToneMapping,g=i.morphAttributes.position||i.morphAttributes.normal||i.morphAttributes.color,y=void 0!==g?g.length:0,v=dt.get(n),_=T.state.lights;if(!0===K&&(!0===et||t!==N)){const e=t===N&&n.id===D;Tt.setState(n,t,e)}let b=!1;n.version===v.__version?v.needsLights&&v.lightsStateVersion!==_.state.ver
2sion||v.outputColorSpace!==l||o.isInstancedMesh&&!1===v.instancing?b=!0:o.isInstancedMesh||!0!==v.instancing?o.isSkinnedMesh&&!1===v.skinning?b=!0:o.isSkinnedMesh||!0!==v.skinning?v.envMap!==c||!0===n.fog&&v.fog!==s?b=!0:void 0===v.numClippingPlanes||v.numClippingPlanes===Tt.numPlanes&&v.numIntersection===Tt.numIntersection?(v.vertexAlphas!==h||v.vertexTangents!==u||v.morphTargets!==p||v.morphNormals!==d||v.morphColors!==m||v.toneMapping!==f||!0===ht.isWebGL2&&v.morphTargetsCount!==y)&&(b=!0):b=!0:b=!0:b=!0:(b=!0,v.__version=n.version);let x=v.currentProgram;!0===b&&(x=Kt(n,e,o));let w=!1,S=!1,E=!1;const M=x.getUniforms(),A=v.uniforms;if(ut.useProgram(x.program)&&(w=!0,S=!0,E=!0),n.id!==D&&(D=n.id,S=!0),w||N!==t){if(M.setValue(Ot,"projectionMatrix",t.projectionMatrix),ht.logarithmicDepthBuffer&&M.setValue(Ot,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),N!==t&&(N=t,S=!0,E=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){const e=M.map.cameraPosition;void 0!==e&&e.setValue(Ot,nt.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&M.setValue(Ot,"isOrthographic",!0===t.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.isShadowMaterial||o.isSkinnedMesh)&&M.setValue(Ot,"viewMatrix",t.matrixWorldInverse)}if(o.isSkinnedMesh){M.setOptional(Ot,o,"bindMatrix"),M.setOptional(Ot,o,"bindMatrixInverse");const t=o.skeleton;t&&(ht.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),M.setValue(Ot,"boneTexture",t.boneTexture,mt),M.setValue(Ot,"boneTextureSize",t.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const C=i.morphAttributes;var L,R;if((void 0!==C.position||void 0!==C.normal||void 0!==C.color&&!0===ht.isWebGL2)&&At.update(o,i,x),(S||v.receiveShadow!==o.receiveShadow)&&(v.receiveShadow=o.receiveShadow,M.setValue(Ot,"receiveShadow",o.receiveShadow)),n.isMeshGouraudMaterial&&null!==n.envMap&&(A.envMap.value=c,A.flipEnvMap.value=c.isCubeTexture&&!1===c.isRenderTargetTexture?-1:1),S&&(M.setValue(Ot,"toneMappingExposure",P.toneMappingExposure),v.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),s&&!0===n.fog&&xt.refreshFogUniforms(A,s),xt.refreshMaterialUniforms(A,n,V,B,it),de.upload(Ot,v.uniformsList,A,mt)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(de.upload(Ot,v.uniformsList,A,mt),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&M.setValue(Ot,"center",o.center),M.setValue(Ot,"modelViewMatrix",o.modelViewMatrix),M.setValue(Ot,"normalMatrix",o.normalMatrix),M.setValue(Ot,"modelMatrix",o.matrixWorld),n.isShaderMaterial||n.isRawShaderMaterial){const t=n.uniformsGroups;for(let e=0,i=t.length;e<i;e++)if(ht.isWebGL2){const i=t[e];It.update(i,x),It.bind(i,x)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return x}(t,e,i,n,o);ut.setMaterial(n,a);let c=i.index,h=1;!0===n.wireframe&&(c=vt.getWireframeAttribute(i),h=2);const u=i.drawRange,p=i.attributes.position;let d=u.start*h,m=(u.start+u.count)*h;null!==s&&(d=Math.max(d,s.start*h),m=Math.min(m,(s.start+s.count)*h)),null!==c?(d=Math.max(d,0),m=Math.min(m,c.count)):null!=p&&(d=Math.max(d,0),m=Math.min(m,p.count));const f=m-d;if(f<0||f===1/0)return;let g;Rt.setup(o,n,l,i,c);let y=Ct;if(null!==c&&(g=yt.get(c),y=Pt,y.setIndex(g)),o.isMesh)!0===n.wireframe?(ut.setLineWidth(n.wireframeLinewidth*lt()),y.setMode(Ot.LINES)):y.setMode(Ot.TRIANGLES);else if(o.isLine){let t=n.linewidth;void 0===t&&(t=1),ut.setLineWidth(t*lt()),o.isLineSegments?y.setMode(Ot.LINES):o.isLine
2Loop?y.setMode(Ot.LINE_LOOP):y.setMode(Ot.LINE_STRIP)}else o.isPoints?y.setMode(Ot.POINTS):o.isSprite&&y.setMode(Ot.TRIANGLES);if(o.isInstancedMesh)y.renderInstances(d,f,o.count);else if(i.isInstancedBufferGeometry){const t=void 0!==i._maxInstanceCount?i._maxInstanceCount:1/0,e=Math.min(i.instanceCount,t);y.renderInstances(d,f,e)}else y.render(d,f)},this.compile=function(t,e){function i(t,e,i){!0===t.transparent&&t.side===r.DoubleSide&&!1===t.forceSinglePass?(t.side=r.BackSide,t.needsUpdate=!0,Kt(t,e,i),t.side=r.FrontSide,t.needsUpdate=!0,Kt(t,e,i),t.side=r.DoubleSide):Kt(t,e,i)}T=St.get(t),T.init(),C.push(T),t.traverseVisible(function(t){t.isLight&&t.layers.test(e.layers)&&(T.pushLight(t),t.castShadow&&T.pushShadow(t))}),T.setupLights(P.useLegacyLights),t.traverse(function(e){const r=e.material;if(r)if(Array.isArray(r))for(let n=0;n<r.length;n++)i(r[n],t,e);else i(r,t,e)}),C.pop(),T=null};let Bt=null;function Vt(){Ht.stop()}function Gt(){Ht.start()}const Ht=new l;function qt(t,e,i,r){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)i=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)T.pushLight(t),t.castShadow&&T.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||Y.intersectsSprite(t)){r&&nt.setFromMatrixPosition(t.matrixWorld).applyMatrix4(rt);const e=_t.update(t),n=t.material;n.visible&&_.push(t,e,n,i,nt.z,null)}}else if((t.isMesh||t.isLine||t.isPoints)&&(!t.frustumCulled||Y.intersectsObject(t))){t.isSkinnedMesh&&t.skeleton.frame!==pt.render.frame&&(t.skeleton.update(),t.skeleton.frame=pt.render.frame);const e=_t.update(t),n=t.material;if(r&&(null===e.boundingSphere&&e.computeBoundingSphere(),nt.copy(e.boundingSphere.center).applyMatrix4(t.matrixWorld).applyMatrix4(rt)),Array.isArray(n)){const r=e.groups;for(let o=0,s=r.length;o<s;o++){const s=r[o],a=n[s.materialIndex];a&&a.visible&&_.push(t,e,a,i,nt.z,s)}}else n.visible&&_.push(t,e,n,i,nt.z,null)}const n=t.children;for(let t=0,o=n.length;t<o;t++)qt(n[t],e,i,r)}function Wt(t,e,i,n){const o=t.opaque,s=t.transmissive,a=t.transparent;T.setupLightsView(i),!0===K&&Tt.setGlobalState(P.clippingPlanes,i),s.length>0&&function(t,e,i,n){if(null===it){const t=ht.isWebGL2;it=new A.WebGLRenderTarget(1024,1024,{generateMipmaps:!0,type:ct.has("EXT_color_buffer_half_float")?r.HalfFloatType:r.UnsignedByteType,minFilter:r.LinearMipmapLinearFilter,samples:t&&!0===d?4:0})}const o=P.getRenderTarget();P.setRenderTarget(it),P.clear();const s=P.toneMapping;P.toneMapping=r.NoToneMapping,Xt(t,i,n),mt.updateMultisampleRenderTarget(it),mt.updateRenderTargetMipmap(it);let a=!1;for(let t=0,o=e.length;t<o;t++){const o=e[t],s=o.object,l=o.geometry,c=o.material,h=o.group;if(c.side===r.DoubleSide&&s.layers.test(n.layers)){const t=c.side;c.side=r.BackSide,c.needsUpdate=!0,Yt(s,i,n,l,c,h),c.side=t,c.needsUpdate=!0,a=!0}}!0===a&&(mt.updateMultisampleRenderTarget(it),mt.updateRenderTargetMipmap(it)),P.setRenderTarget(o),P.toneMapping=s}(o,s,e,i),n&&ut.viewport(F.copy(n)),o.length>0&&Xt(o,e,i),s.length>0&&Xt(s,e,i),a.length>0&&Xt(a,e,i),ut.buffers.depth.setTest(!0),ut.buffers.depth.setMask(!0),ut.buffers.color.setMask(!0),ut.setPolygonOffset(!1)}function Xt(t,e,i){const r=!0===e.isScene?e.overrideMaterial:null;for(let n=0,o=t.length;n<o;n++){const o=t[n],s=o.object,a=o.geometry,l=null===r?o.material:r,c=o.group;s.layers.test(i.layers)&&Yt(s,e,i,a,l,c)}}function Yt(t,e,i,n,o,s){t.onBeforeRender(P,e,i,n,o,s),t.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),o.onBeforeRender(P,e,i,n,t,s),!0===o.transparent&&o.side===r.DoubleSide&&!1===o.forceSinglePass?(o.side=r.BackSide,o.needsUpdate=!0,P.renderBufferDirect(i,e,n,o,t,s),o.side=r.FrontSide,o.needsUpdate=!0,P.renderBufferDirect(i,e,n,o,t,s),o.side=r.DoubleSide):P.renderBufferDirect(i,e,n,o,t,s),t.onAfterRender(P,e,i,n,o,s)}function Kt(t,e,i){!0!==e.isScene&&(e=ot);const r=dt.get(t),n=T.state.lights,o=T.state.shadowsArray,s=n.state.version,a=bt.getParameters(t,n.state,o,e,i),l=bt.getProgramCacheKey(a);let c=r.programs;r.environment=t.isMeshStandardMaterial?e.environment:null,r.fog=e.fog,r.envMap=(t.isMeshStandardMaterial?gt:ft).get(t.envMap||r.environment),void 0===c&&(t.addEventListener("dispose",jt),c=new Map,r.programs=c);let h=c.get(l);if(void 0!==h){if(r.currentProgram===h&&r.lightsStateVersion===s)return Zt(t,a),h}else a.uniforms=bt.getUniforms(t),t.onBuild(i,a,P),t.onBeforeCompile(a,P),h=bt.acquireProgram(a,l),c.set(l,h),r.uniforms=a.uniforms;const u=r.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(u.clippingPlanes=Tt.uniform),Zt(t,a),r.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),r.lightsStateVersion=s,r.needsLights&&(u.ambientLightColor.value=n.state.ambient,u.lightProbe.value=n.state.probe,u.directionalLights.value=n.state.directional,u.directionalLightShadows.value=n.state.directionalShadow,u.spotLights.value=n.state.spot,u.spotLightShadows.value=n.state.spotShadow,u.rectAreaLights.value=n.state.rectArea,u.ltc_1.value=n.state.rectAreaLTC1,u.ltc_2.value=n.state.rectAreaLTC2,u.pointLights.value=n.state.point,u.pointLightShadows.value=n.state.pointShadow,u.hemisphereLights.value=n.state.hemi,u.directionalShadowMap.value=n.state.directionalShadowMap,u.directionalShadowMatrix.value=n.state.directionalShadowMatrix,u.spotShadowMap.value=n.state.spotShadowMap,u.spotLightMatrix.value=n.state.spotLightMatrix,u.spotLightMap.value=n.state.spotLightMap,u.pointShadowMap.value=n.state.pointShadowMap,u.pointShadowMatrix.value=n.state.pointShadowMatrix);const p=h.getUniforms(),d=de.seqWithValue(p.seq,u);return r.currentProgram=h,r.uniformsList=d,h}function Zt(t,e){const i=dt.get(t);
2i.outputColorSpace=e.outputColorSpace,i.instancing=e.instancing,i.skinning=e.skinning,i.morphTargets=e.morphTargets,i.morphNormals=e.morphNormals,i.morphColors=e.morphColors,i.morphTargetsCount=e.morphTargetsCount,i.numClippingPlanes=e.numClippingPlanes,i.numIntersection=e.numClipIntersection,i.vertexAlphas=e.vertexAlphas,i.vertexTangents=e.vertexTangents,i.toneMapping=e.toneMapping}Ht.setAnimationLoop(function(t){Bt&&Bt(t)}),"undefined"!=typeof self&&Ht.setContext(self),this.setAnimationLoop=function(t){Bt=t,Nt.setAnimationLoop(t),null===t?Ht.stop():Ht.start()},Nt.addEventListener("sessionstart",Vt),Nt.addEventListener("sessionend",Gt),this.render=function(t,e){if(void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===L)return;!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),!0===Nt.enabled&&!0===Nt.isPresenting&&(!0===Nt.cameraAutoUpdate&&Nt.updateCamera(e),e=Nt.getCamera()),!0===t.isScene&&t.onBeforeRender(P,t,e,O),T=St.get(t,C.length),T.init(),C.push(T),rt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),Y.setFromProjectionMatrix(rt),et=this.localClippingEnabled,K=Tt.init(this.clippingPlanes,et),_=wt.get(t,E.length),_.init(),E.push(_),qt(t,e,0,P.sortObjects),_.finish(),!0===P.sortObjects&&_.sort(G,H),!0===K&&Tt.beginShadows();const i=T.state.shadowsArray;if(Et.render(i,t,e),!0===K&&Tt.endShadows(),!0===this.info.autoReset&&this.info.reset(),Mt.render(_,t),T.setupLights(P.useLegacyLights),e.isArrayCamera){const i=e.cameras;for(let e=0,r=i.length;e<r;e++){const r=i[e];Wt(_,t,r,r.viewport)}}else Wt(_,t,e);null!==O&&(mt.updateMultisampleRenderTarget(O),mt.updateRenderTargetMipmap(O)),!0===t.isScene&&t.onAfterRender(P,t,e),Rt.resetDefaultState(),D=-1,N=null,C.pop(),T=C.length>0?C[C.length-1]:null,E.pop(),_=E.length>0?E[E.length-1]:null},this.getActiveCubeFace=function(){return R},this.getActiveMipmapLevel=function(){return I},this.getRenderTarget=function(){return O},this.setRenderTargetTextures=function(t,e,i){dt.get(t.texture).__webglTexture=e,dt.get(t.depthTexture).__webglTexture=i;const r=dt.get(t);r.__hasExternalTextures=!0,r.__hasExternalTextures&&(r.__autoAllocateDepthBuffer=void 0===i,r.__autoAllocateDepthBuffer||!0===ct.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),r.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(t,e){const i=dt.get(t);i.__webglFramebuffer=e,i.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,i=0){O=t,R=e,I=i;let r=!0,n=null,o=!1,s=!1;if(t){const i=dt.get(t);void 0!==i.__useDefaultFramebuffer?(ut.bindFramebuffer(Ot.FRAMEBUFFER,null),r=!1):void 0===i.__webglFramebuffer?mt.setupRenderTarget(t):i.__hasExternalTextures&&mt.rebindTextures(t,dt.get(t.texture).__webglTexture,dt.get(t.depthTexture).__webglTexture);const a=t.texture;(a.isData3DTexture||a.isDataArrayTexture||a.isCompressedArrayTexture)&&(s=!0);const l=dt.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(n=l[e],o=!0):n=ht.isWebGL2&&t.samples>0&&!1===mt.useMultisampledRTT(t)?dt.get(t).__webglMultisampledFramebuffer:l,F.copy(t.viewport),U.copy(t.scissor),z=t.scissorTest}else F.copy(q).multiplyScalar(V).floor(),U.copy(W).multiplyScalar(V).floor(),z=X;if(ut.bindFramebuffer(Ot.FRAMEBUFFER,n)&&ht.drawBuffers&&r&&ut.drawBuffers(t,n),ut.viewport(F),ut.scissor(U),ut.setScissorTest(z),o){const r=dt.get(t.texture);Ot.framebufferTexture2D(Ot.FRAMEBUFFER,Ot.COLOR_ATTACHMENT0,Ot.TEXTURE_CUBE_MAP_POSITIVE_X+e,r.__webglTexture,i)}else if(s){const r=dt.get(t.texture),n=e||0;Ot.framebufferTextureLayer(Ot.FRAMEBUFFER,Ot.COLOR_ATTACHMENT0,r.__webglTexture,i||0,n)}D=-1},this.readRenderTargetPixels=function(t,e,i,n,o,s,a){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let l=dt.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(l=l[a]),l){ut.bindFramebuffer(Ot.FRAMEBUFFER,l);try{const a=t.texture,l=a.format,c=a.type;if(l!==r.RGBAFormat&&Lt.convert(l)!==Ot.getParameter(Ot.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const h=c===r.HalfFloatType&&(ct.has("EXT_color_buffer_half_float")||ht.isWebGL2&&ct.has("EXT_color_buffer_float"));if(!(c===r.UnsignedByteType||Lt.convert(c)===Ot.getParameter(Ot.IMPLEMENTATION_COLOR_READ_TYPE)||c===r.FloatType&&(ht.isWebGL2||ct.has("OES_texture_float")||ct.has("WEBGL_color_buffer_float"))||h))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-n&&i>=0&&i<=t.height-o&&Ot.readPixels(e,i,n,o,Lt.convert(l),Lt.convert(c),s)}finally{const t=null!==O?dt.get(O).__webglFramebuffer:null;ut.bindFramebuffer(Ot.FRAMEBUFFER,t)}}}
2,this.copyFramebufferToTexture=function(t,e,i=0){const r=Math.pow(2,-i),n=Math.floor(e.image.width*r),o=Math.floor(e.image.height*r);mt.setTexture2D(e,0),Ot.copyTexSubImage2D(Ot.TEXTURE_2D,i,0,0,t.x,t.y,n,o),ut.unbindTexture()},this.copyTextureToTexture=function(t,e,i,r=0){const n=e.image.width,o=e.image.height,s=Lt.convert(i.format),a=Lt.convert(i.type);mt.setTexture2D(i,0),Ot.pixelStorei(Ot.UNPACK_FLIP_Y_WEBGL,i.flipY),Ot.pixelStorei(Ot.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),Ot.pixelStorei(Ot.UNPACK_ALIGNMENT,i.unpackAlignment),e.isDataTexture?Ot.texSubImage2D(Ot.TEXTURE_2D,r,t.x,t.y,n,o,s,a,e.image.data):e.isCompressedTexture?Ot.compressedTexSubImage2D(Ot.TEXTURE_2D,r,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,s,e.mipmaps[0].data):Ot.texSubImage2D(Ot.TEXTURE_2D,r,t.x,t.y,s,a,e.image),0===r&&i.generateMipmaps&&Ot.generateMipmap(Ot.TEXTURE_2D),ut.unbindTexture()},this.copyTextureToTexture3D=function(t,e,i,r,n=0){if(P.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const o=t.max.x-t.min.x+1,s=t.max.y-t.min.y+1,a=t.max.z-t.min.z+1,l=Lt.convert(r.format),c=Lt.convert(r.type);let h;if(r.isData3DTexture)mt.setTexture3D(r,0),h=Ot.TEXTURE_3D;else{if(!r.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");mt.setTexture2DArray(r,0),h=Ot.TEXTURE_2D_ARRAY}Ot.pixelStorei(Ot.UNPACK_FLIP_Y_WEBGL,r.flipY),Ot.pixelStorei(Ot.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),Ot.pixelStorei(Ot.UNPACK_ALIGNMENT,r.unpackAlignment);const u=Ot.getParameter(Ot.UNPACK_ROW_LENGTH),p=Ot.getParameter(Ot.UNPACK_IMAGE_HEIGHT),d=Ot.getParameter(Ot.UNPACK_SKIP_PIXELS),m=Ot.getParameter(Ot.UNPACK_SKIP_ROWS),f=Ot.getParameter(Ot.UNPACK_SKIP_IMAGES),g=i.isCompressedTexture?i.mipmaps[0]:i.image;Ot.pixelStorei(Ot.UNPACK_ROW_LENGTH,g.width),Ot.pixelStorei(Ot.UNPACK_IMAGE_HEIGHT,g.height),Ot.pixelStorei(Ot.UNPACK_SKIP_PIXELS,t.min.x),Ot.pixelStorei(Ot.UNPACK_SKIP_ROWS,t.min.y),Ot.pixelStorei(Ot.UNPACK_SKIP_IMAGES,t.min.z),i.isDataTexture||i.isData3DTexture?Ot.texSubImage3D(h,n,e.x,e.y,e.z,o,s,a,l,c,g.data):i.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Ot.compressedTexSubImage3D(h,n,e.x,e.y,e.z,o,s,a,l,g.data)):Ot.texSubImage3D(h,n,e.x,e.y,e.z,o,s,a,l,c,g),Ot.pixelStorei(Ot.UNPACK_ROW_LENGTH,u),Ot.pixelStorei(Ot.UNPACK_IMAGE_HEIGHT,p),Ot.pixelStorei(Ot.UNPACK_SKIP_PIXELS,d),Ot.pixelStorei(Ot.UNPACK_SKIP_ROWS,m),Ot.pixelStorei(Ot.UNPACK_SKIP_IMAGES,f),0===n&&r.generateMipmaps&&Ot.generateMipmap(h),ut.unbindTexture()},this.initTexture=function(t){t.isCubeTexture?mt.setTextureCube(t,0):t.isData3DTexture?mt.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?mt.setTexture2DArray(t,0):mt.setTexture2D(t,0),ut.unbindTexture()},this.resetState=function(){R=0,I=0,O=null,ut.reset(),Rt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(t){console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!t}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===r.SRGBColorSpace?r.sRGBEncoding:r.LinearEncoding}set outputEncoding(t){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=t===r.sRGBEncoding?r.SRGBColorSpace:r.LinearSRGBColorSpace}}},576:(t,e,i)=>{i.r(e),i.d(e,{ShaderChunk:()=>r});const r={alphamap_fragment:"\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n\n#endif\n",alphamap_pars_fragment:"\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",alphatest_fragment:"\n#ifdef USE_ALPHATEST\n\n\tif ( diffuseColor.a < alphaTest ) discard;\n\n#endif\n",alphatest_pars_fragment:"\n#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif\n",aomap_fragment:"\n#ifdef USE_AOMAP\n\n\t// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\n\t\tfloat dotNV = saturate( dot
2( geometry.normal, geometry.viewDir ) );\n\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\n\t#endif\n\n#endif\n",aomap_pars_fragment:"\n#ifdef USE_AOMAP\n\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n\n#endif\n",begin_vertex:"\nvec3 transformed = vec3( position );\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n\n#ifdef USE_TANGENT\n\n\tvec3 objectTangent = vec3( tangent.xyz );\n\n#endif\n",bsdfs:"\n\nfloat G_BlinnPhong_Implicit( /* const in float dotNL, const in float dotNV */ ) {\n\n\t// geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)\n\treturn 0.25;\n\n}\n\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n\n}\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\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\n\tfloat G = G_BlinnPhong_Implicit( /* dotNL, dotNV */ );\n\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\n\treturn F * ( G * D );\n\n} // validated\n\n",iridescence_fragment:"\n\n#ifdef USE_IRIDESCENCE\n\n\t// XYZ to linear-sRGB color space\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\n\t// Assume air interface for top\n\t// Note: We don't handle the case fresnel0 == 1\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\n\t}\n\n\t// Conversion FO/IOR\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\n\t}\n\n\t// ior is a value between 1.0 and 3.0. 1.0 is air interface\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\n\t}\n\n\t// Fresnel equations for dielectric/dielectric interfaces.\n\t// Ref: https://belcour.github.io/blog/research/2017/05/01/brdf-thin-film.html\n\t// Evaluation XYZ sensitivity curves in Fourier space\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\n\t}\n\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\n\t\tvec3 I;\n\n\t\t// Force iridescenceIOR -> outsideIOR when thinFilmThickness -> 0.0\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\t// Evaluate the cosTheta on the base layer (Snell law)\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\n\t\t// Handle TIR:\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\n\t\t\t return vec3( 1.0 );\n\n\t\t}\n\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\n\t\t// First interface\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\n\t\t// Second interface\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); // guard against 1.0\n\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
2\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\n\t\t// Phase shift\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\n\t\t// Compound terms\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\n\t\t// Reflectance term for m = 0 (DC term amplitude)\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\n\t\t// Reflectance term for m > 0 (pairs of diracs)\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\n\t\t}\n\n\t\t// Since out of gamut colors might be produced, negative color values are clamped to 0.\n\t\treturn max( I, vec3( 0.0 ) );\n\n\t}\n\n#endif\n\n",bumpmap_pars_fragment:"\n#ifdef USE_BUMPMAP\n\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\n\t// Bump Mapping Unparametrized Surfaces on the GPU by Morten S. Mikkelsen\n\t// https://mmikk.github.io/papers3d/mm_sfgrad_bump.pdf\n\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n\tvec2 dHdxy_fwd() {\n\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\n\t\treturn vec2( dBx, dBy );\n\n\t}\n\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm; // normalized\n\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\n\t}\n\n#endif\n",clipping_planes_fragment:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvec4 plane;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\n\t\tbool clipped = true;\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t\tif ( clipped ) discard;\n\n\t#endif\n\n#endif\n",clipping_planes_pars_fragment:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvarying vec3 vClipPosition;\n\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n\n#endif\n",clipping_planes_pars_vertex:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvarying vec3 vClipPosition;\n\n#endif\n",clipping_planes_vertex:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvClipPosition = - mvPosition.xyz;\n\n#endif\n",color_fragment:"\n#if defined( USE_COLOR_ALPHA )\n\n\tdiffuseColor *= vColor;\n\n#elif defined( USE_COLOR )\n\n\tdiffuseColor.rgb *= vColor;\n\n#endif\n",color_pars_fragment:"\n#if defined( USE_COLOR_ALPHA )\n\n\tvarying vec4 vColor;\n\n#elif defined( USE_COLOR )\n\n\tvarying vec3 vColor;\n\n#endif\n",color_pars_vertex:"\n#if defined( USE_COLOR_ALPHA )\n\n\tvarying vec4 vColor;\n\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\n\tvarying vec3 vColor;\n\n#endif\n",color_vertex:"\n#if defined( USE_COLOR_ALPHA )\n\n\tvColor = vec4( 1.0 );\n\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\n\tvColor = vec3( 1.0 );\n\n#endif\n\n#ifdef USE_COLOR\n\n\tvColor *= color;\n\n#endif\n\n#ifdef USE_INSTANCING_COLOR\n\n\tvColor.xyz *= instanceColor.xyz;\n\n#endif\n",common:"\n#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\n#ifndef saturate\n// <tonemapping_pars_fragment> may have defined saturate() already\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\n\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 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 v ) { return dot( v, vec3( 0.3333333 ) ); }\n\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand( const in vec2 uv ) {\n\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\n\treturn fract( sin( sn ) * c );\n\n}\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\n\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\n\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\n\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n}\n\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t// dir can be either a direction vector or a normal vector\n\t// upper-left 3x3 of matrix is assumed to be orthogonal\n\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n\n}\n\nmat3 transposeMat3( const in mat3 m ) {\n\n\tmat3 tmp;\n\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\n\treturn tmp;\n\n}\n\nfloat luminance( const in vec3 rgb ) {\n\n\t// assumes rgb is in linear color space with sRGB primaries and D65 white point\n\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\n\treturn dot( weights, rgb );\n\n}\n\nbool isPerspectiveMatrix( mat4 m ) {\n\n\treturn m[ 2 ][ 3 ] == - 1.0;\n\n}\n\nvec2 equirectUv( in vec3 dir ) {\n\n\t// dir is assumed to be unit length\n\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\n\treturn vec2( u, v );\n\n}\n\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\n\treturn RECIPROCAL_PI * diffuseColor;\n\n} // validated\n\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\n\t// Original approximation by Christophe Schlick '94\n\t// float fresnel = pow( 1.0 - dotVH, 5.0 );\n\n\t// Optimized variant (presented by Epic at SIGGRAPH '13)\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n\n} // validated\n\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\n\t// Original approximation by Christophe Schlick '94\n\t// float fresnel = pow( 1.0 - dotVH, 5.0 );\n\n\t// Optimized variant (presented by Epic at SIGGRAPH '13)\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n\n} // validated\n",cube_uv_reflection_fragment:"\n#ifdef ENVMAP_TYPE_CUBE_UV\n\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\n\t// These shader functions convert between the UV coordinates of a single face of\n\t// a cubemap, the 0-5 integer index of a cube face, and the direction vector for\n\t// sampling a textureCube (not generally normalized ).\n\n\tfloat getFace( vec3 direction ) {\n\n\t\tvec3 absDirection = abs( direction );\n\n\t\tfloat face = - 1.0;\n\n\t\tif ( absDirection.x > absDirection.z ) {\n\n\t\t\tif ( absDirection.x > absDirection.y )\n\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\n\t\t\telse\n\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\n\t\t} else {\n\n\t\t\tif ( absDirection.z > absDirection.y )\n\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\n\t\t\telse\n\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\n\t\t}\n\n\t\treturn face;\n\n\t}\n\n\t// RH coordinate system; PMREM face-indexing convention\n\tvec2 getUV( vec3 direction, float face ) {\n\n\t\tvec2 uv;\n\n\t\tif ( face == 0.0 ) {\n\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x ); // pos x\n\n\t\t} else if ( face == 1.0 ) {\n\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y ); // pos y\n\n\t\t} else if ( face == 2.0 ) {\n\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z ); // pos z\n\n\t\t} else if ( face == 3.0 ) {\n\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x ); // neg x\n\n\t\t} else if ( face == 4.0 ) {\n\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y ); // neg y\n\n\t\t} else {\n\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z ); // neg z\n\n\t\t}\n\n\t\treturn 0.5 * ( uv + 1.0 );\n\n\t}\n\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\n\t\tfloat face = getFace( direction );\n\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\n\t\tfloat faceSize = exp2( mipInt );\n\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; // #25071\n\n\t\tif ( face > 2.0 ) {\n\n\t\t\tuv.y += faceSize;\n\n\t\t\tface -= 3.0;\n\n\t\t}\n\n\t\tuv.x += face * faceSize;\n\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\n\t\t#ifdef texture2DGradEXT\n\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; // disable anisotropic filtering\n\n\t\t#else\n\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\n\t\t#endif\n\n\t}\n\n\t// These defines must match with PMREMGenerator\n\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\n\tfloat roughnessToMip( float roughness ) {\n\n\t\tfloat mip = 0.0;\n\n\t\tif ( roughness >= cubeUV_r1 ) {\n\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\n\t\t} else {\n\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness ); // 1.16 = 1.79^0.25\n\t\t}\n\n\t\treturn mip;\n\n\t}\n\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\n\t\tfloat mipF = fract( mip );\n\n\t\tfloat mipInt = floor( mip );\n\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\n\t\tif ( mipF == 0.0 ) {\n\n\t\t\treturn vec4( color0, 1.0 );\n\n\t\t} else {\n\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\n\t\t}\n\n\t}\n\n#endif\n",defaultnormal_vertex:"\nvec3 transformedNormal = objectNormal;\n\n#ifdef USE_INSTANCING\n\n\t// this is in lieu of a per-instance normal-matrix\n\t// shear transforms in the instance matrix are not supported\n\n\tmat3 m = mat3( instanceMatrix );\n\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\n\ttransformedNormal = m * transformedNormal;\n\n#endif\n\ntransformedNormal = normalMatrix * transformedNormal;\n\n#ifdef FLIP_SIDED\n\n\ttransformedNormal = - transformedNormal;\n\n#endif\n\n#ifdef USE_TANGENT\n\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\n\t#ifdef FLIP_SIDED\n\n\t\ttransformedTangent = - transformedTangent;\n\n\t#endif\n\n#endif\n",displacementmap_pars_vertex:"\n#ifdef USE_DISPLACEMENTMAP\n\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n\n#endif\n",displacementmap_vertex:"\n#ifdef USE_DISPLACEMENTMAP\n\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
2placementBias );\n\n#endif\n",emissivemap_fragment:"\n#ifdef USE_EMISSIVEMAP\n\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n\n#endif\n",emissivemap_pars_fragment:"\n#ifdef USE_EMISSIVEMAP\n\n\tuniform sampler2D emissiveMap;\n\n#endif\n",encodings_fragment:"\ngl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\n\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\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}\n\n",envmap_fragment:"\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvec3 cameraToFrag;\n\n\t\tif ( isOrthographic ) {\n\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t} else {\n\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\n\t\t}\n\n\t\t// Transforming Normal Vectors with the Inverse Transformation\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\n\t\t#else\n\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#else\n\n\t\tvec3 reflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#else\n\n\t\tvec4 envColor = vec4( 0.0 );\n\n\t#endif\n\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n\t#endif\n\n#endif\n",envmap_common_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\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\n",envmap_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n\n#endif\n",envmap_pars_vertex:"\n#ifdef USE_ENVMAP\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\n\t#endif\n\n#endif\n",envmap_physical_pars_fragment:"\n#if defined( USE_ENVMAP )\n\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\n\t\t#else\n\n\t\t\treturn vec3( 0.0 );\n\n\t\t#endif\n\n\t}\n\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\n\t\t\t// Mixing the reflection with the normal is more accurate and keeps rough objects from gathering light from behind their tangent plane.\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\n\t\t#else\n\n\t\t\treturn vec3( 0.0 );\n\n\t\t#endif\n\n\t}\n\n#endif\n",envmap_vertex:"\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvWorldPosition = worldPosition.xyz;\n\n\t#else\n\n\t\tvec3 cameraToVertex;\n\n\t\tif ( isOrthographic ) {\n\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t}
2 else {\n\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\t\t}\n\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t\t#else\n\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#endif\n\n#endif\n",fog_vertex:"\n#ifdef USE_FOG\n\n\tvFogDepth = - mvPosition.z;\n\n#endif\n",fog_pars_vertex:"\n#ifdef USE_FOG\n\n\tvarying float vFogDepth;\n\n#endif\n",fog_fragment:"\n#ifdef USE_FOG\n\n\t#ifdef FOG_EXP2\n\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\n\t#endif\n\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n\n#endif\n",fog_pars_fragment:"\n#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\n\t#endif\n\n#endif\n",gradientmap_pars_fragment:"\n\n#ifdef USE_GRADIENTMAP\n\n\tuniform sampler2D gradientMap;\n\n#endif\n\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\n\t// dotNL will be from -1.0 to 1.0\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\n\t#ifdef USE_GRADIENTMAP\n\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\n\t#else\n\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\n\t#endif\n\n}\n",lightmap_fragment:"\n#ifdef USE_LIGHTMAP\n\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n\n#endif\n",lightmap_pars_fragment:"\n#ifdef USE_LIGHTMAP\n\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n\n#endif\n",lights_lambert_fragment:"\nLambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;\n",lights_lambert_pars_fragment:"\nvarying vec3 vViewPosition;\n\nstruct LambertMaterial {\n\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n\n};\n\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert\n",lights_pars_begin:"\nuniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\n\n// get the irradiance (radiance convolved with cosine lobe) at the point 'normal' on the unit sphere\n// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\n\t// normal is assumed to have unit length\n\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\n\t// band 0\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\n\t// band 1\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\n\t// band 2\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\n\treturn result;\n\n}\n\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\n\treturn irradiance;\n\n}\n\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\n\tvec3 irradiance = ambientLightColor;\n\n\treturn irradiance;\n\n}\n\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\n\t#if defined ( LEGACY_LIGHTS )\n\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\n\t\t}\n\n\t\treturn 1.0;\n\n\t#else\n\n\t\t// based upon Frostbite 3 Moving to Physically-based Rendering\n\t\t// page 32, equation 26: E[window1]\n\t\t// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\n\t\tif ( cutoffDistance > 0.0 ) {\n\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\n\t\t}\n\n\t\treturn distanceFalloff;\n\n\t#endif\n\n}\n\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n\n}\n\n#if NUM_DIR_LIGHTS > 0\n\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\n\t}\n\n#endif\n\n\n#if NUM_POINT_LIGHTS > 0\n\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\n\t// light is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\n\t\tlight.direction = normalize( lVector );\n\n\t\tfloat lightDistance = length( lVector );\n\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\n\t}
2\n\n#endif\n\n\n#if NUM_SPOT_LIGHTS > 0\n\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\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\n\t// light is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\n\t\tlight.direction = normalize( lVector );\n\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\n\t\tif ( spotAttenuation > 0.0 ) {\n\n\t\t\tfloat lightDistance = length( lVector );\n\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\n\t\t} else {\n\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\n\t\t}\n\n\t}\n\n#endif\n\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\n\t// Pre-computed values of LinearTransformedCosine approximation of BRDF\n\t// BRDF approximation Texture is 64x64\n\tuniform sampler2D ltc_1; // RGBA Float\n\tuniform sampler2D ltc_2; // RGBA Float\n\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n\n#endif\n\n\n#if NUM_HEMI_LIGHTS > 0\n\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\n\t\treturn irradiance;\n\n\t}\n\n#endif\n",lights_toon_fragment:"\nToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\n",lights_toon_pars_fragment:"\nvarying vec3 vViewPosition;\n\nstruct ToonMaterial {\n\n\tvec3 diffuseColor;\n\n};\n\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n",lights_phong_fragment:"\nBlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"\nvarying vec3 vViewPosition;\n\nstruct BlinnPhongMaterial {\n\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n\n};\n\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n\n}\n\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n",lights_physical_fragment:"\nPhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\n\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\n\nmaterial.roughness = max( roughnessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.\nmaterial.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n\n#ifdef IOR\n\n\tmaterial.ior = ior;\n\n\t#ifdef USE_SPECULAR\n\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\n\t\t#endif\n\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\n\t\t#endif\n\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\n\t#else\n\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\n\t#endif\n\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n\n#else\n\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n\n#endif\n\n#ifdef USE_CLEARCOAT\n\n\tmaterial.clearcoat = clearcoat;
2\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\n\t#ifdef USE_CLEARCOATMAP\n\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\n\t#endif\n\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\n\t#endif\n\n\tmaterial.clearcoat = saturate( material.clearcoat ); // Burley clearcoat model\n\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n\n#endif\n\n#ifdef USE_IRIDESCENCE\n\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\n\t#ifdef USE_IRIDESCENCEMAP\n\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\n\t#endif\n\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\n\t#else\n\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\n\t#endif\n\n#endif\n\n#ifdef USE_SHEEN\n\n\tmaterial.sheenColor = sheenColor;\n\n\t#ifdef USE_SHEEN_COLORMAP\n\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\n\t#endif\n\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\n\t#endif\n\n#endif\n",lights_physical_pars_fragment:'\n\nstruct PhysicalMaterial {\n\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\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\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\n};\n\n// temporary\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\n\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\n\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\n\treturn 0.5 / max( gv + gl, EPSILON );\n\n}\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is "roughness squared" in Disneyâs reparameterization\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1\n\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n\n}\n\n#ifdef USE_CLEARCOAT\n\n\t// GGX Distribution, Schlick Fresnel, GGX_SmithCorrelated Visibility\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\n\t\tfloat alpha = pow2( roughness ); // UE4\'s roughness\n\n\t\tvec3 halfDir = normalize( lightDir + viewDir );
2\n\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\n\t\tfloat D = D_GGX( alpha, dotNH );\n\n\t\treturn F * ( V * D );\n\n\t}\n\n#endif\n\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\n\tfloat alpha = pow2( roughness ); // UE4\'s roughness\n\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\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\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\n\t#ifdef USE_IRIDESCENCE\n\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\n\t#endif\n\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\n\tfloat D = D_GGX( alpha, dotNH );\n\n\treturn F * ( V * D );\n\n}\n\n// Rect Area Light\n\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\n// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt\n// code: https://github.com/selfshadow/ltc_code/\n\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\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\n\tfloat dotNV = saturate( dot( N, V ) );\n\n\t// texture parameterized by sqrt( GGX alpha ) and sqrt( 1 - cos( theta ) )\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\treturn uv;\n\n}\n\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\n\t// Real-Time Area Lighting: a Journey from Research to Production (p.102)\n\t// An approximation of the form factor of a horizon-clipped rectangle.\n\n\tfloat l = length( f );\n\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n\n}\n\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\n\tfloat x = dot( v1, v2 );\n\n\tfloat y = abs( x );\n\n\t// rational polynomial approximation to theta / sin( theta ) / 2PI\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\n\tfloat theta_sintheta = ( x >
2 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\n\treturn cross( v1, v2 ) * theta_sintheta;\n\n}\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\n\t// bail if point is on back side of plane of light\n\t// assumes ccw winding order of light vertices\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\n\t// construct orthonormal basis around N\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system\n\n\t// compute transform\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\n\t// transform rect\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\n\t// project rect onto sphere\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\n\t// calculate vector form factor\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\n\t// adjust for horizon clipping\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\n/*\n\t// alternate method of adjusting for horizon clipping (see referece)\n\t// refactoring required\n\tfloat len = length( vectorFormFactor );\n\tfloat z = vectorFormFactor.z / len;\n\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\n\t// tabulated horizon-clipped sphere, apparently...\n\tvec2 uv = vec2( z * 0.5 + 0.5, len );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\tfloat scale = texture2D( ltc_2, uv ).w;\n\n\tfloat result = len * scale;\n*/\n\n\treturn vec3( result );\n\n}\n\n// End Rect Area Light\n\n#if defined( USE_SHEEN )\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs\nfloat D_Charlie( float roughness, float dotNH ) {\n\n\tfloat alpha = pow2( roughness );\n\n\t// Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF"\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 ); // 2^(-14/2), so sin2h^2 > 0 in fp16\n\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n\n}\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\n\t// Neubelt and Pettineo 2013, "Crafting a Next-gen Material Pipeline for The Order: 1886"\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n\n}\n\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\n\treturn sheenColor * ( D * V );\n\n}\n\n#endif\n\n// This is a curve-fit approxmation to the "Charlie sheen" BRDF integrated over the hemisphere from \n// Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF". The analysis can be found\n// in the Sheen section of https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\n\tfloat dotNV = saturate( dot
2( normal, viewDir ) );\n\n\tfloat r2 = roughness * roughness;\n\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\n\treturn saturate( DG * RECIPROCAL_PI );\n\n}\n\n// Analytical approximation of the DFG LUT, one half of the\n// split-sum approximation used in indirect specular lighting.\n// via \'environmentBRDF\' from "Physically Based Shading on Mobile"\n// https://www.unrealengine.com/blog/physically-based-shading-on-mobile\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\n\tvec4 r = roughness * c0 + c1;\n\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\n\treturn fab;\n\n}\n\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\n\treturn specularColor * fab.x + specularF90 * fab.y;\n\n}\n\n// Fdez-Agüera\'s "Multiple-Scattering Microfacet Model for Real-Time Image Based Lighting"\n// Approximates multiscattering in order to preserve energy.\n// http://www.jcgt.org/published/0008/01/03/\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\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#endif\n\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\n\t#ifdef USE_IRIDESCENCE\n\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\n\t#else\n\n\t\tvec3 Fr = specularColor;\n\n\t#endif\n\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; // 1/21\n\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n\n}\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\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\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight; // counterclockwise; light shines in local neg z direction\n\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\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\n\t\t// LTC Fresnel Approximation by Stephen Hill\n\t\t// http://blog.selfshadow.com/publications/s2016-advances/s2016_ltc_fresnel.pdf\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\n\t}\n\n#endif\n\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot
2( geometry.normal, directLight.direction ) );\n\n\tvec3 irradiance = dotNL * directLight.color;\n\n\t#ifdef USE_CLEARCOAT\n\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material );\n\n\t#endif\n\n\t#ifdef USE_SHEEN\n\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\n\t#endif\n\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material );\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\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\n\t#ifdef USE_CLEARCOAT\n\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\n\t#endif\n\n\t#ifdef USE_SHEEN\n\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\n\t#endif\n\n\t// Both indirect specular and indirect diffuse light accumulate here\n\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\n\t#ifdef USE_IRIDESCENCE\n\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\n\t#else\n\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\n\t#endif\n\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\n}\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\n\n// ref: https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n\n}\n',lights_fragment_begin:"\n/**\n * This is a template that can be used to light a material, it uses pluggable\n * RenderEquations (RE)for specific lighting scenarios.\n *\n * Instructions for use:\n * - Ensure that both RE_Direct, RE_IndirectDiffuse and RE_IndirectSpecular are defined\n * - Create a material parameter that is to be passed as the third parameter to your lighting functions.\n *\n * TODO:\n * - Add area light support.\n * - Add sphere light support.\n * - Add diffuse light probe (irradiance cubemap) support.\n */\n\nGeometricContext geometry;\n\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\n#ifdef USE_CLEARCOAT\n\n\tgeometry.clearcoatNormal = clearcoatNormal;
2\n\n#endif\n\n#ifdef USE_IRIDESCENCE\n\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\n\tif ( material.iridescenceThickness == 0.0 ) {\n\n\t\tmaterial.iridescence = 0.0;\n\n\t} else {\n\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\n\t}\n\n\tif ( material.iridescence > 0.0 ) {\n\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\n\t\t// Iridescence F0 approximation\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\n\t}\n\n#endif\n\nIncidentLight directLight;\n\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tpointLight = pointLights[ i ];\n\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( 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\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tspotLight = spotLights[ i ];\n\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\n\t\t// spot lights are ordered [shadows with maps, shadows without maps, maps without shadows, none]\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\n\tRectAreaLight rectAreaLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n\n\tvec3 iblIrradiance = vec3( 0.0 );\n\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n\n#endif\n",lights_fragment_maps:"\n#if defined( RE_IndirectDiffuse )\n\n\t#ifdef USE_LIGHTMAP\n\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\n\t\tirradiance += lightMapIrradiance;\n\n\t#endif\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\n\t#endif\n\n#endif\n\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\n\t#ifdef USE_CLEARCOAT\n\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\n\t#endif\n\n#endif\n",lights_fragment_end:"\n#if defined( RE_IndirectDiffuse )\n\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n\n#endif\n",logdepthbuf_fragment:"\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\t// Doing a strict comparison with == 1.0 can cause noise artifacts\n\t// on some platforms. See issue #17623.\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n\n#endif\n",logdepthbuf_pars_fragment:"\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n\n#endif\n",logdepthbuf_pars_vertex:"\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\n\t#else\n\n\t\tuniform float logDepthBufFC;\n\n\t#endif\n\n#endif\n",logdepthbuf_vertex:"\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\n\t#else\n\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\n\t\t\tgl_Position.z *= gl_Position.w;\n\n\t\t}\n\n\t#endif\n\n#endif\n",map_fragment:"\n#ifdef USE_MAP\n\n\tdiffuseColor *= texture2D( map, vMapUv );\n\n#endif\n",map_pars_fragment:"\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n",map_particle_fragment:"\n#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\t#if defined( USE_POINTS_UV )\n\n\t\tvec2 uv = vUv;\n\n\t#else\n\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\n\t#endif\n\n#endif\n\n#ifdef USE_MAP\n\n\tdiffuseColor *= texture2D( map, uv );\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n\n#endif\n",map_particle_pars_fragment:"\n#if defined( USE_POINTS_UV )\n\n\tvarying vec2 vUv;\n\n#else\n\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\t\tuniform mat3 uvTransform;\n\n\t#endif\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",metalnessmap_fragment:"\nfloat metalnessFactor = metalness;\n\n#ifdef USE_METALNESSMAP\n\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tmetalnessFactor *= texelMetalness.b;\n\n#endif\n",metalnessmap_pars_fragment:"\n#ifdef USE_METALNESSMAP\n\n\tuniform sampler2D metalnessMap;\n\n#endif\n",morphcolor_vertex:"\n#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in normal = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\tvColor *= morphTargetBaseInfluence;\n\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\n\t\t#if defined( USE_COLOR_ALPHA )\n\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\n\t\t#elif defined( USE_COLOR )\n\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\n\t\t#endif\n\n\t}\n\n#endif\n",morphnormal_vertex:"\n#ifdef USE_MORPHNORMALS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in normal = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\tobjectNormal *= morphTargetBaseInfluence;\n\n\t#ifdef MORPHTARGETS_TEXTURE\n\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\n\t\t}\n\n\t#else\n\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\n\t#endif\n\n#endif\n",morphtarget_pars_vertex:"\n#ifdef USE_MORPHTARGETS\n\n\tuniform float morphTargetBaseInfluence;\n\n\t#ifdef MORPHTARGETS_TEXTURE\n\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\n\t\t}\n\n\t#else\n\n\t\t#ifndef USE_MORPHNORMALS\n\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\n\t\t#else\n\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\n\t\t#endif\n\n\t#endif\n\n#endif\n",morphtarget_vertex:"\n#ifdef USE_MORPHTARGETS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in position = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\ttransformed *= morphTargetBaseInfluence;\n\n\t#ifdef MORPHTARGETS_TEXTURE\n\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\n\t\t}\n\n\t#else\n\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\n\t\t#ifndef USE_MORPHNORMALS\n\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\n\t\t#endif\n\n\t#endif\n\n#endif\n",normal_fragment_begin:"\nfloat faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n\n#ifdef FLAT_SHADED\n\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n\n#else\n\n\tvec3 normal = normalize( vNormal );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal *= faceDirection;\n\n\t#endif\n\n#endif\n\n#ifdef USE_NORMALMAP_TANGENTSPACE\n\n\t#ifdef USE_TANGENT\n\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\n\t#else\n\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal, vNormalMapUv );\n\n\t#endif\n\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\n\t#endif\n\n#endif\n\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\t#ifdef USE_TANGENT\n\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\n\t#else\n\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\n\t#endif\n\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\n\t#endif\n\n#endif\n\n// non perturbed normal for clearcoat among others\n\nvec3 geometryNormal = normal;\n\n",normal_fragment_maps:"\n\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals\n\n\t#ifdef FLIP_SIDED\n\n\t\tnormal = - normal;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * faceDirection;\n\n\t#endif\n\n\tnormal = normalize( normalMatrix * normal );\n\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\n\tnormal = normalize( tbn * mapN );
2\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n\n#endif\n",normal_pars_fragment:"\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n",normal_pars_vertex:"\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n",normal_vertex:"\n#ifndef FLAT_SHADED // normal is computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n\t#ifdef USE_TANGENT\n\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\n\t#endif\n\n#endif\n",normalmap_pars_fragment:"\n#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n#endif\n\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\n\tuniform mat3 normalMatrix;\n\n#endif\n\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\n\t// Normal Mapping Without Precomputed Tangents\n\t// http://www.thetenthplanet.de/archives/1180\n\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\n\t\tvec3 N = surf_norm; // normalized\n\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\n\t\treturn mat3( T * scale, B * scale, N );\n\n\t}\n\n#endif\n",clearcoat_normal_fragment_begin:"\n#ifdef USE_CLEARCOAT\n\n\tvec3 clearcoatNormal = geometryNormal;\n\n#endif\n",clearcoat_normal_fragment_maps:"\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n\n#endif\n",clearcoat_pars_fragment:"\n\n#ifdef USE_CLEARCOATMAP\n\n\tuniform sampler2D clearcoatMap;\n\n#endif\n\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n\n#endif\n\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\tuniform sampler2D clearcoatRoughnessMap;\n\n#endif\n",iridescence_pars_fragment:"\n\n#ifdef USE_IRIDESCENCEMAP\n\n\tuniform sampler2D iridescenceMap;\n\n#endif\n\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\n\tuniform sampler2D iridescenceThicknessMap;\n\n#endif\n",output_fragment:"\n#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n\n// https://github.com/mrdoob/three.js/pull/22425\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha + 0.1;\n#endif\n\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\n",packing:"\nvec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\n\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\n\nconst float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\nconst float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)\n\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\n\nconst float ShiftRight8 = 1. / 256.;\n\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8; // tidy overflow\n\treturn r * PackUpscale;\n}\n\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\n\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\n\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\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}\n\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\n\n// NOTE: viewZ, the z-coordinate in camera space, is negative for points in front of the camera\n\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\t// -near maps to 0; -far maps to 1\n\treturn ( viewZ + near ) / ( near - far );\n}\n\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\t// maps orthographic depth in [ 0, 1 ] to viewZ\n\treturn depth * ( near - far ) - near;\n}\n\n// NOTE: https://twitter.com/gonnavis/status/1377183786949959682\n\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\t// -near maps to 0; -far maps to 1\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\n\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\t// maps perspective depth in [ 0, 1 ] to viewZ\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}\n",premultiplied_alpha_fragment:"\n#ifdef PREMULTIPLIED_ALPHA\n\n\t// Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation.\n\tgl_FragColor.rgb *= gl_FragColor.a;\n\n#endif\n",project_vertex:"\nvec4 mvPosition = vec4( transformed, 1.0 );\n\n#ifdef USE_INSTANCING\n\n\tmvPosition = instanceMatrix * mvPosition;\n\n#endif\n\nmvPosition = modelViewMatrix * mvPosition;\n\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"\n#ifdef DITHERING\n\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n\n#endif\n",dithering_pars_fragment:"\n#ifdef DITHERING\n\n\t// based on https://www.shadertoy.com/view/MslGR8\n\tvec3 dithering( vec3 color ) {\n\t\t//Calculate grid position\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\n\t\t//Shift the individual colors differently, thus making it even harder to see the dithering pattern\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\n\t\t//modify shift according to grid position.\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\n\t\t//shift the color by dither_shift\n\t\treturn color + dither_shift_RGB;\n\t}\n\n#endif\n",roughnessmap_fragment:"\nfloat roughnessFactor = roughness;\n\n#ifdef USE_ROUGHNESSMAP\n\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\troughnessFactor *= texelRoughness.g;\n\n#endif\n",roughnessmap_pars_fragment:"\n#ifdef USE_ROUGHNESSMAP\n\n\tuniform sampler2D roughnessMap;
2\n\n#endif\n",shadowmap_pars_fragment:"\n#if NUM_SPOT_LIGHT_COORDS > 0\n\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n\n#endif\n\n#if NUM_SPOT_LIGHT_MAPS > 0\n\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n\n#endif\n\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\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\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\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\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\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\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): create uniforms for area light shadows\n\n\t#endif\n\t*/\n\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\n\t}\n\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\n\t}\n\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\n\t\tfloat occlusion = 1.0;\n\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\n\t\tfloat hard_shadow = step( compare , distribution.x ); // Hard Shadow\n\n\t\tif (hard_shadow != 1.0 ) {\n\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 ); // Chebeyshevs inequality\n\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); // 0.3 reduces light bleed\n\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\n\t\t}\n\t\treturn occlusion;\n\n\t}\n\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\n\t\tfloat shadow = 1.0;\n\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\n\t\tif ( frustumTest ) {\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\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\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\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\n\t\t\tvec2 uv = shadowCoord.xy;
2\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\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\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#else // no percentage-closer filtering:\n\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#endif\n\n\t\t}\n\n\t\treturn shadow;\n\n\t}\n\n\t// cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D\n\t// vector suitable for 2D texture mapping. This code uses the following layout for the\n\t// 2D texture:\n\t//\n\t// xzXZ\n\t// y Y\n\t//\n\t// Y - Positive y direction\n\t// y - Negative y direction\n\t// X - Positive x direction\n\t// x - Negative x direction\n\t// Z - Positive z direction\n\t// z - Negative z direction\n\t//\n\t// Source and test bed:\n\t// https://gist.github.com/tschw/da10c43c467ce8afd0c4\n\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\n\t\t// Number of texels to avoid at the edge of each square\n\n\t\tvec3 absV = abs( v );\n\n\t\t// Intersect unit cube\n\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\n\t\t// Apply scale to avoid seams\n\n\t\t// two texels less per square (one texel will do for NEAREST)\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\n\t\t// Unwrap\n\n\t\t// space: -1 ... 1 range for each square\n\t\t//\n\t\t// #X##\t\tdim := ( 4 , 2 )\n\t\t// # #\t\tcenter := ( 1 , 1 )\n\n\t\tvec2 planar = v.xy;\n\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\n\t\tif ( absV.z >= almostOne ) {\n\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\n\t\t} else if ( absV.x >= almostOne ) {\n\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\n\t\t} else if ( absV.y >= almostOne ) {\n\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\n\t\t}\n\n\t\t// Transform to UV space\n\n\t\t// scale := 0.5 / dim\n\t\t// translate := ( center + 0.5 ) / dim\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\n\t}\n\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\n\t\t// for point lights, the uniform @vShadowCoord is re-purposed to hold\n\t\t// the vector from the light to the world-space position of the fragment.\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\n\t\t// dp = normalized distance from light to fragment position\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp?\n\t\tdp += shadowBias;\n\n\t\t// bd3D = base direction 3D\n\t\tvec3 bd3D = normalize( lightToPosition );\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\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\n\t\t#else // no percentage-closer filtering\n\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\n\t\t#endif\n\n\t}
2\n\n#endif\n",shadowmap_pars_vertex:"\n\n#if NUM_SPOT_LIGHT_COORDS > 0\n\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n\n#endif\n\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\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\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\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\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\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\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): uniforms for area light shadows\n\n\t#endif\n\t*/\n\n#endif\n",shadowmap_vertex:"\n\n#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\n\t// Offsetting the position used for querying occlusion along the world normal can be used to reduce shadow acne.\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n\n#endif\n\n#if defined( USE_SHADOWMAP )\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update vAreaShadowCoord with area light info\n\n\t#endif\n\t*/\n\n#endif\n\n// spot lights can be evaluated without active shadow mapping (when SpotLight.map is used)\n\n#if NUM_SPOT_LIGHT_COORDS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n\n",shadowmask_pars_fragment:"\nfloat getShadowMask() {\n\n\tfloat shadow = 1.0;\n\n\t#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\tDirectionalLightShadow directionalLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\tSpotLightShadow spotLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0;
2 i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\tPointLightShadow pointLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\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\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update shadow for Area light\n\n\t#endif\n\t*/\n\n\t#endif\n\n\treturn shadow;\n\n}\n",skinbase_vertex:"\n#ifdef USE_SKINNING\n\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\n#endif\n",skinning_pars_vertex:"\n#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\n\tmat4 getBoneMatrix( const in float i ) {\n\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\n\t\ty = dy * ( y + 0.5 );\n\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\treturn bone;\n\n\t}\n\n#endif\n",skinning_vertex:"\n#ifdef USE_SKINNING\n\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\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\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n\n#endif\n",skinnormal_vertex:"\n#ifdef USE_SKINNING\n\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\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\n\t#ifdef USE_TANGENT\n\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\n\t#endif\n\n#endif\n",specularmap_fragment:"\nfloat specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif\n",specularmap_pars_fragment:"\n#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif\n",tonemapping_fragment:"\n#if defined( TONE_MAPPING )\n\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n\n#endif\n",tonemapping_pars_fragment:"\n#ifndef saturate\n// <common> may have defined saturate() already\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n\nuniform float toneMappingExposure;\n\n// exposure only\nvec3 LinearToneMapping( vec3 color ) {\n\n\treturn toneMappingExposure * color;\n\n}\n\n// source: https://www.cs.utah.edu/docs/techreports/2002/pdf/UUCS-02-001.pdf\nvec3 ReinhardToneMapping( vec3 color ) {\n\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n\n}\n\n// source: http://filmicworlds.com/blog/filmic-tonemapping-operators/\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\n\t// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson\n\tcolor *= toneMappingExposure;
2\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\n}\n\n// source: https://github.com/selfshadow/ltc_code/blob/master/webgl/shaders/ltc/ltc_blit.fs\nvec3 RRTAndODTFit( vec3 v ) {\n\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\n}\n\n// this implementation of ACES is modified to accommodate a brighter viewing environment.\n// the scale factor of 1/0.6 is subjective. see discussion in #19621.\n\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\n\t// sRGB => XYZ => D65_2_D60 => AP1 => RRT_SAT\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ), // transposed from source\n\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\n\t// ODT_SAT => XYZ => D60_2_D65 => sRGB\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ), // transposed from source\n\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\n\tcolor *= toneMappingExposure / 0.6;\n\n\tcolor = ACESInputMat * color;\n\n\t// Apply RRT and ODT\n\tcolor = RRTAndODTFit( color );\n\n\tcolor = ACESOutputMat * color;\n\n\t// Clamp to [0, 1]\n\treturn saturate( color );\n\n}\n\nvec3 CustomToneMapping( vec3 color ) { return color; }\n",transmission_fragment:"\n#ifdef USE_TRANSMISSION\n\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\n\t#ifdef USE_TRANSMISSIONMAP\n\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\n\t#endif\n\n\t#ifdef USE_THICKNESSMAP\n\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\n\t#endif\n\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );\n\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\n\n#endif\n",transmission_pars_fragment:"\n#ifdef USE_TRANSMISSION\n\n\t// Transmission code is based on glTF-Sampler-Viewer\n\t// https://github.com/KhronosGroup/glTF-Sample-Viewer\n\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\n\t#ifdef USE_TRANSMISSIONMAP\n\n\t\tuniform sampler2D transmissionMap;\n\n\t#endif\n\n\t#ifdef USE_THICKNESSMAP\n\n\t\tuniform sampler2D thicknessMap;\n\n\t#endif\n\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\n\tvarying vec3 vWorldPosition;\n\n\t// Mipped Bicubic Texture Filtering by N8\n\t// https://www.shadertoy.com/view/Dl2SDW\n\n\tfloat w0( float a ) {\n\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\n\t}\n\n\tfloat w1( float a ) {\n\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\n\t}\n\n\tfloat w2( float a ){\n\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\n\t}\n\n\tfloat w3( float a ) {\n\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\n\t}\n\n\t// g0 and g1 are the two amplitude functions\n\tfloat g0( float a ) {\n\n\t\treturn w0( a ) + w1( a );\n\n\t}\n\n\tfloat g1( float a ) {\n\n\t\treturn w2( a ) + w3( a );\n\n\t}\n\n\t// h0 and h1 are the two offset functions\n\tfloat h0( float a ) {\n\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\n\t}\n\n\tfloat h1( float a ) {\n\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\n\t}\n\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\n\t\tuv = uv * texelSize.zw + 0.5;\n\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\n\t}\n\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\n\t}\n\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\n\t\t// Direction of refracted light.\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\n\t\t// Compute rotation-independant scaling of the model matrix.\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\n\t\t// The thickness is specified in local space.\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\n\t}\n\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\n\t\t// Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and\n\t\t// an IOR of 1.5 results in the default amount of microfacet refraction.\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\n\t}\n\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\n\t}\n\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\n\t\tif ( isinf( attenuationDistance ) ) {\n\n\t\t\t// Attenuation distance is +â, i.e. the transmitted color is not attenuated at all.\n\t\t\treturn radiance;\n\n\t\t} else {\n\n\t\t\t// Compute light attenuation using Beer's law.\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); // Beer's law\n\t\t\treturn transmittance * radiance;\n\n\t\t}\n\n\t}\n\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\n\t\t// Project refracted vector on the framebuffer, while mapping to normalized device coordinates.\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\n\t\t// Sample framebuffer to get pixel the refracted ray hits.\
2n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\n\t\t// Get the specular component.\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\n\t}\n#endif\n",uv_pars_fragment:"\n#ifdef USE_UV\n\n\tvarying vec2 vUv;\n\n#endif\n#ifdef USE_MAP\n\n\tvarying vec2 vMapUv;\n\n#endif\n#ifdef USE_ALPHAMAP\n\n\tvarying vec2 vAlphaMapUv;\n\n#endif\n#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vLightMapUv;\n\n#endif\n#ifdef USE_AOMAP\n\n\tvarying vec2 vAoMapUv;\n\n#endif\n#ifdef USE_BUMPMAP\n\n\tvarying vec2 vBumpMapUv;\n\n#endif\n#ifdef USE_NORMALMAP\n\n\tvarying vec2 vNormalMapUv;\n\n#endif\n#ifdef USE_EMISSIVEMAP\n\n\tvarying vec2 vEmissiveMapUv;\n\n#endif\n#ifdef USE_METALNESSMAP\n\n\tvarying vec2 vMetalnessMapUv;\n\n#endif\n#ifdef USE_ROUGHNESSMAP\n\n\tvarying vec2 vRoughnessMapUv;\n\n#endif\n#ifdef USE_CLEARCOATMAP\n\n\tvarying vec2 vClearcoatMapUv;\n\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tvarying vec2 vClearcoatNormalMapUv;\n\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\tvarying vec2 vClearcoatRoughnessMapUv;\n\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\n\tvarying vec2 vIridescenceMapUv;\n\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\n\tvarying vec2 vIridescenceThicknessMapUv;\n\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\n\tvarying vec2 vSheenColorMapUv;\n\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\n\tvarying vec2 vSheenRoughnessMapUv;\n\n#endif\n#ifdef USE_SPECULARMAP\n\n\tvarying vec2 vSpecularMapUv;\n\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\n\tvarying vec2 vSpecularColorMapUv;\n\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\n\tvarying vec2 vSpecularIntensityMapUv;\n\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n\n#endif\n#ifdef USE_THICKNESSMAP\n\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n\n#endif\n",uv_pars_vertex:"\n#ifdef USE_UV\n\n\tvarying vec2 vUv;\n\n#endif\n#ifdef USE_MAP\n\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n\n#endif\n#ifdef USE_ALPHAMAP\n\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n\n#endif\n#ifdef USE_LIGHTMAP\n\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n\n#endif\n#ifdef USE_AOMAP\n\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n\n#endif\n#ifdef USE_BUMPMAP\n\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n\n#endif\n#ifdef USE_NORMALMAP\n\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n\n#endif\n#ifdef USE_EMISSIVEMAP\n\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n\n#endif\n#ifdef USE_METALNESSMAP\n\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n\n#endif\n#ifdef USE_ROUGHNESSMAP\n\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n\n#endif\n#ifdef USE_CLEARCOATMAP\n\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n\n#endif\n#ifdef USE_SPECULARMAP\n\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n\n#endif\n#ifdef USE_THICKNESSMAP\n\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n\n#endif\n",uv_vertex:"\n#ifdef USE_UV\n\n\tvUv = vec3( uv, 1 ).xy;\n\n#endif\n#ifdef USE_MAP\n\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_ALPHAMAP\n\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_LIGHTMAP\n\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_AOMAP\n\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_BUMPMAP\n\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_NORMALMAP\n\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_EMISSIVEMAP\n\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_METALNESSMAP\n\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_ROUGHNESSMAP\n\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_CLEARCOATMAP\n\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
2\n\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_SPECULARMAP\n\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_THICKNESSMAP\n\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n\n#endif\n",worldpos_vertex:"\n#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\n\t#ifdef USE_INSTANCING\n\n\t\tworldPosition = instanceMatrix * worldPosition;\n\n\t#endif\n\n\tworldPosition = modelMatrix * worldPosition;\n\n#endif\n",background_vert:"\nvarying vec2 vUv;\nuniform mat3 uvTransform;\n\nvoid main() {\n\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n\n}\n",background_frag:"\nuniform sampler2D t2D;\nuniform float backgroundIntensity;\n\nvarying vec2 vUv;\n\nvoid main() {\n\n\tvec4 texColor = texture2D( t2D, vUv );\n\n\ttexColor.rgb *= backgroundIntensity;\n\n\tgl_FragColor = texColor;\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",backgroundCube_vert:"\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\n\tgl_Position.z = gl_Position.w; // set z to camera.far\n\n}\n",backgroundCube_frag:"\n\n#ifdef ENVMAP_TYPE_CUBE\n\n\tuniform samplerCube envMap;\n\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\tuniform sampler2D envMap;\n\n#endif\n\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\n\nvarying vec3 vWorldDirection;\n\n#include <cube_uv_reflection_fragment>\n\nvoid main() {\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\n\t#else\n\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t#endif\n\n\ttexColor.rgb *= backgroundIntensity;\n\n\tgl_FragColor = texColor;\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",cube_vert:"\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\n\tgl_Position.z = gl_Position.w; // set z to camera.far\n\n}\n",cube_frag:"\nuniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\n\nvarying vec3 vWorldDirection;\n\nvoid main() {\n\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",depth_vert:"\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 <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>
2\n\n// This is used for computing an equivalent of gl_FragCoord.z that is as high precision as possible.\n// Some platforms compute gl_FragCoord at a lower precision which makes the manually computed value better for\n// depth-based postprocessing effects. Reproduced on iPad with A10 processor / iPadOS 13.3.1.\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\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\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n",depth_frag:"\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\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>\n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n",distanceRGBA_vert:"\n#define DISTANCE\n\nvarying vec3 vWorldPosition;\n\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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\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\n\tvWorldPosition = worldPosition.xyz;\n\n}\n",distanceRGBA_frag:"\n#define DISTANCE\n\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n\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>\n\nvoid main () {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\n\n\tgl_FragColor = packDepthToRGBA( dist );\n\n}\n",equirect_vert:"\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\n}\n",equirect_frag:"\nuniform sampler2D tEquirect;\n\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvec3 direction = normalize( vWorldDirection );\n\n\tvec2 sampleUV = equirectUv( direction );\n\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",linedashed_vert:"\nuniform float scale;\nattribute float lineDistance;\n\nvarying float vLineDistance;\n\n#include <common>\n#include <uv_pars_vertex>\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>\n\nvoid main() {\n\n\tvLineDistance = scale * lineDistance;\n\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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\n}\n",linedashed_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\nuniform float dashSize;\nuniform float totalSize;\n\nvarying float vLineDistance;\n\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\n\t\tdiscard;\n\n\t}\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\n\toutgoingLight = diffuseColor.rgb; // simple shader\n\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\n}\n",meshbasic_vert:"\n#include <common>\n#include <uv_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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\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\n\t#endif\n\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\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshbasic_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\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 <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\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\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\n\t// accumulation (baked indirect lighting only)\n\t#ifdef USE_LIGHTMAP\n\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\n\t#endif\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\n\t#include <envmap_fragment>\n\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\n}\n",meshlambert_vert:"\n#define LAMBERT\n\nvarying vec3 vViewPosition;\n\n#include <common>\n#include <uv_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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\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\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\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshlambert_frag:"\n#define LAMBERT\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n\n#include <common>\n#include <packing>\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 <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 <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_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>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\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\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\n\t// accumulation\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\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\n}\n",meshmatcap_vert:"\n#define MATCAP\n\nvarying vec3 vViewPosition;\n\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\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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\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\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n}\n",meshmatcap_frag:"\n#define MATCAP\n\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\n\nvarying vec3 vViewPosition;\n\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>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\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\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; // 0.495 to remove artifacts caused by undersized matcap disks\n\n\t#ifdef USE_MATCAP\n\n\t\tvec4 matc
2apColor = texture2D( matcap, uv );\n\n\t#else\n\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); // default if matcap is missing\n\n\t#endif\n\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\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\n}\n",meshnormal_vert:"\n#define NORMAL\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\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\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\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\n\tvViewPosition = - mvPosition.xyz;\n\n#endif\n\n}\n",meshnormal_frag:"\n#define NORMAL\n\nuniform float opacity;\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\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>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\n\t#ifdef OPAQUE\n\n\t\tgl_FragColor.a = 1.0;\n\n\t#endif\n\n}\n",meshphong_vert:"\n#define PHONG\n\nvarying vec3 vViewPosition;\n\n#include <common>\n#include <uv_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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\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\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\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshphong_frag:"\n#define PHONG\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n\n#include <common>\n#include <packing>\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 <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 <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>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\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\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\n\t// accumulation\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\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\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\n}\n",meshphysical_vert:"\n#define STANDARD\n\nvarying vec3 vViewPosition;\n\n#ifdef USE_TRANSMISSION\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\n#include <common>\n#include <uv_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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\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\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\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n#ifdef USE_TRANSMISSION\n\n\tvWorldPosition = worldPosition.xyz;\n\n#endif\n}\n",meshphysical_frag:"\n#define STANDARD\n\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n\n#ifdef IOR\n\tuniform float ior;\n#endif\n\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;
2\n\tuniform float clearcoatRoughness;\n#endif\n\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n\nvarying vec3 vViewPosition;\n\n#include <common>\n#include <packing>\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 <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\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 <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\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\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\n\t// accumulation\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\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\n\t#include <transmission_fragment>\n\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\n\t#ifdef USE_SHEEN\n\n\t\t// Sheen energy compensation approximation calculation can be found at the end of\n\t\t// https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\n\t#endif\n\n\t#ifdef USE_CLEARCOAT\n\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;
2\n\n\t#endif\n\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\n}\n",meshtoon_vert:"\n#define TOON\n\nvarying vec3 vViewPosition;\n\n#include <common>\n#include <uv_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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\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\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\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshtoon_frag:"\n#define TOON\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n\n#include <common>\n#include <packing>\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 <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>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\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\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\n\t// accumulation\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\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\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\n}\n",points_vert:"\nuniform float size;\nuniform float scale;\n\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>\n\n#ifdef USE_POINTS_UV\n\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n\n#endif\n\nvoid main() {\n\n\t#ifdef USE_POINTS_UV\n\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n\t#endif\n\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\n\tgl_PointSize = size;\n\n\t#ifdef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\n\t#endif\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n\n}\n",points_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\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>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\n\toutgoingLight = diffuseColor.rgb;\n\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\n}\n",shadow_vert:"\n#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\n\nvoid main() {\n\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\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\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",shadow_frag:"\nuniform vec3 color;\nuniform float opacity;\n\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n\nvoid main() {\n\n\t#include <logdepthbuf_fragment>\n\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n",sprite_vert:"\nuniform float rotation;\nuniform vec2 center;\n\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\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\n\t#ifndef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\n\t#endif\n\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\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\n\tmvPosition.xy += rotatedPosition;\n\n\tgl_Position = projectionMatrix * mvPosition;\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n}\n",sprite_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\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>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\toutgoingLight = diffuseColor.rgb;\n\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n"}},9984:(t,e,i)=>{i.r(e),i.d(e,{ShaderLib:()=>h});var r=i(576),n=i(5143),o=i(5448),s=i(6815),a=i(6729),l=i(5971),c=i(8955);const h={basic:{uniforms:(0,n.mergeUniforms)([a.UniformsLib.common,a.UniformsLib.specularmap,a.UniformsLib.envmap,a.UniformsLib.aomap,a.UniformsLib.lightmap,a.UniformsLib.fog]),vertexShader:r.ShaderChunk.meshbasic_vert,fragmentShader:r.ShaderChunk.meshbasic_frag},lambert:{uniforms:(0,n.mergeUniforms)([a.UniformsLib.common,a.UniformsLib.specularmap,a.UniformsLib.envmap,a.UniformsLib.aomap,a.UniformsLib.lightmap,a.UniformsLib.emissivemap,a.UniformsLib.bumpmap,a.UniformsLib.normalmap,a.UniformsLib.displacementmap,a.UniformsLib.fog,a.UniformsLib.lights,{emissive:{value:new l.Color(0)}}]),vertexShader:r.ShaderChunk.meshlambert_vert,fragmentShader:r.ShaderChunk.meshlambert_frag},phong:{uniforms:(0,n.mergeUniforms)([a.UniformsLib.common,a.UniformsLib.specularmap,a.UniformsLib.envmap,a.UniformsLib.aomap,a.UniformsLib.lightmap,a.UniformsLib.emissivemap,a.UniformsLib.bumpmap,a.UniformsLib.normalmap,a.UniformsLib.displacementmap,a.UniformsLib.fog,a.UniformsLib.lights,{emissive:{value:new l.Color(0)},specular:{value:new l.Color(1118481)},shininess:{value:30}}]),vertexShader:r.ShaderChunk.meshphong_vert,fragmentShader:r.ShaderChunk.meshphong_frag},standard:{uniforms:(0,n.mergeUniforms)([a.UniformsLib.common,a.UniformsLib.envmap,a.UniformsLib.aomap,a.UniformsLib.lightmap,a.UniformsLib.emissivemap,a.UniformsLib.bumpmap,a.UniformsLib.normalmap,a.UniformsLib.displacementmap,a.UniformsLib.roughnessmap,a.UniformsLib.metalnessmap,a.UniformsLib.fog,a.UniformsLib.lights,{emissive:{value:new l.Color(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:r.ShaderChunk.meshphysical_vert,fragmentShader:r.ShaderChunk.meshphysical_frag},toon:{uniforms:(0,n.mergeUniforms)([a.UniformsLib.common,a.UniformsLib.aomap,a.UniformsLib.lightmap,a.UniformsLib.emissivemap,a.UniformsLib.bumpmap,a.UniformsLib.normalmap,a.UniformsLib.displacementmap,a.UniformsLib.gradientmap,a.UniformsLib.fog,a.UniformsLib.lights,{emissive:{value:new l.Color(0)}}]),vertexShader:r.ShaderChunk.meshtoon_vert,fragmentShader:r.ShaderChunk.meshtoon_frag},matcap:{uniforms:(0,n.mergeUniforms)([a.UniformsLib.common,a.UniformsLib.bumpmap,a.UniformsLib.normalmap,a.UniformsLib.displacementmap,a.UniformsLib.fog,{matc
2ap:{value:null}}]),vertexShader:r.ShaderChunk.meshmatcap_vert,fragmentShader:r.ShaderChunk.meshmatcap_frag},points:{uniforms:(0,n.mergeUniforms)([a.UniformsLib.points,a.UniformsLib.fog]),vertexShader:r.ShaderChunk.points_vert,fragmentShader:r.ShaderChunk.points_frag},dashed:{uniforms:(0,n.mergeUniforms)([a.UniformsLib.common,a.UniformsLib.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:r.ShaderChunk.linedashed_vert,fragmentShader:r.ShaderChunk.linedashed_frag},depth:{uniforms:(0,n.mergeUniforms)([a.UniformsLib.common,a.UniformsLib.displacementmap]),vertexShader:r.ShaderChunk.depth_vert,fragmentShader:r.ShaderChunk.depth_frag},normal:{uniforms:(0,n.mergeUniforms)([a.UniformsLib.common,a.UniformsLib.bumpmap,a.UniformsLib.normalmap,a.UniformsLib.displacementmap,{opacity:{value:1}}]),vertexShader:r.ShaderChunk.meshnormal_vert,fragmentShader:r.ShaderChunk.meshnormal_frag},sprite:{uniforms:(0,n.mergeUniforms)([a.UniformsLib.sprite,a.UniformsLib.fog]),vertexShader:r.ShaderChunk.sprite_vert,fragmentShader:r.ShaderChunk.sprite_frag},background:{uniforms:{uvTransform:{value:new c.Matrix3},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:r.ShaderChunk.background_vert,fragmentShader:r.ShaderChunk.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:r.ShaderChunk.backgroundCube_vert,fragmentShader:r.ShaderChunk.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:r.ShaderChunk.cube_vert,fragmentShader:r.ShaderChunk.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:r.ShaderChunk.equirect_vert,fragmentShader:r.ShaderChunk.equirect_frag},distanceRGBA:{uniforms:(0,n.mergeUniforms)([a.UniformsLib.common,a.UniformsLib.displacementmap,{referencePosition:{value:new s.Vector3},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:r.ShaderChunk.distanceRGBA_vert,fragmentShader:r.ShaderChunk.distanceRGBA_frag},shadow:{uniforms:(0,n.mergeUniforms)([a.UniformsLib.lights,a.UniformsLib.fog,{color:{value:new l.Color(0)},opacity:{value:1}}]),vertexShader:r.ShaderChunk.shadow_vert,fragmentShader:r.ShaderChunk.shadow_frag}};h.physical={uniforms:(0,n.mergeUniforms)([h.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new c.Matrix3},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new c.Matrix3},clearcoatNormalScale:{value:new o.Vector2(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new c.Matrix3},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new c.Matrix3},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new c.Matrix3},sheen:{value:0},sheenColor:{value:new l.Color(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new c.Matrix3},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new c.Matrix3},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new c.Matrix3},transmissionSamplerSize:{value:new o.Vector2},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new c.Matrix3},attenuationDistance:{value:0},attenuationColor:{value:new l.Color(0)},specularColor:{value:new l.Color(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new c.Matrix3},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new c.Matrix3}}]),vertexShader:r.ShaderChunk.meshphysical_vert,fragmentShader:r.ShaderChunk.meshphysical_frag}},6729:(t,e,i)=>{i.r(e),i.d(e,{UniformsLib:()=>s});var r=i(5971),n=i(5448),o=i(8955);const s={common:{diffuse:{value:new r.Color(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new o.Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new o.Matrix3},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new o.Matrix3}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new o.Matrix3}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new o.Matrix3}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new o.Matrix3},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new o.Matrix3},normalScale:{value:new n.Vector2(1,1)}}
2,displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new o.Matrix3},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new o.Matrix3}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new o.Matrix3}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new o.Matrix3}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new r.Color(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:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{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 r.Color(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new o.Matrix3}},sprite:{diffuse:{value:new r.Color(16777215)},opacity:{value:1},center:{value:new n.Vector2(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new o.Matrix3},alphaMap:{value:null},alphaTest:{value:0}}}},5143:(t,e,i)=>{i.r(e),i.d(e,{UniformsUtils:()=>l,cloneUniforms:()=>n,cloneUniformsGroups:()=>s,getUnlitUniformColorSpace:()=>a,mergeUniforms:()=>o});var r=i(6271);function n(t){const e={};for(const i in t){e[i]={};for(const r in t[i]){const n=t[i][r];n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture||n.isQuaternion)?n.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[i][r]=null):e[i][r]=n.clone():Array.isArray(n)?e[i][r]=n.slice():e[i][r]=n}}return e}function o(t){const e={};for(let i=0;i<t.length;i++){const r=n(t[i]);for(const t in r)e[t]=r[t]}return e}function s(t){const e=[];for(let i=0;i<t.length;i++)e.push(t[i].clone());return e}function a(t){return null===t.getRenderTarget()?t.outputColorSpace:r.LinearSRGBColorSpace}const l={clone:n,merge:o}},7436:(t,e,i)=>{i.r(e),i.d(e,{Fog:()=>n});var r=i(5971);class n{constructor(t,e=1,i=1e3){this.isFog=!0,this.name="",this.color=new r.Color(t),this.near=e,this.far=i}clone(){return new n(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}},5808:(t,e,i)=>{i.r(e),i.d(e,{Scene:()=>n});var r=i(2481);class n extends r.Object3D{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(t){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=t}}},862:(t,e,i)=>{i.r(e),i.d(e,{CubeTexture:()=>o});var r=i(394),n=i(6271);class o extends r.Texture{constructor(t,e,i,r,o,s,a,l,c,h){super(t=void 0!==t?t:[],e=void 0!==e?e:n.CubeReflectionMapping,i,r,o,s,a,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}},7941:(t,e,i)=>{i.r(e),i.d(e,{DataTexture:()=>o});var r=i(394),n=i(6271);class o extends r.Texture{constructor(t=null,e=1,i=1,r,o,s,a,l,c=n.NearestFilter,h=n.NearestFilter,u,p){super(null,s,a,l,c,h,r,o,u,p),this.isDataTexture=!0,this.image={data:t,width:e,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}},4791:(t,e,i)=>{i.d(e,{H:()=>o});var r=i(7300),n=i(3334);class o{constructor(t=null){this.isSource=!0,this.uuid=n.generateUUID(),this.data=t,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(null!==r){let t;if(Array.isArray(r)){t=[];for(let e=0,i=r.length;e<i;e++)r[e].isDataTexture?t.push(s(r[e].image)):t.push(s(r[e]))}else t=s(r);i.url=t}return e||(t.images[this.uuid]=i),i}}function s(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?r.P.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}},394:(t,e,i)=>{i.r(e),i.d(e,{Texture:()=>u});var r=i(2356),n=i(6271),o=i(3334),s=i(5448),a=i(8955),l=i(4791),c=i(1968);let h=0;class u extends r.EventDispatcher{constructor(t=u.DEFAULT_IMAGE,e=u.DEFAULT_MAPPING,i=n.ClampToEdgeWrapping,r=n.ClampToEdgeWrapping,p=n.LinearFilter,d=n.LinearMipmapLinearFilter,m=n.RGBAFormat,f=n.UnsignedByteType,g=u.DEFAULT_ANISOTROPY,y=n.NoColorSpace){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:h++}),this.uuid=o.generateUUID(),this.name="",this.source=new l.H(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=p,this.minFilter=d,this.anisotropy=g,this.format=m,this.internalFormat=null,this.type=f,this.offset=new s.Vector2(0,0),this.repeat=new s.Vector2(1,1),this.center=new s.Vector2(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new a.Matrix3,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,"string"==typeof y?this.colorSpace
2=y:((0,c.O4)("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=y===n.sRGBEncoding?n.SRGBColorSpace:n.NoColorSpace),this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t=null){this.source.data=t}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(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const i={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==n.UVMapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case n.RepeatWrapping:t.x=t.x-Math.floor(t.x);break;case n.ClampToEdgeWrapping:t.x=t.x<0?0:1;break;case n.MirroredRepeatWrapping:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case n.RepeatWrapping:t.y=t.y-Math.floor(t.y);break;case n.ClampToEdgeWrapping:t.y=t.y<0?0:1;break;case n.MirroredRepeatWrapping:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return(0,c.O4)("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===n.SRGBColorSpace?n.sRGBEncoding:n.LinearEncoding}set encoding(t){(0,c.O4)("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===n.sRGBEncoding?n.SRGBColorSpace:n.NoColorSpace}}u.DEFAULT_IMAGE=null,u.DEFAULT_MAPPING=n.UVMapping,u.DEFAULT_ANISOTROPY=1},1968:(t,e,i)=>{function r(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function n(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}i.d(e,{H7:()=>r,O4:()=>s,c:()=>n}),Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;const o={};function s(t){t in o||(o[t]=!0,console.warn(t))}}},__webpack_module_cache__={};function __nested_webpack_require_2605317__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var i=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t].call(i.exports,i,i.exports,__nested_webpack_require_2605317__),i.exports}__nested_webpack_require_2605317__.d=(t,e)=>{for(var i in e)__nested_webpack_require_2605317__.o(e,i)&&!__nested_webpack_require_2605317__.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},__nested_webpack_require_2605317__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}
2}(),__nested_webpack_require_2605317__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__nested_webpack_require_2605317__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{const t=__nested_webpack_require_2605317__(8935),e=__nested_webpack_require_2605317__(9636),i=__nested_webpack_require_2605317__(5234);self.H.map.render.harp={RenderEngine:t.RenderEngine,ProjectionType:i.ProjectionType,Style:e.Style}})()})()}).call(self),__webpack_exports__.A=H}}]);
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.